From blank repo to bonded agent, inside OpenCode.
A native OpenCode plugin that scaffolds, wraps, and ships bonded agents without leaving the TUI. Open a scratch directory, call chio_init, and walk out four minutes later with a signed MCP server, a policy under version control, and receipts on every tool call.
One plug. Every tool call, bonded.
The plugin registers a suite of chio_* custom tools and prefixes every mediated tool's result title with a live BONDED status line — the nearest OpenCode equivalent to a status bar.
Install the chio runtime
The chio binary ships as a single static binary; needed only on the machine running OpenCode.
curl -fsSL https://www.chio.world/install.sh | shRegister the plugin
Add @chio-protocol/opencode-plugin to opencode.json.
# opencode.json
{ "plugin": ["@chio-protocol/opencode-plugin"] }Init a workspace
The chio_init tool generates a deny-by-default policy, a receipts store, and a guards directory tied to your repo.
# from the TUI tool picker: chio_init# generated by chio_init · HushSpec 0.1.0 hushspec: "0.1.0" name: support-desk extends: chio://preset/support-agent rules: path_allowlist: read: ["./tickets/**"] tool_access: default: block allow: [ticket.read, ticket.reply, kb.search] velocity: budget_usd: 80 max_invocations: 200 window_seconds: 86400 human_in_loop: approve_above_usd: 100
Four files. One bonded agent.
The scaffold is opinionated. Every file is plain text, committed next to your code, reviewable by humans and CI.
policy.yaml · the ruleset.
Rules, velocity, HITL, and egress under version control. Extend a preset; override what you care about.
preset: tool-agentagent.md · the brief.
A human-readable instruction manifest. OpenCode feeds it to the model; Chio lints it against the policy.
role · tools · guardrailsguards/ · the custom logic.
Rust to WASM fuel-metered deny predicates. Scaffolded, tested, swapped without restarting the host.
cargo check · chio guard testreceipts.db · the evidence.
A local SQLite ledger of every allow, deny, cancel, and incomplete. Streams to any SIEM you mount.
sqlite · s3 · splunk · datadogAgent construction kit. Wired into the TUI.
Every mutation is reviewable, every diff signable, every deploy receipt-backed.
Tool-result bond prefix
tool.execute.after prepends a live ◉ BONDED · budget · guards line to every mediated tool result. Nearest OpenCode equivalent to a status bar.
tuiScaffold presets
tool-agent, code-agent, research-agent, support-agent, trader, release-engineer. Each a deny-closed starting point.
presetsGuard REPL
Write a deny predicate, call chio_guard_add, see it graded against every receipt in the last hour.
wasm · fuel-meteredSession replay
chio_replay scrubs any past session; replay is deterministic because every call was mediated.
replayPolicy lint
chio_policy_lint: dead capabilities, shadowing, implied egress leaks. CI-ready JSON output.
lint · ciOne-shot deploy
chio_deploy packs guards and runs chio certify: staging first, then prod, auto rollback on guard-fail.
deploySix scaffolds. All revocable.
Every kit is a chio_init preset away. The plugin drops policy.yaml, agent.md, and guards/ scaffolds, bonds a capability, opens the relevant buffer.
Every scaffold is reviewable before it runs.
Blank repo. Bonded agent. Two tool calls.
The plugin belongs in every OpenCode install the way a linter does. Free, open source, makes every buffer defensible.