SuperAPI AI Directory

bernstein

Bernstein is an open-source governance layer for AI agents that operates on a "policy as code" approach. You write rules declaratively—who can do what, which operations require approval, what content must be documented—and Bernstein enforces them and generates verifiable records. Its scheduler is implemented entirely in pure Python, with no large language model introduced into the coordination loop, so it can run agents in parallel while gating their outputs and logging every step, making the entire run verifiable offline after the fact from artifacts alone. CLI coding agents work out of the box (over 50 supported, including Claude Code, Codex, Gemini CLI, and more), and the same layer can also govern arbitrary agent workloads, with deliverables that can be code diffs, research reports, datasets, or audit evidence packages. It offers an air-gapped installation configuration, is licensed under Apache-2.0, and is free. It is currently in beta, maintained by an individual and under active development.

Open website

About this tool

Bernstein is an open-source governance layer for AI agents, with "policy as code" as its core idea. You write policies declaratively, specifying who can do what, which operations require approval, and what content must be recorded, and Bernstein is responsible for enforcing them and generating verifiable records.

Purpose It addresses the governability and reproducibility problems that arise when multiple agents work in parallel. The author mentions having spent $400 a month on Claude bills running three coding agents in parallel, only to get nondeterministic merge results, which is why the project was built. Bernstein is named after the American conductor Leonard Bernstein, intending to orchestrate a group of CLI coding agents the way one conducts the New York Philharmonic: each member acts on cues, the score (the schedule) is deterministic, and the conductor is responsible for the result.

Key capabilities

  1. No LLM in the coordination loop: scheduling is implemented in pure Python, so runs are reproducible end to end, and replaying yesterday's plan yields yesterday's task graph.
  2. Verifiable after the fact: replay logs record every run, an always-on lineage spine records every step with its lineage; an optional HMAC-chained audit log (BERNSTEIN_AUDIT=1) generates receipts that can be verified offline. Nondeterminism shows up as hash mismatches at the exact step, rather than as flaky reruns. This also applies to non-code deliverables: tasks can declare artifact contracts (reports, datasets, action logs, operational results) and are completed with signed lineage receipts rather than git commits.
  3. Isolated by construction: each coding task has its own git worktree, behind a merge gate; artifact-mode tasks get a working directory under .sdd/workspaces/. By default agents do not share a mutable workspace, and the only shared state is the atomically claimed task backlog.
  4. Broad and local: over 50 optional CLI agent adapters, plus a generic --prompt wrapper, file-based state, no SaaS detours, no third-party data plane.

How to use it 30-second installation, with support for pipx, pip, brew, dnf, npm, and Docker, and a separate wheelhouse guide for air-gapped scenarios. A run is declared by a single YAML file: stages, roles, dependencies, and the conditions under which nodes run. The scheduler executes it in pure Python—nothing in the file is a prompt, and no model decides what happens nextWhat. Nodes are claimed by role agents permitted by a given stage; role fences and approval gates are unaffected by an agent's behavior within a task. Each goal goes through four stages: Decompose (the manager breaks the goal into tasks, one LLM call), Spawn (agents start in isolated git worktrees), Verify (the janitor checks concrete signals such as tests, file existence, lint, types), Merge (verified work is merged into main; failed tasks are retried or routed to other models).

Common commands include bernstein workflow to run declarative YAML DAGs (containing agent, command, and loop nodes, with resume-after-interruption support and state checkpoints written to .sdd/runs/<run_id>/), bernstein audit verify to verify the audit chain, and bernstein bench run <suite> --reliability k to run each task k times under fixed coordination and report a pass^k lower bound (alongside the pass@1 upper bound, with results sealed in a signed receipt that can be recomputed offline). The repository hygiene gate bernstein readme-l10n verify fails a PR when a translated README drifts from the English source.

Applicable scenarios Can be used for graphs that deliver code, research, operational changes, or a mix of the three. Ready-made graphs for software, research, documentation, enterprise, and contributor workflows are located in .bernstein/scenarios/. Volunteer compute is also supported: projects can mark issues as open to volunteers, and anyone can run them on their own machine without an account or a coordinator; constraints such as sandbox backends, network allowlists, wall-clock and memory limits can only be narrowed by donors, not relaxed.

Supported agents Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, Cursor, Aider, Goose, Muse Code, OpenAI Agents SDK, Amp, Cody, Continue, Devin Terminal, Junie, Kilo, Kiro, AWS Q Developer, Ollama, OpenCode, OpenHands, Open Interpreter, gptme, Plandex, AIChat, Letta Code, Qwen, etc. bernstein integrations list enumerates all 56 connected integrations in registry.py, of which 54 are optional agent adapters and the other two lines are the mock test stub and self-hosted endpoint configuration. Any tool with a --prompt flag can be used through a generic wrapper.

Limitations Current status is beta, maintained by an individual and under active development. The version number counts releases, not maturity—minor versions may change interfaces, so pin the version when depending on it. The volunteer one-click runner has not been released yet; the currently available subcommands are verify, browse, budget, verify-bundle, and hub. For specific boundary protections and limitations, an official threat model document is provided.

License and contact Licensed under Apache-2.0, free of charge. Trademark issues for the project name are listed separately in TRADEMARKS.md. See CONTRIBUTING.md for contributions, and report security issues via SECURITY.md. Contact: forte@bernstein.run.