Evolvable, recoverable,
governed agents.

Agent loop in RustScript. Authority in Rust.

Lifecycle of a tool call

e.g. write_file
  1. 01Typed
    call
  2. 02Host
    grant
  3. 03Private
    write
  4. 04Durable
    receipt
  5. 05Publish /
    restore
Scroll down
01 / Motivation

Sandboxes limit where code runs.
They don't record what a call changed.

Tracking and undoing a call is a separate job.

Infrastructure sandbox

Where can code run?

bubblewrap, gVisor, Firecracker microVMs.

  • OS policy (Claude Code)
  • User-space kernel (GKE Agent Sandbox)
  • MicroVM (E2B, Vercel Sandbox)
RustScript Agent

What did this call change?

Each call gets an ID, a receipt and a version.

  • Run and attempt IDs
  • Compare-and-swap on the workspace head
  • Tool graph pinned per run
02 / Design

Policy lives in RustScript.
Authority stays in Rust.

The runtime is built from three parts.

type · resource · host ABI

Tool calls are typed before they run.

Compiler checks host ABI types and resources.

Script
agent loop and routing
Host
files, processes, network
contract → grant → token → receipt

Writes go to a private copy first.

Commit with a receipt, or keep the conflict.

Workspace
private managed view
Decision
receipt + readback
candidate → validate → activate

Upgrade tools while runs are in flight.

Running sessions keep their version.

Live run
pinned graph
Rollback
new generation
Typed ContractsEffect SandboxTool Graph
03 / Effect Sandbox

Follow one file write
from tool call to receipt.

Tool callwrite_file("race.txt", "first")
  1. 01
    Write to a private view

    Readers still see H0 while the tool writes.

    candidate: race.txt = first
  2. 02
    Prepare

    Stop the writer; save tree H1 and the result.

    prepare(H1, result)
  3. 03
    Commit

    One transaction: receipt, head, result, event.

    expected H0 → Head H1
  4. 04
    Read back

    Read the receipt back before replying.

    receipt fx_7a29
  5. 05
    Conflict or restore

    Losers stay readable; restore starts a new run.

    conflict / new run

Lost the reply? Look it up by attempt ID.

  • 01
    Journal

    Links run, call, attempt and events.

  • 02
    Receipt

    Records the candidate, head and tool result.

  • 03
    CAS conflict

    Two runs, one head: one commits, one conflicts.

run_01HR9F
run.startedstatus: running
tool.requestedwrite_file requested
tool.startedprivate view active
tool.outputstatus: committed
tool.completedfx_7a29
replay position
03 / 05
Commit replay 3 of 5: private managed view active.
04 / Tool Graph

Upgrade the tool graph.
Running sessions aren't affected.

New runs pick up the active graph at admission.

Start AGraph Ageneration g
UpgradeGraph Bgeneration g + 1
RollbackGraph Ageneration g + 2 · new activation generation
Capture timeline
01Start A
02Upgrade Graph B
03Start B
04Rollback Graph A
Active generationfuture captures
Graph Ag
Graph Bg + 1
Graph Bg + 1
Graph Ag + 2 · new activation generation
Session ARun α
Run α captures AGraph A · pinned
Run α pinned to Aexisting pin unchanged
Run α pinned to Aexisting pin unchanged
Run α pinned to Aexisting pin unchanged
Session BRun β / Run β′
—not started
—awaiting run
Run β captures BGraph B · pinned
Run β pinned to Bexisting pin unchangedRun β′ captures Anew run · Graph A / g + 2

Upgrade selected. Active Graph B at generation g + 1. Session A Run α remains pinned to Graph A. Session B Run β captures Graph B.

05 / Known limits (pre-v1)

What doesn't work yet.
Full list in docs/status.md.

01

Gateway source pinning

Not persisted across restarts yet.

02

Restart repair

Repaired on restart; terminal retries stop.

03

External effects

Each adapter needs its own recovery contract.

Open source, pre-v1.
Try it with cargo run.

Start with the README and the architecture doc.