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/nine710/mcp-redact/claude-mdgit clone --depth 1 https://github.com/nine710/mcp-redactWrote 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/nine710/mcp-redact/claude-md)<a href="https://agentmods.dev/instructions/nine710/mcp-redact/claude-md"><img src="https://agentmods.dev/badge/instructions/nine710/mcp-redact/claude-md.svg" alt="Measured on agentmods" 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 | $0.04112 | $0.04112 |
| Opus 5 | $0.02056 | $0.02056 |
| Sonnet 5 | $0.00822 | $0.00822 |
| Haiku 4.5 | $0.00411 | $0.00411 |
Grade A, and why
mcp-redact CLAUDE.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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 591 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
项目定位
这个仓库用于开发 mcp-redact:一个轻量、local-first 的 MCP Server 和 CLI 工具,用来在用户把日志、配置、报错、堆栈、终端输出或文件内容交给 AI 工具之前,先自动进行敏感信息脱敏。
项目的目标不是“做最强的安全平台”,而是做一个:
- 安装简单
- 本地可运行
- 输出可信
- 一眼能看懂价值
- 10 分钟内就能试起来的开源工具
项目的核心传播点应该始终围绕:
- “先脱敏,再喂给 AI”
- “兼容 Claude Code / Cursor / 其他 MCP 客户端”
- “本地运行,不把原始敏感内容先发出去”
产品边界
必须坚持的边界
- 第一版只解决“纯文本敏感信息脱敏”问题。
- 优先支持开发者最常复制给 AI 的内容:日志、
.env、JSON、YAML、HTTP 请求头、报错信息、终端输出。 - 优先支持高频、强感知、容易演示的敏感类型。
- 检测与替换必须是确定性的,不能依赖 LLM 推理。
- 默认行为必须偏保守:宁可少做炫技,也不要产生不可解释的输出。
当前阶段不应扩展的方向
以下内容默认不做,除非用户明确要求改变项目方向:
- 云服务、账号系统、远程配置中心
- 企业级审计、团队权限、策略编排
- OCR、图片脱敏、音视频脱敏
- 大规模目录递归扫描
- IDE 插件
- 基于 embedding、模型分类、远程 API 的检测
- “自动修复配置安全问题”这类超出脱敏范围的功能
核心价值判断
如果某个新功能不能明显增强以下任意一点,应优先不做:
- 更快接入 Claude Code / MCP 工作流
- 更高频地覆盖开发者真实复制场景
- 更低的误报和漏报
- 更清晰的输出与更强的可解释性
- 更低的上手门槛
MVP 目标
第一版的成功标准不是功能多,而是下面四点成立:
- 用户能在本地快速安装并运行。
- 用户能输入一段日志或一个
.env文件并立即看到效果。 - 输出足够稳定,能放心贴给 AI。
- README 中的演示和实际工具行为一致。
MVP 功能清单
1. 核心脱敏引擎
必须提供一个共享的文本脱敏引擎,供 CLI 和 MCP Server 复用。
必做检测类型
第一批内置检测器建议分组如下:
-
secrets- Bearer Token
- JWT
- GitHub Token
- OpenAI 风格 API Key
- Anthropic 风格 API Key
- AWS Access Key ID
- 常见
password=/token=/secret=/api_key=/apikey=键值形式 - 多行私钥块,例如
-----BEGIN PRIVATE KEY-----
-
personal- 邮箱地址
- 手机号
- IPv4 地址
-
httpAuthorizationHeaderCookieHeader- URL 中敏感 query 参数,例如
token=,key=,secret=,password=
替换要求
- 每一类敏感内容应替换为稳定且可理解的占位符。
- 占位符示例:
[REDACTED_BEARER_TOKEN][REDACTED_GITHUB_TOKEN][REDACTED_EMAIL][REDACTED_IPV4]
- 不需要在 v1 中生成复杂的唯一 ID,但同一条规则应使用稳定的命名。
- 占位符必须便于用户一眼判断原来是什么类型。
输出要求
脱敏结果必须同时包含:
- 脱敏后的文本
- 命中摘要
- 每类规则命中了多少次
默认不输出:
- 原始命中值
- 原始局部片段的明文
- 可逆的映射关系
2. CLI
CLI 是最直接的演示入口,必须尽快完成。
CLI 必备能力
- 支持从 stdin 读取文本
- 支持输入单个文件路径
- 支持输出到 stdout
- 支持输出到目标文件
- 支持
text和json两种格式
建议命令形态
以下命令形态是推荐目标,实际实现时保持一致性即可:
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.
- 4d ago First seen · 591 lines · 4,112 tokens per session scan A 134c711214ff
mcp-redact CLAUDE.md is an instructions file published in the GitHub repository nine710/mcp-redact (0 stars, last pushed 4mo ago), licensed MIT. It adds 4,112 tokens to every session, about $0.0206 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
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).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
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.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.