agentleFS
Robotti-ioRobotti-io/copilot-security-instructions/skills/secrets-and-logging-hygiene/SKILL.md

secrets-and-logging-hygiene

Skill42 starsChanged 10 months agoApache-2.0View on GitHub

Workflow for preventing secret leaks and sensitive logging (PII/credentials) and adding redaction defaults.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when asked to scan for secrets, harden logging, or reduce sensitive data exposure.

    line 10
  2. Distinctive:

    Default to structured logs

    line 28
  3. Distinctive:

    Avoid logging full request/response bodies by default

    line 30
  4. Distinctive:

    Add guardrails: git hooks, CI secret scanning, unit tests for redaction

    line 33
  5. Distinctive:

    Add tests ensuring redaction occurs

    line 35
  6. Distinctive:

    Run a lightweight grep for common secret patterns and known keys

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Secrets and Logging Hygiene

When to use

Use this skill when asked to scan for secrets, harden logging, or reduce sensitive data exposure.

Inputs to collect (if available)

  • Data classification (PII, auth/session, payments)
  • Logging/telemetry stack (logger, APM, sinks)
  • Secret management approach (vault, env injection, KMS)
  • Incident/audit requirements (retention, access controls)

Step-by-step process

  1. Identify sensitive data
    • Credentials, tokens, API keys, connection strings
    • PII (emails, phone, addresses), financial identifiers
  2. Locate sources and sinks
    • Sources: env, config, secrets managers, request payloads
    • Sinks: logs, telemetry, error pages, analytics, support dumps
  3. Harden logging
    • Default to structured logs
    • Redact known patterns (Authorization headers, cookies, tokens)
    • Avoid logging full request/response bodies by default
  4. Prevent secret introduction
    • Replace hardcoded strings with env/secret manager references
    • Add guardrails: git hooks, CI secret scanning, unit tests for redaction
  5. Verify
    • Add tests ensuring redaction occurs
    • Run a lightweight grep for common secret patterns and known keys

Output

  • List of leak points found (if any)
  • Recommended redaction policy + implementation location
  • Tests and verification steps

Repo integration (optional)

Related prompts:

  • check-for-secrets.prompt.md
  • assess-logging.prompt.md

Output format

  • Leak points found (table): Type | Where | Evidence | Risk
  • Redaction policy: defaults + allow-listed fields
  • Guardrails: CI secret scanning, pre-commit, tests
  • Verification: how to confirm redaction and rotation

Examples

  • “Authorization header logged” → redact Authorization and cookies by default; verify logs no longer contain bearer tokens.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.