Borrowing it
Nothing to install: this file belongs to danyuchn/pii-guard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/danyuchn/pii-guard/main/AGENTS.mdgit clone --depth 1 https://github.com/danyuchn/pii-guardWrote 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.
[](https://agentmods.dev/instructions/danyuchn/pii-guard/agents-md)<a href="https://agentmods.dev/instructions/danyuchn/pii-guard/agents-md"><img src="https://agentmods.dev/badge/instructions/danyuchn/pii-guard/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.
<a href="https://agentmods.dev/instructions/danyuchn/pii-guard/agents-md"><img src="https://agentmods.dev/badge/instructions/danyuchn/pii-guard/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01726 | $0.01726 |
| Opus 5.5 | $0.00690 | $0.00690 |
| Sonnet 5.5 | $0.00345 | $0.00345 |
| Haiku 4.5 | $0.00173 | $0.00173 |
Grade A, and why
pii-guard 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 — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
This file provides guidance to coding agents (Claude Code, Codex, and others) working in this repository. CLAUDE.md is a symlink to this file.
Project Overview
pii-guard-tw — 繁體中文(台灣)個人資料去識別化工具。將文件中的 PII 替換為佔位符後送 AI 處理,完成後自動還原,確保真實資料全程不離開本機。
Tech Stack
- Language: Python 3.11+
- Package manager:
uv(必用uv run/uvx,禁用 pip) - PII framework: Microsoft Presidio(偵測 + 匿名化 + 還原)
- Chinese NER:
ckiplab/bert-base-chinese-ner(中研院,繁體中文) - Taiwan PII Regex: 自建
PatternRecognizer(身分證、手機、市話、統一編號) - Pipeline: LangChain
PresidioReversibleAnonymizer(mapping table 序列化/還原)
Architecture
原始文件
↓ [偵測層] CKIP NER + 台灣 Regex PatternRecognizer
↓ [替換層] 建立 mapping table → 去識別化文本
↓ [LLM 處理] AI 只看到佔位符版本
↓ [還原層] reverse replace → 還原後 AI 回答
關鍵原則:LLM 只做輔助偵測,替換與還原全由程式碼完成,decode 可靠性 100%。
Commands
# 安裝依賴
uv sync
# 執行主程式(CLI)
uv run python -m pii_guard <input_file>
# 執行測試
uv run pytest
# 執行單一測試
uv run pytest tests/test_recognizers.py::test_tw_id_number -v
# 型別檢查
uv run mypy src/
# Lint
uv run ruff check src/
# 常駐 hook 去識別化服務(install 會併好 settings 並自動啟動)
uv run pii-guard-hookd install [--engine full|regex] [--scope user|project] [--no-launchd] [--harden] [--mod]
uv run pii-guard-hookd doctor [--harden] [--mod] | uninstall
uv run pii-guard-hookd serve [--engine full|regex] [--foreground] [--session-ttl-days N]
uv run pii-guard-hookd status | stop | purge [session_id|--all]
# 參考名單:把客戶名單(xlsx/csv)的欄位對應存成描述檔,值留在原檔
uv run pii-guard-hookd terms inspect <表格> [--sheet 名稱] [--json]
uv run pii-guard-hookd terms import <表格> [--map 姓名=PERSON,金額=SKIP] [--yes] [--materialize]
uv run pii-guard-hookd terms status | remove <表格>|--all | ui
PII Types Supported
| 類型 | 方式 |
|---|---|
| 人名、組織、地名 | CKIP NER |
| 身分證字號 | Regex |
| 外籍居留證 | Regex |
| 手機號碼(本地) | Regex |
| 手機號碼(+886) | Regex |
| 市話 | Regex |
| 統一編號 | Regex + context |
| Email、信用卡 | Presidio 內建(zh 覆寫) |
| 車牌 | Regex + context |
| 出生日期 | Regex + context |
| 銀行帳號 | Regex + context |
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 Changed · -15 tokens per session 9bc14ece610e
- 5d ago Changed · -8 lines · -413 tokens per session dbce138735c9
- 1mo ago Changed · +6 lines · +409 tokens per session 3dfdb608e102
- 1mo ago Changed · +8 lines · +332 tokens per session 2b8b9e88e4c2
- 1mo ago Changed · +91 tokens per session 83c724cdb9fc
- 1mo ago First seen · 84 lines · 1,322 tokens per session scan A ad5ce5c898a2
pii-guard AGENTS.md is an instructions file published in the GitHub repository danyuchn/pii-guard (252 stars, last pushed 2d ago), licensed MIT. It adds 1,726 tokens to every session, about $0.0069 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-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.