Provena
Enables tracking and querying the provenance of AI-generated code, showing which sources influenced each line of code.
README
Provena
Track where every line of AI-generated code came from.
When Claude (or any agent) writes code, Provena records what it saw (files read, pages fetched, your instructions) and what it produced, then lets you ask:
provena_why src/auth.ts:42
→ ← docs/oauth-spec.md [file] via declared (conf 1.00)
evidence: "access tokens expire after 15 minutes"
Lines with no backing source are flagged ungrounded — model knowledge to verify by hand. That honesty is the point.
📄 Paper: PAPER.md — Hook-Mediated, Span-Level Provenance for Code Written by LLM Agents. Method, benchmarks, and results (0% false attribution across all configs; held-out F1 90.9–94.7%, ceiling 95.7–100%).
How it works
Claude Code session
Read / WebFetch / Grep ─┐ PostToolUse hook
your prompts ───────────┤ → captured as `source`
Write / Edit ───────────┘ → captured as `artifact`
↓
.provena/provenance.db (SQLite)
↑
provena_* MCP tools (query · cite · audit)
Capture needs no cooperation from the model — hooks sit in the tool path.
Storage is local SQLite (Node's built-in node:sqlite), so nothing leaves your machine.
Requirements
- Node ≥ 23.6 (runs TypeScript directly; uses built-in
node:sqlite)
Setup
npm install # installs @modelcontextprotocol/sdk + zod
node src/cli.ts init # wires hooks into .claude/settings.json + registers MCP in .mcp.json
Then restart Claude Code in this project so it loads the hooks and the provena MCP server.
CLI
| command | what it does |
|---|---|
provena init |
configure Claude Code hooks + register the MCP server |
provena status |
counts of captured sources / artifact versions / links |
provena sources |
list captured sources |
provena audit <file> |
attribute a generated file and print its coverage report |
provena gate <file...> [--max-ungrounded <pct>] |
CI gate: exit non-zero if a file's ungrounded ratio exceeds the budget |
provena export <file> [--out f] |
write a signed (ed25519) provenance attestation |
provena verify <attestation> |
verify a signed attestation is authentic and unaltered |
provena reset |
wipe the local provenance graph |
MCP tools
| tool | purpose |
|---|---|
provena_status |
how much provenance has been captured |
provena_sources |
list sources the model saw |
provena_cite |
declare that a line range derives from a source |
provena_why |
explain where a given line came from |
LLM judge (optional)
Embedding attribution decides the confident cases on its own. For the borderline band, an LLM judge reads the candidate sources and decides derivation. Set one key:
export GEMINI_API_KEY=... # uses gemini-2.0-flash
# or
export ANTHROPIC_API_KEY=... # uses claude-haiku-4-5
# optional overrides:
export PROVENA_JUDGE_MODEL=... # pick a specific model
export PROVENA_JUDGE_PROVIDER=gemini # force a provider if both keys are set
Without a key, borderline spans are honestly reported as uncertain rather than guessed.
Status
- Phase 0 ✅ attribution-accuracy spike (
spike/) — 100% top-1 retrieval, ungrounded cleanly separated - Phase 1 ✅ capture + store + MCP query
- Phase 2 ✅ embedding attribution engine + LLM judge + audit report + eval harness. Embedding-only F1 94.7%, 0% false-attribution.
- Phase 3 ✅ live judge (gemini-2.5-flash-lite) reaches F1 100% on Benchmark A;
multi-language held-out Benchmark B (TS/Python/Go): embedding-only test F1 90.9%,
0% false-attribution, oracle ceiling 95.7%, live 90.9% (
eval/RESULTS.mditer 3–4). CI gate (provena gate) shipped. Paper in PAPER.md. - Next ⬜ larger naturally-occurring corpus, judge-model sweep, signed regulatory export.
Try the evaluation
node src/eval.ts # labeled benchmark: precision / recall / F1 / false-attribution
node test-judge.ts # judge wiring unit test (mocked transport)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。