Skip to main content

Custodian Codex Guard

A second opinion before Codex touches your machine.

Codex Guard evaluates every routed Codex action before it runs. Reads, writes, shell commands, network calls, credentials, releases, and destructive operations all pass through policy that the model cannot rewrite.

When an action is safe, Codex continues normally. When an action needs you, Custodian creates an authenticated, single-use approval bound to the exact tool, arguments, workspace, requester, and policy version. Change any of those details and the approval no longer matches.

Watch the two-minute demo.

Why it exists

Agent permissions are useful, but they answer only one question: may this tool run? Custodian asks the questions around it:

  • Is the declared workspace a real project rather than a home directory or filesystem root?
  • Does this command cross a network, credential, production, or money boundary?
  • Has the operator approved this exact action?
  • Can we prove afterward what the guard decided without storing the secret or prompt that caused it?

Codex Guard supplements Codex's sandbox and approval system. It does not replace operating-system isolation.

Install

Version 0.1.3 is available as a GitHub release. It depends on Custodian Kernel 0.4.2.

Install from PyPI:

pipx install custodian-codex-guard
custodian-codex setup
custodian-codex doctor

setup installs the packaged Codex plugin, registers the MCP server with the exact Python interpreter, and installs the PreToolUse enforcement hook. Run it from any directory; a source checkout is not required.

On Linux distributions that enforce PEP 668, use pipx or a virtual environment. Do not use --break-system-packages.

What happens on a tool call

Codex proposes an action
        |
        v
PreToolUse hook classifies and evaluates it
        |
        +-- autonomous or previously approved --> Codex continues
        |
        +-- approval required --> exact action is held for the operator
        |
        +-- denied --> Codex receives a hard block with the reason
        |
        v
Custodian appends a value-free, authenticated receipt

The hook fails closed. A malformed event, missing session identity, invalid workspace, broken approval record, or unexpected verdict becomes a denial.

Operator commands

custodian-codex setup
custodian-codex doctor
custodian-codex status
custodian-codex approve latest
custodian-codex deny latest

The normal approval path is automatic: Custodian waits for the authenticated operator decision and the agent can resume without you returning to the chat to announce that you approved it.

Gate behavior

The shared Custodian control plane supports open monitoring and protected operation:

custodian gates status
custodian gates open
custodian gates protect
custodian gates notifications quiet

Open mode records and optionally announces routed actions. Protected mode requires approval for configured consequential classes. Receipts remain enabled in both modes.

Data and uninstall behavior

Removing the Python package does not delete policy, approvals, receipts, gate preferences, or vault data. Remove the hook before uninstalling:

custodian-codex hook-uninstall
python -m pip uninstall custodian-codex-guard

Release status

The 0.1.3 release has passed the full monorepo suite, clean-wheel smoke tests, strict artifact validation, and qualification on Linux and Windows. macOS qualification remains pending.

Custodian is alpha software and has not received a third-party security audit. Read SECURITY.md before using it for consequential actions.

Links

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.3.tar.gz (44.0 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.3-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: custodian_codex_guard-0.1.3.tar.gz
  • Upload date:
  • Size: 44.0 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.3.tar.gz
Algorithm Hash digest
SHA256 d39e6c9ccf601680b1d1cd635a25ba66ac6494f74b3613bb20b6b604db184568
MD5 a8281e7585b5c56cf467ff11488de0d9
BLAKE2b-256 0f48c0c63422e8c88fbfc286c9467652390f06615b8d321edf59ac9fa43b319e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for custodian_codex_guard-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d989e282fa100777f331c237c101b0433f11b6d1755e08e4b84899ec2c20688
MD5 34ab58eff3563b6153066f8262ca261a
BLAKE2b-256 ab045d93eed6188c6ebf88c9bf2ff498395ccd3b8828d7fa339189340b9039e9

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