Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/data-privacy-stack/presidio/agents-mdgit clone --depth 1 https://github.com/data-privacy-stack/presidioWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01478 | $0.01478 |
| Opus 5 | $0.00739 | $0.00739 |
| Sonnet 5 | $0.00296 | $0.00296 |
| Haiku 4.5 | $0.00148 | $0.00148 |
Grade A, and why
presidio AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Presidio — Agent Guidelines
Presidio is a Python SDK for detecting (presidio-analyzer) and anonymizing (presidio-anonymizer) PII in text and images, plus CLI, structured-data, and image-redaction components. It is a widely used library: users depend on current detection behavior, and configuration files written years ago must keep working. Correctness and backward compatibility outrank cleverness.
The review-side versions of these rules — which the Copilot PR review agent
also enforces — live in .github/copilot-instructions.md and
.github/instructions/*.instructions.md. Follow them at authoring time so the
review finds nothing.
Working in this repo
cd presidio-analyzer # or presidio-anonymizer, presidio-cli, ...
uv sync --locked --all-extras --group dev
uv run python -m spacy download en_core_web_lg # analyzer/CLI only
uv run pytest -xvv
uv run ruff check . && uv run ruff format .
- Python
>=3.10,<3.15; code must run on every version in range. - Dependencies are managed with uv, not pip/Poetry. If you touch a
package's
pyproject.tomldependencies, runuv lockin that package and commit the updateduv.lockin the same change — CI fails on drift. - Do not edit
CHANGELOG.md; release entries are generated from merged PRs. - Never log PII values (
entity.text) — only entity types and positions. - Modules that process records are stateless; do not add state.
- Terminology: "threshold", not "cutoff"; ISO 639-1 language codes everywhere.
Adding a PII recognizer
The full rulebook — score bands, context-word rules, validation-hook
semantics, the configuration-path test template, and the test-quality bar —
is .github/instructions/recognizers.instructions.md. Read it before
starting; those rules apply at authoring time, not just in review. The
workflow, in order:
- Place and name it under
predefined_recognizers/: full lowercase country name for new country directories (south_africa, notza; don't imitate the pre-existing short formsus/uk/thai), orgeneric/,nlp_engine_recognizers/,ner/,third_party/as appropriate. - Use ISO 639-1 language codes (
kofor Korean, neverkr) — a mismatch loads nothing, silently. - Make the constructor loader-compatible: accept the YAML loader's
kwargs (
name,supported_entity,context, ...) and forward them to the base class, or the recognizer crashes the whole registry the moment a user enables it. - Design the pattern for accuracy first — this is the top review priority: as specific as the format allows, score calibrated to the pattern alone, unambiguous context words, the correct checksum if one exists (and none invented if it doesn't), and the pattern's source documented in the docstring, preferably an official specification.
- Register it everywhere: exports in
predefined_recognizers/__init__.pyand the country/category__init__.py; an entry inconf/default_recognizers.yaml(country-specific shipsenabled: false); a row indocs/supported_entities.md. - Write the configuration-path test — the most-missed step and the one
that matters most: enable the recognizer in a YAML config, load it through
RecognizerRegistryProvider, and assert detection (template in the instructions file). Non-English recognizers must set the top-levelsupported_languagesin the test config — it defaults to["en"]and silently filters everything else.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 117 lines · 1,478 tokens per session scan A 8023c1fec5f7
presidio AGENTS.md is an instructions file published in the GitHub repository data-privacy-stack/presidio (10,706 stars, last pushed yesterday), licensed MIT. It adds 1,478 tokens to every session, about $0.0074 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
piighost CLAUDE.md
Instructions for Athroniaeth/piighost, covering claude.md, project overview, development commands, architecture and anonymization pipeline.
privacy-kit-cl AGENTS.md
Instructions for Yugoxc/privacy-kit-cl, covering agents.md — guía de integración para una ia, objetivo, paso 0 — detectar el terreno, paso 1 — instalar y configurar and paso 2 — implementar el store.
rizzo-pii CLAUDE.md
Instructions for Rizzo-AI-Academy/rizzo-pii, covering claude.md, cos'è questo progetto, ambiente — vincoli critici e non ovvi, mappa della repo and tassonomia: 22 tag (dettaglio in tassonomiatag.md).
pii-guard AGENTS.md
Instructions for danyuchn/pii-guard, covering agents.md, project overview, tech stack, architecture and commands.
datamimic AGENTS.md
Instructions for rapiddweller/datamimic, covering agents.md, when should an agent reach for datamimic?, tool selection, benchmarking local ollama models and authoring a new model.
docs_masked AGENTS.md
Instructions for kpshinnik/docs_masked, covering agents.md — правила работы в этом репозитории, инварианты, которые нельзя ломать, разработка, как добавить детектор and как добавить формат.