Provena

Provena

Enables tracking and querying the provenance of AI-generated code, showing which sources influenced each line of code.

Category
Visit Server

README

Provena

CI License: MIT

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.md iter 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)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured