Threads & standing grants.

Coordinate multiple humans, cloud agents, and local AI CLIs inside one durable session — bounded by explicit, audited standing grants on every physical or financial act.

No human in the loop — by design

CommandAGI is built for unattended execution as well as interactive collaboration. An agent holding a matching standing grant opens hardware channels, arms actuators, deploys sites, places shipments or market orders, executes Python jobs, and updates folders across threads, MCP, and the HTTP API without interactive popups on each step. Safety rests on three hard controls: the standing grant, the driver's protocol and motion bounds, and the append-only record.

Principals and credentials

Every acting party in CommandAGI is typed as one of four principal forms:

  • agent:<name> — an AI agent runtime or fork (agents/<folder>/agent.tsx)
  • person:<name> — a human operator (acct:user:<id> when signed in)
  • contract:<program-id> — a verified coordination contract seat
  • script:<path> — a scheduled or reactive .script.tsx in a Drive

No principal asserts its identity in plain text; every privileged request verifies a signed or hashed credential:

  • Host credential (cagp_…): Minted once via commandagi grant token --principal agent:<name> (or during grant add); only its SHA-256 digest is stored in ~/.commandagi/principals.json. Rotate with grant token; revoke with grant forget.
  • Account credential (cagc.<payload>.<signature>): Signed with an account's Ed25519 key (commandagi grant sign --key-file …, or issued by the cloud for relayed host_call invocations), binding principal, account, expiry, and optional target host id. Revoke with commandagi grant revoke-credential or grant rotate.

Standing grants

A standing grant is authority conferred on one principal by an explicit act of another principal with authority on the account. People carry no hidden privilege exception over agents: identical identity, scope, and rate validations apply to both.

CommandAGI validates seven kinds of standing grant uniformly across the workbench UI, local host (~/.commandagi/grants.json), and cloud (standing_grants in D1, via packages/domain/world/grants.js):

kindbounded scopecommandagi grant add flags
unitPhysical world address, optional units, channels, and verbs (open, arm, run, send)--world <world> [--unit U] [--channel C] [--verb V]
filesWrite access to relative path prefixes inside one folder address--folder <dir> --file <prefix>
codeHost Python execution inside a folder with allowlisted service secrets--folder <dir> --code python [--secret svc]
outreachSending outbound campaigns over named connected apps with daily cap--folder <dir> --outreach <app> [--per-day N]
marketVenue orders bounded by venues, symbols, --max-qty, --max-notional, --per-day--folder <dir> --market <venue> [--symbol S] [--max-qty N]
shippingBuying postage labels and scheduling pickups bounded by cost and daily count--folder <dir> --ship <carrier> [--max-cost N] [--currency USD]
moneyTransfers across named accounts, payment rails, counterparties, and tx/day/month cents capsWorkbench Settings -> Grants or account API
shell
# Hardware unit grant (expires in 8 hours)
commandagi grant add --principal agent:night-shift \
  --world worlds/shop/world.tsx --unit mill-1 --channel gcode \
  --verb open --verb arm --verb run --verb send --for 8h --note "night shift"

# Folder files + sandboxed Python execution with one secret
commandagi grant add --principal agent:analysis \
  --folder ~/work/cell --file outputs/ --code python --secret alpaca --for 24h

commandagi grant list
commandagi grant revoke g-3f9a1c20b7de

Grants apply to worlds, which name real machines. A design (a .3d.tsx) and a world's twin are simulated, and need none.

Verbs, arming and safing

A hardware unit grant grants any subset of four actuation verbs: open, arm, run, and send.

  • Actuating devices always open disarmed. Any principal holding arm can arm the unit; idle armed sessions disarm automatically after five minutes.
  • Non-mechanical host inputs (PTY shells, Python kernels, software relays) evaluate the grant directly on every call.
  • Safing is always allowed. stop, disarm, and close — plus equipment safing commands such as feed hold, emergency stop, torque off, and cancelling a resting market order — remain open to anyone holding an unexpired grant on the unit, the session opener, and the account owner. commandagi unit stop --world <world> --unit <uid> sends the safing command to every open channel and stops running agents on that unit.

The rules every action follows

  • Recorded before it is sent. Before any driver executes, an entry naming the principal and the command is appended to the run stream and flushed. A read-only Drive or folder refuses the action rather than acting off the record.
  • An acknowledgement is not a state. Returning ok or HTTP 200 never implies the commanded physical state was reached; state stays pending until the device reports back.
  • Unknown stays unknown. Dropped sockets record state: unknown, and streams ending without an explicit close banner render as interrupted: state unknown.
  • No silent retries. The platform never silently retries physical commands, transfers, shipments, or market orders.
  • Bounds live in the driver. Soft limits, workspace bounds, intervals, and rate pacing (at least 30 ms between discrete inputs) are enforced below the agent inside the driver.
  • Simulated and physical never mix. A run's reality (simulation or physical) is immutable, and simulated runs never count as physical commissioning evidence.

Threads, approval barriers, and local CLI supervision

A thread (POST /threads) backs a multi-participant session in runs/<run>/, joining humans, cloud/BYOK models, and local AI CLIs in members.jsonl with task mounts (mounts.tsx).

  • Approval barriers & proposals: Where an agent lacks write authority on guarded files — or reaches an explicit <approval> step in a .flow.tsx workflow — it submits a semantic diff proposal (propose / propose_change, or commandagi task propose) or pauses with ask_question. Only an operator at their own terminal or session approves (commandagi task approve).
  • Automated trace judge: Run commandagi judge <run-folder> [--follow] to continuously inspect thread streams in bounded windows and emit cited defect records to the judge stream.
  • Supervising local AI CLIs: Seat Claude Code, Codex, Gemini CLI, Cursor Agent, or Qwen Code directly into any CommandAGI world or folder thread, tracking subscription usage against configured agents.usagePolicy caps:
shell
commandagi agents list                          # detect installed CLIs
commandagi agents signin claude-work --cli claude-code
commandagi agents start --of worlds/cell/world.tsx --agent claude-work --member codex-review --mount tasks/
commandagi agents tasks --run <run-address>
commandagi agents usage
commandagi agents say --run <run-address> --member codex-review --now "Verify clearances before export"