brain0  by Brain0-ai

Track and audit AI-generated code with full provenance

Created 1 month ago
468 stars

Top 64.2% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

brain0 addresses the opacity of AI-generated code by providing a passive "black box" that links commits to agent prompts, data agents read, and evidence-driven risk assessments. It targets developers and researchers seeking to audit, understand, and trust AI-assisted development workflows, offering a decision graph for transparency and accountability.

How It Works

brain0 acts as a pure, non-modifying observer. It passively ingests git history and coding agent transcripts (e.g., Codex, Claude Code) to build a decision graph. Utilizing Rust for core observation and TypeScript for the GUI, it employs Tree-sitter for symbol identification and pluggable storage (SQLite/Postgres). Its novelty lies in vendor-neutral drift detection (declared vs. actual changes) and Data Loss Prevention (DLP) auditing of agent reads, operating offline-first.

Quick Start & Requirements

  • Primary Install/Run: npx brain0 up
  • Prerequisites: Node.js ≥ 20. git for commit history.
  • Optional Dependencies: Coding agent transcripts (auto-discovered), Ollama models (qwen3:4b, qwen3-embedding:0.6b) for enhanced AI features, or API keys for hosted LLMs.
  • Links: Docs (./docs), GUI (http://localhost:8787).

Highlighted Details

  • Drift Detection: Reconciles agent-declared changes against actual code modifications, scoring the discrepancy.
  • Sensitive Reads Audit (DLP): Records agent read paths and secret types, preventing sensitive data exposure.
  • Evidence-Driven Risk: Scores code artifacts using a-priori factors and a-posteriori signals (e.g., reverts).
  • Agent Memory (MCP): Exposes provenance, risk, and history via a query channel for agents, preventing regressions.
  • Offline-First: Deterministic operation with local embeddings/models by default, ensuring privacy and zero egress.

Maintenance & Community

Maintained by "The brain0 Authors" under Apache-2.0. Contributing guidelines are at ./CONTRIBUTING.md. Specific community channels or roadmap links are not detailed.

Licensing & Compatibility

Core repository is Apache-2.0, permitting commercial use. Advanced team/hosted capabilities are in a separate brain0-enterprise repository (AGPLv3 + commercial).

Limitations & Caveats

Full AI features require optional dependencies (Ollama, API keys). Effectiveness depends on agent transcript availability. Enterprise features are licensed separately.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.