presidio-research AGENTS.md

presidio-research AGENTS.md is an instructions file for Codex, OpenCode from data-privacy-stack/presidio-research. It costs 759 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

Install

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.

agentmods
npx agentmods add instructions/data-privacy-stack/presidio-research/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 759 This file is loaded in full into every session.
When invoked 759 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00759 $0.00759
Opus 5 $0.00380 $0.00380
Sonnet 5 $0.00152 $0.00152
Haiku 4.5 $0.00076 $0.00076

Measured 2d ago against content hash 57eb7d5febc8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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') — COLLISION_SAME_BRANCH (INFO) hidden unless min_severity='INFO'
  • 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, non-blocking)

_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. 2d 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 (304 stars, last pushed 3d ago), licensed MIT. It adds 759 tokens to every session, about $0.0038 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-09-01.