Codex CLI Guardrails
Command-hook authorization for OpenAI Codex CLI workflows
APort adds command-hook authorization to Codex CLI workflows so shell commands, file operations, and network-facing actions can be checked before execution. Use hosted mode for signed audit decisions or local mode for offline smoke tests.
Quick Start
1. Install guardrail & create passport
npx @aporthq/aport-agent-guardrails codex2. Configure the integration
# One-command Codex CLI setup
npx @aporthq/aport-agent-guardrails codex
# Switch to audit-only mode without replacing the passport:
npx @aporthq/aport-agent-guardrails mode codex --enforcement=warnTest the authorization boundary
Installer target: codex. Aliases: none; use the target ID.
npx @aporthq/aport-agent-guardrails codexDenied-action example
Read .env.aport-smoke-test with a passport that blocks .env* paths.
Expected policy result: deny. Use an empty test file. In warn mode the runtime may continue; enforce mode must stop the read. Hosted mode can record the decision; local mode does not prove hosted audit persistence.
{
"policy_id": "data.file.read.v1",
"allow": false,
"reason": "oap.blocked_pattern"
}How It Works
Passport
Your agent gets an OAP passport declaring its identity, capabilities, and operational limits.
Evaluate
Before every tool call, the guardrail evaluates it against the passport's policy. Locally or via hosted API.
Decision
Allow or deny with structured OAP reason codes. Signed decisions create an auditable trail.
Frequently Asked Questions
Can Codex CLI use hosted APort decisions?
Yes. Hosted mode sends minimal policy context to APort Verify and records signed decisions for team audit. Local mode remains available for offline development.
Ready to secure your Codex CLI agents?
Review the setup command and denied-action check before enforcing policy.
Start free for local or individual setup. Upgrade to Team for hosted org audit, signed decisions, GitHub guardrails, and shared enforcement across your team.