Brain0-ai/brain0
The black box for AI-written code. Passive decision graph linking every commit to the agent prompts behind it: drift detection, DLP audit of what agents read, evidence-driven risk, MCP memory for coding agents, signed provenance attestations. One command, offline by default.
What it solves
Coding agents now write most of the diff, but git only shows what changed, not why. brain0 answers the questions your repo can't: which prompt wrote this bug, what the agent actually read, and how trustworthy that change is. It also reconciles what agents claim to have changed with what git records (drift), detects sensitive reads like .env or private keys, and assigns an evidence-driven risk score that learns from past incidents.
How it works
brain0 is a pure observer. It reads git history (the facts) and the transcripts coding agents (Codex, Claude Code) already write to disk (the declared intents). It builds a decision graph from repo down to module, file, and symbol — each node carrying dated history, drift, and risk. It never modifies your code or git history. Locally, it uses a SQLite index with embeddings; optionally you can plug in Postgres or your own LLM for richer summaries and chat. A GUI lets you explore the graph, and an MCP interface lets coding agents query context, blame, debug, and audit before touching code.
Who it’s for
Developers and teams who use AI coding agents and want accountability: understanding which prompt caused a change, ensuring agents didn't leak secrets, and spotting high-risk patterns. It's also valuable for security-conscious teams and anyone running local-first, offline tooling.
Highlights
- Passive observation: no hooks, no agent cooperation, no code changes — just reads git and transcripts.
- Drift detection: reconciles declared vs. done to flag unstaged or undeclared edits.
- DLP for agent context: records which files sessions read (paths and secret kinds only) and flags sensitive reads that reached a remote model.
- Risk score that learns: a-priori (blast radius, churn) fused with a-posteriori (reverts, fixes) evidence, surfacing 'gold signals' for dangerous patterns.
- Local-first and offline by default: no keys, local embeddings, zero egress; optional remote models are opt-in.
- MCP integration: gives coding agents a query channel for context, blame, debug, and audit before they make changes.
- Tamper-evident: append-only graph, pinned transcripts, crypto-shred purge, signed attestations.
- Open core: Apache-2.0, fully functional, with an enterprise option for Postgres and multi-tenancy.
Related
- Project
- Project
- Dispatch
- Project
- Project