Bernstein

Frameworks & SDKs 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
1.1k stars

Bernstein is an open-source governance layer for AI agents that enforces policy as code, providing a deterministic scheduler, isolated execution, and verifiable audit trails. It solves the problem of uncontrolled and unverifiable AI agent actions by gating outputs and recording every step for offline verification. It is for developers and teams running CLI coding agents or other agent workloads that need governance, reproducibility, and auditability.

Bernstein demo
🎞️ Demo from the project README

✨ Key features

  • No LLM in coordination loop; deterministic Python scheduler
  • Replay journal and lineage spine for offline verification
  • HMAC-chained audit log with signed receipts (opt-in)
  • Isolated git worktrees per coding task; merge gates
  • Supports 40+ CLI agents and generic --prompt wrapper
  • Air-gap install profile; Apache-2.0 license

🎯 Use cases

  • Govern and audit code changes made by AI coding agents
  • Run reproducible multi-agent workflows with policy enforcement
  • Generate audit evidence packs for compliance
  • Evaluate agent reliability with pass^k floors
  • Coordinate research, data, or ops tasks with artifact contracts

📦 Installation

🧰 Requirements: Requires Python and a CLI agent (e.g., Claude Code, Codex, Gemini CLI) installed and authenticated; optional BERNSTEIN_AUDIT=1 for audit log.

uv tool install bernstein    # or: pipx install bernstein
bernstein init
bernstein doctor             # checks a CLI agent is installed and authenticated
bernstein -g "fix the failing test in tests/test_foo.py"

🚀 Usage

BERNSTEIN_AUDIT=1 bernstein -g "fix the failing test in tests/test_foo.py"
bernstein replay list                 # run ids recorded on disk
bernstein replay latest --verify      # recompute the journal head, name the first divergent step
bernstein lineage verify <run_id>     # recompute the always-on lineage spine
bernstein audit verify                # HMAC chain + Merkle seal (written because audit was enabled)
bernstein audit diagnose <run_id> --signal gate --sign-key KEY
name the exact step a failure entered the run, as a signed receipt
bernstein verify run <run_id> --signing-key-path key.pem   # sign one portable run receipt
bernstein verify receipt .sdd/runs/<run_id>/run-receipt.json  # verify it offline: file only

⚠️ Good to know

Project is in beta, solo-maintained, and under active development; minor versions may change interfaces, so pin the version for anything you depend on.

❓ FAQ

How does Bernstein ensure deterministic runs?

The scheduler is plain Python with no LLM in the coordination loop, so the same plan produces the same task graph every time.

Can I verify a run after it completes?

Yes, using the replay journal, lineage spine, and optional HMAC-chained audit log; you can verify offline with signed receipts.

Which agents are supported?

Over 40 CLI coding agents work out of the box, including Claude Code, Codex, and Gemini CLI, plus a generic --prompt wrapper.

Is there an air-gap installation option?

Yes, an air-gap install profile is included, with a dedicated guide for setting up an air-gapped wheelhouse.

📊 Repository

Stars★ 1,107
Forks🍴 152
Open issues🐛 347
Last commit🕒 Sep 4, 2026
Created📅 Mar 2026
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.