Skip to main content

Custodian Guard for Codex

(OpenAI Build Week, July 2026)

A capability firewall for coding agents. Codex can inspect, test, and edit inside an approved workspace; credential use, network operations, destructive commands, production changes, money movement, and governance changes stop at a human-approval boundary. Every decision produces a value-free HMAC hash-chained receipt. Classification is deterministic — typed action-kind rules over the tool name and arguments, not a model call — so a mislabeled or adversarial proposal can't talk its way past the boundary by re-describing itself.

This is the Build Week contribution specifically: the Codex-facing MCP server, the policy bridge, the receipts CLI, and the governance skill. It depends on custodian-kernel — the policy engine, adapter pipeline, and approval/filesystem/ledger-access policies — which is agent-agnostic and predates this Build Week.

This plugin is generic. It does not know about any particular website, IDE, or operator. A site or IDE is a client of the MCP boundary, never part of the kernel.

Install for judging

Python 3.11 or later:

# Linux/macOS
python3 -m venv .venv
. .venv/bin/activate
# Windows PowerShell
python -m venv .venv
.venv\Scripts\Activate.ps1

python -m pip install -e .
custodian-codex setup
custodian-codex doctor

pip install -e . pulls in custodian-kernel (pinned to the exact commit this was built and verified against — see pyproject.toml; 0.4.0 isn't on PyPI yet) automatically, nothing else to install first. Start a new Codex thread after setup so it loads the plugin. The plugin manifest is at plugins/custodian-codex-guard/.codex-plugin/plugin.json; its governance skill is at plugins/custodian-codex-guard/skills/govern-codex/SKILL.md.

If the integration itself is broken, the operator — not the model — can run custodian-codex disable. This removes the Codex plugin while deliberately preserving receipts and approvals for diagnosis; custodian-codex setup restores it. Start a new Codex thread after either change.

Sixty-second proof

python scripts/codex-guard-demo.py
pytest -q tests/

The demo performs no network calls and changes no external state. It shows a safe test and workspace edit passing, .env access being denied, deliberately misclassified delete/deploy commands being independently upgraded to human escalation, a valid receipt chain, and rejection after receipt tampering. 106 tests cover the full threat model.

Enforcement contract

guard_action returns autonomous, escalation_required, approved, or denied. An escalation is never permission. The model can create a pending request but cannot approve it; the operator runs the returned custodian-codex approve ID --digest DIGEST outside the model tool boundary. Approval binds the exact tool, effective risk class, arguments, resolved workspace, requester, and policy version — any change requires a fresh request, never a reused approval ID.

No harness — including Codex itself — can read the receipt ledger by default, not even its own history. Visibility is only ever an explicit operator grant. The agent being governed is exactly the party a denial log exists to constrain; letting it read its own denial history would turn the ledger into an oracle it could probe to learn the enforcement boundary and route around it.

What's in this repo vs. the kernel

  • Here: custodian/codex_guard/ (MCP server, risk classification, receipts, approvals, CLI), plugins/custodian-codex-guard/ (Codex plugin manifest + governance skill), tests, judge demo script.
  • In custodian-kernel: the adapter pipeline (workspace/secret/prompt- injection/egress guards), ApprovalPolicy, FilesystemPolicy, LedgerAccessPolicy — the policy engine every action is actually checked against.

See docs/CODEX_GUARD.md for the full judge guide.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

custodian_codex_guard-0.1.0.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

custodian_codex_guard-0.1.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file custodian_codex_guard-0.1.0.tar.gz.

File metadata

  • Download URL: custodian_codex_guard-0.1.0.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for custodian_codex_guard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 074c33aef6b2dc786dc3cf57c5970f325513cee37c7d22a5416d7a112371f64a
MD5 07a7552212912bd1f71a679da8ffe755
BLAKE2b-256 ed1c6ebc95a96fe66d0910a92f0008e5bca24fb05399719517d44356d30874de

See more details on using hashes here.

File details

Details for the file custodian_codex_guard-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for custodian_codex_guard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faabf1b45e450ddbf8843eb00a2a22e63abfb22496feb2047fcdc99f38baf083
MD5 3477e99a0ac457dd843e0188997f8799
BLAKE2b-256 29183f5ead628d6b29db250571b76e8fdb365ce10247708b0428643f5b6fd0ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page