One Codex run. One new citizen of the agent economy.
The Chio Codex plugin wires the OpenAI Codex CLI into Chio's kernel through real Codex hooks and skills. chio-codex run turns every plan-then-act loop into a bonded, budgeted, receipt-signed operation. If Codex didn't pass a guard, it didn't happen.
Hooks and skills. Codex, fully mediated.
The plugin installs into Codex via the published plugin manifest and hooks config. Every tool call (shell, fs, git, fetch, any MCP) is routed through the chio kernel before it runs.
Install Codex and Chio
The Codex CLI from OpenAI, the Chio runtime from Backbay. Both are single binaries.
brew install openai-codex && curl -fsSL https://www.chio.world/install.sh | shRegister the plugin with Codex
Copies the plugin manifest and hooks config into ~/.codex/plugins/chio-codex.
codex plugin install @chio-protocol/codex-pluginRun any task through chio-codex
Use chio-codex run -- codex "..." for a bonded run; --plan-first fingerprints the plan before the first tool call.
chio-codex run --policy ./migration.policy.yaml --plan-first -- codex "migrate mongo→postgres"# Codex skills (skills/chio-*/SKILL.md) + mirrored CLI subcommands chio-codex status # bonded-session status chio-codex bond --policy ./p.yaml # issue a capability chio-codex policy # print the active policy chio-codex guard-pause shell # pause a guard (TTL opt) chio-codex budget 200 # adjust the spend ceiling chio-codex approve 0x1a4c # countersign a gated action chio-codex revoke # tear down the capability chio-codex receipt-export 1h # signed evidence bundle chio-codex publish weekly-sync # mint a did:chio citizen
Codex plans. Chio governs.
The plugin hooks Codex's plan-execute loop via PreToolUse, PostToolUse, UserPromptSubmit, Stop, and SessionStart. Every turn is observed by the kernel; every tool call is a receipt.
Codex reads the task.
chio-codex binds a capability and a budget before the first tool call; UserPromptSubmit SHA-256-hashes the prompt as promptHash.
bond → cap · budget · ttlCodex emits a plan.
--plan-first asks Codex to print its plan as a fenced block; the hook hashes it into planHash. Drift surfaces as a post-hoc audit signal.
plan_hash · attestedEvery step goes through 18 guards.
PreToolUse fail-closed: denies surface in Codex's output verbatim; PostToolUse verifies signatures and persists.
18 guards · 2msLeave a citizen behind.
--publish turns a one-off run into a named, policy-pinned operator with a did:chio:{64-hex} Agent Passport.
did:chio:1b14f0ae…Codex, made into a citizen.
The plugin treats Codex runs as first-class economic actors. Every run is reproducible, revocable, and insurable.
Plan attestation
UserPromptSubmit fingerprints the prompt; --plan-first also hashes the emitted plan. Both hashes ride every receipt.
provenancePatch integrity
Every diff is validated: line counts, path scopes, encoding. No silent binary writes.
fs · diffOne-shot citizens
--publish turns a successful run into a named, scheduled, policy-pinned agent with a did:chio:{64-hex} passport.
passport · scheduleApproval stages
Codex splits a plan into dry-run and mutate phases, auto-pausing at the first mutating step until a human signs.
gates · human-in-loopDelegation
Hand work to another agent (Claude, a wrapper, a microservice) with attenuated capability scope.
delegationEvidence bundles
--evidence dumps a signed, offline-verifiable bundle on Stop. Hand it to a ticket or an auditor.
audit · offline-verifyCodex + Chio, for the dangerous stuff.
The plugin shines on tasks too risky for un-bonded Codex: database migrations, prod rollbacks, destructive refactors, any job you'd hand to a senior on-call.
Plan, act, prove, revoke.
Every Codex run leaves a citizen.
Today's one-off script becomes tomorrow's bonded operator, with a passport, a policy, and a receipt trail back to the first prompt.