agentleFS
DariuszDuszaDariuszDusza/agentic-workflow-foundry/.agents/skills/secret-and-pii-handling/SKILL.md

secret-and-pii-handling

Skill1 starsChanged 28 days agoApache-2.0View on GitHub

Use when a task touches credentials, secrets, tokens, environment files, key files, infrastructure state or variables files, or customer and tenant data, or when writing a log line, an error path, a report, a fixture or a prompt that could carry any of them. Also the first stop when a secret or API key has leaked: pasted into a log, a commit, a chat or a report. Keeps secret values out of transcripts, commits, logs and model providers, and customer data out of reports.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Customer data is not test data: Never commit, copy, sample or quote a customer file, record or filename.

    line 28
  2. Very specific:

    Data class decides where it may go: Before sending content to a model provider (a prompt, an embedding, an eval), check its class against …

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Secret and PII handling

Required context

  1. .agents/guardrails/data-handling.md: the rules for secrets, PII, logs and reports.
  2. .agents/rules/credential-surface.md: applies whenever a credential-shaped file is touched.
  3. .agents/policy/data-classification.yml: the classes (public, internal, confidential, secret) and the handling rule for each.
  4. .agents/policy/provider-routes.yml: which class may go to which model provider tier.
  5. .agents/guardrails/repo-hygiene.md: the ignore rules that keep credentials out of history; changing those rules is .agents/skills/workspace-import/SKILL.md.

The rules that bite

  • Never read a credential file to "check" something. The permissions ask before such reads (.agents/policy/permissions.yml) and the answer is usually no. Example files are the safe surface: a key missing there is added as a placeholder, never learned from the real file.
  • Never echo a secret value into chat, a commit message, a diff, a doc, a log line, a work item or a generated file. Refer to the variable's name. Assume a CLI's verbose or JSON output is wider than what it shows a person, because it often includes the credential.
  • Infrastructure state is a secret. It holds resolved values in plaintext: never committed, never read for convenience, never pasted.
  • Customer data is not test data. Never commit, copy, sample or quote a customer file, record or filename. When a bug needs a real case, ask the operator for a redacted one.
  • Scrub before you paste. A stack trace can carry a connection string; a request dump can carry a bearer token. Name the class of value, never the value.
  • Data class decides where it may go. Before sending content to a model provider (a prompt, an embedding, an eval), check its class against .agents/policy/provider-routes.yml. Confidential and secret data does not go to a tier the route file does not allow, however convenient.
  • Test fixtures that need a secret shape build it at runtime from obviously fake parts, so the secret scanner never flags the repository and nothing real is ever pasted in.
  • A new credential class goes in the root .gitignore, not only a sub-project's, because the next sibling with the same file shape is otherwise uncovered.
  • If a secret may have been exposed, say so immediately and plainly, naming the class and the place, never the value. Rotation is the operator's call and it is time-sensitive.

Verify

tools/check-secrets.sh        # no secret-shaped values in tracked files
tools/preflight-init.sh       # what git add would stage; refuses on credential shapes
make test-gates               # includes both tools' own suites

Reviewer: security-data-reviewer.

Escalate when

  • Anything would read a credential store, an environment file or infrastructure state.
  • A key needs rotating, or a secret may already be in a commit, a pushed branch or a transcript.
  • A task needs real customer data, or would send confidential data to a model provider.
  • Any other trigger in .agents/policy/model-policy.md. An approval covers the action it was given for, once.

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.