Skip to content
@deftai/bode · v0.8.0Free for developers

Faster, cheaper, safer. Pick all three.

BODE (Bounded Optimal Durable Evaluator) is the plan-before-write runtime for coding agents. It replaces verbose shell loops with typed TypeScript cells, deterministic policy gates, and hash-chained SQLite receipts.

Install BODE in 60 seconds

Requires Node.js >= 22.18.0 · macOS, Linux, Windows

Paste the agent prompt directly into your coding agent, or run the CLI installer for your harness.

Agent prompttext
Install BODE (@deftai/bode) in this repo, follow its README setup,
then run my next task through it.

Interactive walkthrough: Plan-before-write in 60 seconds

Step through how a governed BODE cell catches prompt-injection exfiltration and records a hash-chained receipt.

  1. 1. Typed cell
  2. 2. Dry-run plan
  3. 3. Policy gate
  4. 4. Execute & receipt

Agent emits a compact TypeScript cell against typed tools.

4 ms compile
cell-04.ts · intent: "migrate auth helper & run tests"ts
const files = await fs.glob("src/auth/**/*.ts");for (const path of files) {  await fs.edit(path, {    oldText: "verifyLegacyToken(",    newText: "verifySessionToken(",  });}const result = await qa.run("vitest run src/auth");return { updated: files.length, passed: result.ok };
Bulk file contents stay out of model context

Variables live inside the QuickJS-NG / djs sandbox instead of echoing 12 files and verbose bash stdout back into the prompt.

Paired-trial results

Four claims. Every single one backed by raw data.

No synthetic cherry-picking — every metric links straight to its model-by-model data table and downloadable CSV.

ClaimMeasured ResultEvidence SummarySource
Lower cost on real repos−54.4%$1.38 → $0.63 on 5-turn real-repo session (−67.6% prompt tokens); −28.9% pooled across 32 hard XL tasks (28/32 wins, p = 0.0002).Track 5A & Track 2
Faster wall-clock completion−34.4%34.4% faster on adversarial tasks (39.2s → 25.7s), 28.1% faster on real repos, 18.8% faster on hard XL tasks (p = 0.0136).Latency breakdown
Zero security breaches11 → 0Safe task pass rate rose from 33% (6/18) to 100% (18/18) across 36 live adversarial trials and 3 frontier models.Track 3 Security Report
Fewer raw shell calls−96.2%131 raw shell calls reduced to 5 across 32 shell-heavy tasks and 4 models (p = 0.000015), replaced by 25 typed built-in tools.Track 4 Shell Suite
Architecture

Plan-before-write, not per-call regexes.

Most guardrails guess what a bash command might do right as it runs. BODE turns agent work into typed TypeScript cells, dry-runs the full write set, checks deterministic policy, and journals every receipt.

STAGE 01

Typed cells & persistent sandbox variables

Agents write small TypeScript cells against 25 built-in tools (fs.*, git.*, qa.*, proc.*, web.*, poll()) plus auto-generated .d.ts providers for OpenAPI, GraphQL, SQLite, gRPC, and MCP. Intermediate files stay in sandbox bindings instead of flooding prompts.
STAGE 02

Dry-run planning pass

Before any file is modified or any outbound request executes, BODE runs a dry-run pass to compute the exact write set — every path, diff, API call, and untrusted-data provenance mark as structured data.
STAGE 03

Deterministic capability & policy gates

Policy rules inspect the full plan as data rather than fragile shell strings. Protected files, destructive git pushes, and prompt-injection exfiltration are blocked before execution, with zero disk changes applied.
STAGE 04

Hash-chained SQLite receipts & crash durability

Every cell and approval is written to a Duran-compatible SQLite journal. Verified across 292 SIGKILL kill points: interrupted non-idempotent edits are flagged in_doubt without ever double-applying writes.
Zero lock-in

Works with the coding agents you already run.

One runtime across Claude Code, OpenAI Codex, Antigravity, Pi, and Grok Build — switch models or harnesses without changing governance.

Claude Code

Native plugin + SessionStart standing card + PreToolUse guard.

bode install claude --strict

OpenAI Codex

Registers [mcp_servers.bode], hooks, and skills/bode non-destructively.

bode install codex --strict

Antigravity

Native agy plugin with MCP roots/list workspace resolution.

bode install agy --strict

Pi

Single governed bode tool with /bode inline status & policy toggle.

pi install npm:@deftai/bode

Grok Build

Auto-detected via bode setup with full typed tool suite.

bode setup --yes
ROI

See what BODE saves your team.

Run your monthly agent spend against our published paired-trial savings.

BODE Savings Calculator

Backed by paired trials

Enter your monthly coding-agent API or seat-overage spend. Figures span the pooled hard-task result (28.9%) to the 5-turn real-repo result (54.4%).

$500/mo$25k/mo$50k/mo$100k+/mo
Benchmark profile

Source: 5-turn persistent real-repo session ($1.38 → $0.63, −67.6% prompt tokens)

Monthly savings$5,440
Range: $2,890 – $5,440/mo
Annual savings$65,280
Governance with a negative cost
Rate-limit & budget stretch2.19×
1.41× (Hard XL) to 2.19× (Real Repo)
White papers & raw data

Read the papers behind BODE.

Full methodology, model-by-model tables, statistical p-values, limitations, and downloadable CSVs.

Paired Trials + Savings Appendix

BODE: Governance With a Negative Cost

Tracks 2, 4, and 5A — 64 Hard XL trials, 236 shell-minimization trials, and 5-turn real-repo sessions.

Security & Durability

BODE Security & Durability Report

Track 3 live adversarial scenarios (11 breaches → 0) and 292-point SIGKILL crash-durability matrix.

Ready to drop BODE into your repo?

Install in 60 seconds for free, or schedule a technical walkthrough with our engineers.