Bend – a language that blocks AI mistakes via proof and runs on GPUs
TL;DR Highlight
Declare laws in LAWS.bend and AI-written code that breaks them gets blocked at proof time.
Who Should Read
A backend developer unsure whether they can trust coding-agent output without reading the code
Core Mechanics
- Breaking a law blocks the merge
- You declare rules that must never break in LAWS.bend.
- The AI must write a proof in PROOF.bend that each law holds, otherwise the code is blocked.
- The site calls this AGENTS.md backed by proof.
- The demo guards a board game
- The law says no sequence of moves can win.
- Asked to make the board wrap around, the AI merged a bug without LAWS.bend.
- With LAWS.bend, it retried until it built a wall and proved the law holds.
- The type checker is a proof checker
- Like Lean and Rocq, but taking a second at most on a mid-sized codebase.
- The article says Lean-style tools can take minutes at that size.
- So an agent can check after every change.
- Speed comes from native code and GPUs
- On one core it runs nearly as fast as C.
- The same binary runs up to 100x faster than one core on 16 cores or a GPU.
Community Reactions
- Thin proof library means upfront cost
- One user ported a calendar cron job and it mostly worked.
- Claude reportedly complained that Base ships only one arithmetic law, so about 60 of 163 PROOF.bend lines were basic facts.
- The overlap-free law they wanted was skipped because it needs a sort-correctness proof first.
- Agents rewrite the law itself
- One commenter said agents modify the law to fit the new feature.
- They argue some laws must be frozen, so humans still make the judgment.
- They also reported success adding proof-like checks to CI whenever agents misbehave.
- The demo burned tokens
- One user reported over 100k tokens in a laws broken loop for a simple feature.
- After 500k tokens their API key was rate limited and the loop broke.
- Asking to flip the board produced a symmetric board with two finish flags, a patchwork fix.
- Proof target can still be wrong
- Commenters said translating requirements into proof targets still involves code and bugs.
How to Apply
- Try the four AGENTS.md lines today
- Install Bend with install.sh in a small side project.
- Paste the four lines from the article into AGENTS.md and say use Bend.
- Have the agent write just one must-never-break rule in LAWS.bend.
- Write your invariant as one sentence first
- Require human approval for law changes
- Review every agent diff that edits a law.
- Keep a frozen list of core rules.
- Run bend PROOF.bend in CI so failures block the commit.
- Cap retry tokens in agent loops
- Set a max retry count and token budget on the agent loop.
- When the cap is hit, stop and ask a human whether to relax the rule.
- Use the reported laws-broken token burn as a reason to set the limit.
Try It
# Run in Claude Code at a project root (install first: curl -fsSL https://bend-lang.com/install.sh | sh)
Add the following to AGENTS.md:
When using Bend:
- run `bend guide` to learn it
- use `LAWS.bend` to keep important rules
- run `bend PROOF.bend` before committing
- parallelize the code whenever possible
Then use Bend. The rule that must never break in this project is {{one-sentence invariant}}. Write it as a law in LAWS.bend, prove it in PROOF.bend, and tell me whether bend PROOF.bend passes.
Next: add {{new feature}} and watch whether the agent edits the law or the code when the law breaks.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.