ArmorCodex
Provides intent-based security enforcement for OpenAI Codex, intercepting Bash commands to verify against intent plans and policy, with optional audit logging.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ArmorCodex
ArmorIQ intent-based security enforcement for OpenAI Codex. ArmorCodex asks Codex to declare a Bash execution plan before it runs commands, checks each Bash command against that plan and local policy, and optionally sends signed intent and audit events to ArmorIQ IAP.
Current Codex Harness
ArmorCodex is built for the current Codex hook harness documented by OpenAI:
Hooks are discovered from
~/.codex/hooks.jsonand<repo>/.codex/hooks.json.Hooks require
[features] hooks = truein~/.codex/config.toml.PreToolUse,PermissionRequest, andPostToolUsecurrently emitBashonly.Non-Bash tools such as MCP, file edits, web search, and write/apply-patch are not directly intercepted by Codex hooks today.
Treat ArmorCodex as a strong Bash guardrail and audit layer, not a complete boundary for every Codex capability.
See Codex harness limitations for the harness gaps that need to be addressed before ArmorCodex can claim broader tool coverage.
Sources: OpenAI Codex hooks docs and plugin build docs: https://developers.openai.com/codex/hooks https://developers.openai.com/codex/plugins/build
Related MCP server: aegis
How It Works
User Prompt -> UserPromptSubmit -> intent-plan directive
|
Codex calls register_intent_plan MCP tool
|
Bash command -> PreToolUse -> policy + intent verification -> allow/deny
Approval request -> PermissionRequest -> policy approval gate
Bash result -> PostToolUse -> audit log to ArmorIQ IAPInstall
Requirements: Codex 0.162 or newer and Node.js 20 or newer. Older Codex sends no session id with MCP calls, so ArmorCodex rejects every plan registration. The installer checks both versions and stops if either is too old.
Install or Update
The same command installs ArmorCodex and updates an existing install. Run it again whenever Tools says a new version is out:
# Stable (platform.armoriq.ai)
curl -fsSL https://armoriq.ai/install_armorcodex.sh | bash
# Dev (staging)
curl -fsSL https://armoriq.ai/install_armorcodex_dev.sh | bashAn update fetches the latest plugin into ~/.armoriq/armorCodex, rewires ~/.codex/config.toml and ~/.codex/hooks.json, and refreshes the npm dependencies. Your ArmorIQ login is kept. Each command updates only an install of its own channel; run against the other channel's install, it stops without changing anything. If the installer finds no login, it leaves the install in place, prints the login command to run, and exits with status 1. Release notes are in CHANGELOG.md and on the repo's GitHub releases.
From This Checkout
npm install
chmod +x install_armorcodex.sh
./install_armorcodex.shThe installer enables hooks, installs the Codex plugin through the ArmorIQ marketplace, and can install the repo hook file globally when run from this checkout.
Manual Repo-Local Setup
npm install
mkdir -p ~/.codex
printf '\n[features]\nhooks = true\n' >> ~/.codex/config.tomlThen run Codex from this repository. The repo-local hook file is already at .codex/hooks.json.
Manual MCP Setup
ArmorCodex ships a Codex plugin manifest at .codex-plugin/plugin.json and an MCP server config at .mcp.json. The MCP server exposes:
register_intent_planpolicy_readpolicy_update
Configuration
Sign in with armoriq login --product armorcodex. ArmorCodex reads the saved login for its backend and product.
ArmorCodex and the armoriq CLI talk to production (https://api.armoriq.ai) by default. To use staging, set ARMORIQ_ENV=staging in the shell that runs both armoriq login and Codex; a login saved for one backend is not used for the other.
Core environment variables:
Variable | Default | Description |
|
|
|
|
| Require a registered intent plan before Bash |
|
| Runtime, policy, and pending-plan storage |
|
| Intent token lifetime. Values above 3600 are capped at 3600, the most ArmorIQ issues |
|
| Debug logs on stderr |
| true when API key exists | Send audit logs |
|
| Enable Merkle policy binding |
|
| Stop sending execution traces; also stops the token usage sync. Same as the |
|
| Stop the token usage sync and keep traces. Applies only while observability is on. Same as the |
Token usage sync
While observability is on, ArmorCodex uploads token counts per session, model, UTC date and UTC hour, with the session's working directory and the device name. It sends no prompts or transcript text, and only usage dated after the current login unless the dashboard asks the device for its earlier history.
Each
Stopuploads that session's usage (its rollout and its subagents' rollouts) on its own.plugins/armorcodex/scripts/usage-worker.mjs --serveruns while at least one Codex session is open:SessionStartregisters the session and starts it,SessionEndremoves the session, and it exits when none is left. Every 60 seconds it uploads sessions that changed without aStop, retries failed uploads, and handles the dashboard's earlier-history request.
SessionEnd is a new hook. Codex runs a hook only after you trust it, so after updating run
/hooks in Codex once and trust ArmorCodex's SessionEnd hook. The other ArmorCodex hooks are
unchanged and keep their trust. Without it the worker still exits when Codex itself exits.
Data & Privacy
ArmorCodex sends one small anonymous usage ping on the first session or prompt of each UTC
day, whether you are signed in or not. It sends a random install id, the plugin name and
version, the host agent and its version (when known), your OS, whether you are signed in,
the backend environment, and daily counts of plans, blocks and approval requests made while
signed out. Counts cover up to seven earlier UTC days. The install id lives in
~/.armoriq/install-id, is shared by the ArmorIQ plugins in that home, and is separate from
sign in. It is never used to identify your account or sent anywhere except the daily ping.
The ping never sends prompts, plans, tool names, arguments, paths, repo names, emails, keys, the sign in device id, or IP addresses. ArmorIQ's app never stores the sender's IP address, although Google Cloud's request logs record it at the infrastructure level. Anonymous ping rows and daily counts are kept indefinitely. Signed in token usage reports have their own controls and payload.
You can turn the ping off with any of these:
Set
DO_NOT_TRACK=1orDO_NOT_TRACK=true.Set
ARMORIQ_USAGE_PING_DISABLED=1,true, oryes.Set
"usagePing": falsein~/.armoriq/settings.json, keeping any other settings.
Environment values ignore case and surrounding spaces. A malformed or unreadable settings file, a value of the wrong type, or a backend outside the supported production and staging origins also disables the ping. Disabled pings create no install id, ping claim or counter files. No reminder changes your ping setting.
If you are not signed in, ArmorCodex also shows a sign in reminder at session start, at
most once per UTC day. It appears only to you and makes no network request. Hide it with
ARMORIQ_SIGNIN_REMINDER_DISABLED=1 (also true or yes, ignoring case and surrounding
spaces), or set "signInReminder": false in ~/.armoriq/settings.json. A malformed or
unreadable settings file or a value of the wrong type hides it for that run. DO_NOT_TRACK
and usagePing do not hide this reminder.
Policy Commands
Structured armor commands (staged: nothing applies until you confirm):
Type these as plain prompts with no leading slash:
armor policy list, not/armor. Codex reserves/for its own built-in commands, so ArmorCodex intercepts thearmor ...text in theUserPromptSubmithook.
armor policy listandarmor policy viewarmor policy add deny bash(orallow/hold; multiple:add allow bash and apply_patch, deny apply_patch)armor policy remove <id>armor policy resetarmor policy default deny|allow|hold(unmatched-tool default)armor policy template <all-allow|lockdown|strict-read-only|balanced>armor profile save|list|switch|delete <name>armor mcp approve|deny <server>andarmor mcp listarmor yes/armor noto apply or discard the staged change
Staging a change shows a diff and risk warnings; applying is human-only (the MCP policy_command tool can read and stage, but only a terminal armor yes applies). See POLICY_GUIDE.md.
Natural-language commands still work for quick edits (applied immediately):
Policy list,Policy get <id>,Policy delete <id>,Policy resetPolicy new: deny Bash for payment dataPolicy update <id>: allow BashPolicy prioritize <id> <position>
Tests
cd plugins/armorcodex
npm testRepository Structure
armorCodex/
├── .codex/hooks.json # Repo-local Codex hook registration
├── .codex-plugin/plugin.json # Codex plugin manifest
├── .mcp.json # ArmorCodex MCP server config
├── hooks/hooks.json # Plugin-local hook reference
├── scripts/
│ ├── bootstrap.mjs # Lazy dependency installer and dispatcher
│ ├── hook-router.mjs # Codex hook router
│ ├── policy-mcp.mjs # MCP server
│ └── lib/ # Policy, intent, IAP, crypto, runtime modules
└── tests/Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Zero-trust gateway for AI agents: score tool calls, verify agent cards, enforce policy, audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA governance and control layer for MCP tools that manages tool requests as intents through policy-based approval, queuing, or blocking. It enables secure human oversight and audit trails for consequential agent actions across platforms like Claude Desktop and Cursor.1MIT No Attribution
- AlicenseAqualityBmaintenancePolicy-based governance for AI agent tool calls. YAML policies, approval gates, risk assessment, and audit logging across LangChain, OpenAI, Anthropic, and MCP.5364 PyPI18MIT
- AlicenseNot gradedqualityBmaintenanceDeterministic policy enforcement for AI agent tool calls. It evaluates every tool call against user-defined rules before execution, with no LLM in the authorization path.4MIT

agentguardofficial
AlicenseNot gradedqualityAmaintenanceEnforces policy controls for AI agents, including spend limits, action approvals, kill switch, scoped credentials, dry-run diffs, loop prevention, and auditable hash-chained logs.MIT