presidio-research: Instructions file for Codex

AGENTS.md

presidio-research AGENTS.md is an instructions file for Codex, OpenCode from data-privacy-stack/presidio-research. It costs 776 tokens per session, scanned A, original, MIT.

A set of coding-agent instructions for Presidio Research, a Python project for matching and resolving entity labels in data. It documents the project's setup, CanonicalMapper behavior, issue types, and result structures.

In plain words
What is it for?
Use it when changing Presidio Research, especially for entity mapping, issue handling, Python checks, tests, and the CanonicalMapper's analysis and result methods.
Why use it?
It gives agents the project's exact conventions so they use the right commands, APIs, and interpretations of mapping results.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is data-privacy-stack/presidio-research's own configuration. It tells Codex and OpenCode how to work on presidio-research itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything presidio-research configures →

Reuse

Borrowing it

Nothing to install: this file belongs to data-privacy-stack/presidio-research. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/data-privacy-stack/presidio-research/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/data-privacy-stack/presidio-research

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for presidio-research AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/data-privacy-stack/presidio-research/agents-md/github.svg)](https://agentmods.dev/instructions/data-privacy-stack/presidio-research/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/data-privacy-stack/presidio-research/agents-md"><img src="https://agentmods.dev/badge/instructions/data-privacy-stack/presidio-research/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for presidio-research AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/data-privacy-stack/presidio-research/agents-md"><img src="https://agentmods.dev/badge/instructions/data-privacy-stack/presidio-research/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 776 This file is loaded in full into every session.
When invoked 776 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00776 $0.00776
Opus 5.5 $0.00310 $0.00310
Sonnet 5.5 $0.00155 $0.00155
Haiku 4.5 $0.00078 $0.00078

Measured 1mo ago against content hash d5c4b319d3e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

presidio-research 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 1mo ago.

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.

AGENTS.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — Codebase Patterns

Project Setup

  • Python managed with uv — always use uv run for Python, never bare python or pip
  • Virtualenv at .venv/
  • Quality checks: uv run ruff check --fix, uv run ruff format, uv run pytest
  • Fast entity-mapping tests: pytest tests/entity_mapping/

CanonicalMapper

  • Single-phase (Identify-only) — no projection phase
  • analyze(results_df, min_severity='WARNING') — informational COLLISION_SAME_BRANCH issues are hidden unless min_severity='INFO'; mixed gold depths are ERROR
  • get_mapped_results_dataframe() returns MappedResults (frozen dataclass with .original, .binary, .branch, .detailed)
  • get_mapping() returns {label: resolved} dict — UNRESOLVED labels excluded
  • get_issues() filters by _min_severity — call after analyze() or map()

Five Issue Types (IssueType enum)

  • UNRESOLVED (ERROR, blocking)
  • COLLISION_CROSS_BRANCH (WARNING, blocking) — only raised when cross-branch co-occurrences outnumber same-branch ones for the prediction label
  • PREDICTION_ONLY (WARNING, blocking)
  • DATASET_ONLY (WARNING, non-blocking)
  • COLLISION_SAME_BRANCH (INFO when projection is unambiguous; ERROR when gold mixes depths on one branch)

_Resolution dataclass fields

  • tier — identification tier (EXACT, COUNTRY, COUNTRY_FALLBACK, FUZZY, UNRESOLVED)
  • resolved — resolved canonical entity name (or None for UNRESOLVED)
  • score — fuzzy match score (0.0–1.0, None for non-FUZZY tiers)
  • NO canonical, projected, or projection_type fields

IssueSeverity enum

  • Values are lowercase: 'error', 'warning', 'info'
  • Use .lower() when converting from string; do NOT use .upper()

Hierarchical Evaluation

  • calculate_hierarchical_scores(mapped_results: MappedResults) returns {"binary", "branch", "detailed"}
  • NOT {"L0", "L1", "L2"} — use the string level names
  • MappedResults is in presidio_evaluator/entity_mapping/data_objects.py

level_helpers

  • to_binary(label) and to_branch(label) are now instance methods on EntityHierarchy (moved from the deleted level_helpers.py)
  • Call via hierarchy_instance.to_binary(label) / hierarchy_instance.to_branch(label)
  • EntityHierarchy has no imports from mapper.py — no circular deps
  • For branch lookups use EntityHierarchy(canonical_depth=10)

Read the full file on GitHub · 54 lines

Changes

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.

  1. 1mo ago Changed · +17 tokens per session d5c4b319d3e9
  2. 2mo ago First seen · 54 lines · 759 tokens per session scan A 57eb7d5febc8

Subscribe to this mod's changes

presidio-research AGENTS.md is an instructions file published in the GitHub repository data-privacy-stack/presidio-research (320 stars, last pushed 18d ago), licensed MIT. It adds 776 tokens to every session, about $0.0031 per session on Opus 5.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-09-01.

Related

presidio-research AGENTS.md compared with instructions from other repositories

presidio-research AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
presidio-research AGENTS.mddata-privacy-stack/presidio-researchInstructions file32018d agoMITA776Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode