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.4 is available as a GitHub release, not yet on PyPI. It adds open-gate crossing notifications, and the evaluation engine moved into Custodian Kernel so sibling guard adapters no longer depend on this package. It depends on Custodian Kernel 0.4.3.

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.4 release has passed the full monorepo suite, clean-wheel smoke tests, strict artifact validation, and qualification on Linux and Windows, on top of the evaluation-engine relocation described above. 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

Metadata

Release files for custodian-codex-guard 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for custodian-codex-guard 0.1.4
File Size Uploaded Provenance
custodian_codex_guard-0.1.4.tar.gz 39.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for custodian-codex-guard 0.1.4
File Interpreter ABI Platform
custodian_codex_guard-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 77.4 kB

Release files / custodian_codex_guard-0.1.4.tar.gz

Download URL custodian_codex_guard-0.1.4.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
305a96967cbd75d852a8d6e0ea37a5610c2d74105c19e32b6d2e4fdc02895c70
BLAKE2b-256 checksum
How to use checksums
cd3348b0db07d96a9079b799a07f9ee7c951e8b23fcaf95fd87e0acc1d51b490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / custodian_codex_guard-0.1.4-py3-none-any.whl

Download URL custodian_codex_guard-0.1.4-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f6c4dd9e4a94c9f2128ed17f1d5b23dbbaf578805e53ca805d819eb0669d641
BLAKE2b-256 checksum
How to use checksums
24b4e870c41201e55851b4c7c858ae8ee3296919239da7d61e0d72d492e9b1ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for custodian-codex-guard 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page