Secrets Handling
Overview
This skill defines how to handle secrets (API keys, passwords, tokens, certificates, credentials) when they appear in work products, configurations, or communications. Improper secrets handling is a critical security risk that can compromise systems and data. Treat ALL secrets as sensitive.
When to Use
- When configuring any service that requires authentication
- When working with environment variables or configuration files
- When creating documentation that references secure systems
- When integrating with external APIs or services
- When reviewing code or configuration that may contain secrets
- When setting up CI/CD pipelines with deployment credentials
- Don't use when: Working only with public, non-sensitive information
Core Procedures
Step 1: Identify Secrets
Recognize these as secrets requiring special handling:
- API keys and access tokens
- Database connection strings with credentials
- Passwords, passphrases, and PINs
- SSL/TLS certificates and private keys
- OAuth client secrets and refresh tokens
- SSH keys and deployment credentials
- Webhook secrets and signing keys
- Encryption keys and initialization vectors
- Personal identifiable information (PII)
- Financial data, account numbers
Step 2: Secret Classification
Classify each secret by sensitivity:
| Level |
Description |
Examples |
| CRITICAL |
Full system access, production data |
Prod DB passwords, root keys |
| HIGH |
Service-level access, staging systems |
API keys, staging credentials |
| MEDIUM |
Limited scope, non-critical systems |
Test tokens, sandbox keys |
| LOW |
Public or near-public information |
API documentation, public certs |
Step 3: Secure Usage
NEVER DO:
- Hardcode secrets in source code, configuration files, or documentation
- Pass secrets in URLs or query parameters
- Log secrets to console, log files, or monitoring systems
- Share secrets in plain text communications
- Store secrets in environment files committed to repositories
- Include secrets in handoff packages or deliverables
ALWAYS DO:
- Use secret management systems (env vars from secure vaults)
- Reference secrets by identifier, not by value
- Use placeholders in documentation:
[API_KEY] or ${SECRET_NAME}
- Access secrets through established secure channels only
- Rotate secrets regularly and after any potential exposure
Step 4: Document Secrets Safely
When documentation must reference secrets:
# Configuration
DATABASE_URL=postgresql://user:${DB_PASSWORD}@host:5432/db
API_KEY=${MY_SERVICE_API_KEY}
# Setup (do NOT include actual values)
Required secrets:
- DB_PASSWORD: PostgreSQL database password (from vault: db/prod/password)
- MY_SERVICE_API_KEY: API key from MyService dashboard (from vault: integrations/myservice/key)
Step 5: Secret Detection in Deliverables
Before delivering any work:
Step 6: Exposure Response
If you discover exposed secrets:
- IMMEDIATELY flag the exposure and identify the affected secret(s)
- Notify the security team (Guardian, Sentinel, Gatekeeper) or company CEO
- Do NOT share the exposed secret further
- Document the incident (what, where, when) for security team investigation
- Recommend secret rotation be performed immediately
Quality Checklist
Error Handling
- Error: Secret accidentally exposed in communication
Response: IMMEDIATELY revoke and rotate the secret, notify security team
- Error: Work requires a secret you don't have access to
Response: Request secret through proper channel (security/infrastructure team), never ask another agent for it
- Error: Found hardcoded secret in existing codebase
Response: Flag as security issue, fix with proper secret management, report to security agent
- Error: Secret has expired or is invalid
Response: Request renewal through proper channel, document expiration for monitoring
Cross-Team Integration
Related Skills: data-privacy-check, threat-modeling, audit-trail-management, incident-response
Used By: ALL agents (especially backend engineers, infrastructure, database, integrators)
1---2name: secrets-handling3description: Use when working with API keys, credentials, tokens, certificates, or any sensitive configuration. This skill provides procedures for securely handling secrets throughout their lifecycle - from identification to storage, usage, rotation, and revocation.4---56# Secrets Handling78## Overview9This skill defines how to handle secrets (API keys, passwords, tokens, certificates, credentials) when they appear in work products, configurations, or communications. Improper secrets handling is a critical security risk that can compromise systems and data. Treat ALL secrets as sensitive.1011## When to Use12- When configuring any service that requires authentication13- When working with environment variables or configuration files14- When creating documentation that references secure systems15- When integrating with external APIs or services16- When reviewing code or configuration that may contain secrets17- When setting up CI/CD pipelines with deployment credentials18- **Don't use when:** Working only with public, non-sensitive information1920## Core Procedures2122### Step 1: Identify Secrets23Recognize these as secrets requiring special handling:24- API keys and access tokens25- Database connection strings with credentials26- Passwords, passphrases, and PINs27- SSL/TLS certificates and private keys28- OAuth client secrets and refresh tokens29- SSH keys and deployment credentials30- Webhook secrets and signing keys31- Encryption keys and initialization vectors32- Personal identifiable information (PII)33- Financial data, account numbers3435### Step 2: Secret Classification36Classify each secret by sensitivity:3738| Level | Description | Examples |39|-------|-------------|---------|40| CRITICAL | Full system access, production data | Prod DB passwords, root keys |41| HIGH | Service-level access, staging systems | API keys, staging credentials |42| MEDIUM | Limited scope, non-critical systems | Test tokens, sandbox keys |43| LOW | Public or near-public information | API documentation, public certs |4445### Step 3: Secure Usage4647#### NEVER DO:48- Hardcode secrets in source code, configuration files, or documentation49- Pass secrets in URLs or query parameters50- Log secrets to console, log files, or monitoring systems51- Share secrets in plain text communications52- Store secrets in environment files committed to repositories53- Include secrets in handoff packages or deliverables5455#### ALWAYS DO:56- Use secret management systems (env vars from secure vaults)57- Reference secrets by identifier, not by value58- Use placeholders in documentation: `[API_KEY]` or `${SECRET_NAME}`59- Access secrets through established secure channels only60- Rotate secrets regularly and after any potential exposure6162### Step 4: Document Secrets Safely63When documentation must reference secrets:64```65# Configuration66DATABASE_URL=postgresql://user:${DB_PASSWORD}@host:5432/db67API_KEY=${MY_SERVICE_API_KEY}6869# Setup (do NOT include actual values)70Required secrets:71- DB_PASSWORD: PostgreSQL database password (from vault: db/prod/password)72- MY_SERVICE_API_KEY: API key from MyService dashboard (from vault: integrations/myservice/key)73```7475### Step 5: Secret Detection in Deliverables76Before delivering any work:77- [ ] Scan all files for patterns matching: `password`, `secret`, `key`, `token`, `credential`78- [ ] Check for common secret formats: base64 strings, hex strings, connection strings79- [ ] Verify no test fixtures contain real credentials (use mock values only)80- [ ] Confirm documentation uses placeholders, not actual values81- [ ] Run secrets detection tools if available8283### Step 6: Exposure Response84If you discover exposed secrets:851. **IMMEDIATELY** flag the exposure and identify the affected secret(s)862. Notify the security team (Guardian, Sentinel, Gatekeeper) or company CEO873. Do NOT share the exposed secret further884. Document the incident (what, where, when) for security team investigation895. Recommend secret rotation be performed immediately9091## Quality Checklist92- [ ] No secrets present in source code, documentation, or deliverables93- [ ] All secret references use secure vault or environment variable patterns94- [ ] Documentation uses placeholders with setup instructions95- [ ] Secret classification is documented if applicable96- [ ] Secret detection scan was performed on all files97- [ ] Any discovered exposures are flagged and reported9899## Error Handling100- **Error:** Secret accidentally exposed in communication101 **Response:** IMMEDIATELY revoke and rotate the secret, notify security team102- **Error:** Work requires a secret you don't have access to103 **Response:** Request secret through proper channel (security/infrastructure team), never ask another agent for it104- **Error:** Found hardcoded secret in existing codebase105 **Response:** Flag as security issue, fix with proper secret management, report to security agent106- **Error:** Secret has expired or is invalid107 **Response:** Request renewal through proper channel, document expiration for monitoring108109## Cross-Team Integration110**Related Skills:** data-privacy-check, threat-modeling, audit-trail-management, incident-response111**Used By:** ALL agents (especially backend engineers, infrastructure, database, integrators)