{
  "markdown": "# ArmorClaude\n\nArmorIQ intent-based security enforcement plugin for Claude Code and Claude Cowork. Enforces that an AI agent declares what it intends to do before doing it, and every action is checked against that declared intent.\n\n## How It Works\n\n```\nUser Prompt ──► UserPromptSubmit hook ──► Intent plan captured ──► Signed token\n                                                                        │\nTool Call ──► PreToolUse hook ──► Policy check ──► Intent verification ──┘\n                                      │                    │\n                                  deny/allow         drift detected?\n                                                          │\nTool Result ──► PostToolUse hook ──► Audit log sent to IAP\n```\n\n1. **Before the agent acts**: Intercepts prompts, captures a structured plan (from Claude's built-in plan mode or an LLM fallback call), and sends it to ArmorIQ IAP for a signed intent token.\n2. **On every tool call**: Checks the tool against the approved plan, verifies the token hasn't expired, evaluates local policy rules (allow/deny by tool name, data classification like PCI/PII), and optionally verifies CSRG cryptographic proofs. Blocks execution if any check fails.\n3. **After tool execution**: Sends audit logs to ArmorIQ IAP for compliance tracking.\n4. **Fail-closed**: If planning fails, identity is missing, or the token is invalid — all tool calls are blocked by default.\n\n## Install\n\n### One-line install (recommended)\n\n```bash\ncurl -fsSL https://armoriq.ai/install_armorclaude.sh | bash\n```\n\nThis adds the `armoriq` Claude Code marketplace and installs the `armorclaude` plugin. Dependencies are installed automatically on first hook fire.\n\n### Manual install (Claude Code marketplace)\n\n```bash\nclaude plugin marketplace add armoriq/armorClaude\nclaude plugin install armorclaude@armoriq\n```\n\n### Verify\n\n```bash\nclaude plugin list\n# ❯ armorclaude@armoriq  Status: ✔ enabled\n\nclaude mcp list | grep armorclaude\n# plugin:armorclaude:armorclaude-policy: ... ✓ Connected\n```\n\n### First-run behavior\n\nThe plugin ships its Node dependencies uninstalled. On the **first launch** (first hook fire or\nfirst MCP-server start), `scripts/bootstrap.mjs` performs a **one-time `npm install`** and prints\nto stderr:\n\n```\n[armorclaude] installing dependencies (one-time)...\n```\n\n- Requires **Node.js >= 20** and **npm on PATH**, plus **network access on that first run**.\n- The bundled MCP server (`armorclaude-policy`) registers once dependencies finish installing;\n  it stays connected on subsequent runs without reinstalling.\n- **No API key is needed to start.** With `api_key` blank the plugin runs in **local-only mode**\n  (no data leaves your machine — see [Data & Privacy](#data--privacy)); a key only adds backend\n  audit, intent tokens, and CSRG proofs.\n\nIf `claude mcp list` does not show `✓ Connected`, run the server directly from the plugin\ndirectory to surface the install/startup error:\n\n```bash\nnode scripts/bootstrap.mjs mcp\n```\n\n### Update / disable / uninstall\n\n```bash\nclaude plugin update armorclaude\nclaude plugin disable armorclaude   # turn off without removing\nclaude plugin enable  armorclaude\nclaude plugin uninstall armorclaude\n```\n\n### Requirements\n\n- Claude Code 2.x (`claude --version`)\n- Node.js >= 20\n- (Optional) ArmorIQ API key for backend audit + CSRG proofs — get one at https://armoriq.ai\n\n> **Getting an API key via the CLI:** account registration (`armoriq register`) is provided by\n> the Python CLI, not the TypeScript CLI. Install it with `pip3 install armoriq-sdk`, then run\n> `armoriq register`. On macOS use **`pip3`** (plain `pip` is often not on `PATH`).\n\n## Structure\n\n```\narmorClaude/\n├── .claude-plugin/\n│   ├── plugin.json               # Plugin manifest with userConfig\n│   └── marketplace.json          # Marketplace listing for `claude plugin install`\n├── hooks/hooks.json              # Hook registration (7 lifecycle events)\n├── .mcp.json                     # MCP server for policy + intent tools\n├── install_armorclaude.sh        # Curl-able installer\n├── scripts/\n│   ├── bootstrap.mjs             # Auto-installs npm deps on first run\n│   ├── hook-router.mjs           # Hook entrypoint (dispatches events)\n│   ├── policy-mcp.mjs            # MCP server (policy_read, register_intent_plan)\n│   └── lib/\n│       ├── engine.mjs            # Main handlers for all hook events\n│       ├── config.mjs            # Configuration (env vars + userConfig)\n│       ├── planner.mjs           # Plan parsing (plan file + JSON block)\n│       ├── intent.mjs            # Intent token verification & CSRG proofs\n│       ├── iap-service.mjs       # IAP backend (verify-step, audit, CSRG)\n│       ├── crypto-policy.mjs     # Merkle tree policy binding (CSRG)\n│       ├── policy.mjs            # Policy evaluation & management\n│       ├── runtime-state.mjs     # Session & tool discovery tracking\n│       ├── hook-output.mjs       # Hook response formatters\n│       ├── fs-store.mjs          # JSON file I/O\n│       └── common.mjs            # Utilities (sanitize, HTTP, hashing)\n└── tests/                        # node:test test suite (48 tests)\n```\n\n## Configuration\n\n### Plugin userConfig (recommended)\n\nWhen installed as a Claude Code plugin, these values are prompted on enable:\n\n| Key | Sensitive | Description |\n|-----|-----------|-------------|\n| `api_key` | Yes | ArmorIQ API key |\n| `mode` | No | `enforce` (default) or `monitor` |\n| `intent_required` | No | Require intent for all tools (default: `true`) |\n| `crypto_policy_enabled` | No | Enable Merkle tree policy binding |\n| `use_production` | No | Use production ArmorIQ endpoints |\n\n### Environment Variables\n\n**Core:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORCLAUDE_MODE` | `enforce` | `enforce` blocks on failure, `monitor` logs only |\n| `ARMORCLAUDE_INTENT_REQUIRED` | `true` | Block tool calls with no intent token |\n| `ARMORCLAUDE_DATA_DIR` | `$CLAUDE_PLUGIN_DATA` or `~/.claude/armorclaude` | Data storage directory |\n| `ARMORCLAUDE_DEBUG` | `false` | Enable stderr debug logging |\n\n**ArmorIQ Integration:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORIQ_API_KEY` | — | ArmorIQ SDK API key |\n| `ARMORCLAUDE_USE_SDK_INTENT` | `true` | Use ArmorIQ SDK for intent capture |\n| `ARMORCLAUDE_INTENT_URL` | — | Custom intent endpoint (overrides SDK) |\n| `ARMORCLAUDE_VERIFY_STEP_URL` | `<backend>/iap/verify-step` | IAP verify endpoint |\n| `ARMORCLAUDE_BACKEND_ENDPOINT` | production or localhost | IAP backend URL |\n| `ARMORCLAUDE_IAP_ENDPOINT` | production or localhost | CSRG service URL |\n| `ARMORCLAUDE_VALIDITY_SECONDS` | `60` | Intent token TTL |\n\n**Plan Directive:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORCLAUDE_PLANNING_ENABLED` | `true` | Inject directive telling Claude to register an intent plan |\n\n**Crypto Policy Binding:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORCLAUDE_CRYPTO_POLICY_ENABLED` | `false` | Merkle tree policy binding |\n| `CSRG_URL` | IAP endpoint | CSRG service URL |\n| `REQUIRE_CSRG_PROOFS` | `true` | Require cryptographic proofs |\n| `CSRG_VERIFY_ENABLED` | `true` | Enable CSRG verification |\n\n**Audit Logging:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORCLAUDE_AUDIT_ENABLED` | `true` (when API key set) | Send audit logs to IAP |\n\n**Observability:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORIQ_OBSERVABILITY_DISABLED` | `false` | Set to `true`/`1`/`yes` to stop sending execution traces to the ArmorIQ dashboard. Observability is **on by default** when an API key is set — see [Data & Privacy](#data--privacy). Equivalent to the `disable_observability` plugin option. |\n\n**Policy Management:**\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `ARMORCLAUDE_POLICY_UPDATE_ENABLED` | `true` | Allow runtime policy updates |\n| `ARMORCLAUDE_POLICY_UPDATE_ALLOWLIST` | `*` | CSV of allowed actors |\n\n## Hook Events\n\n| Event | Handler | Purpose |\n|-------|---------|---------|\n| `SessionStart` | Initialize session, prune stale sessions | Lifecycle setup |\n| `UserPromptSubmit` | Policy commands, intent capture, LLM planning | Pre-processing |\n| `PreToolUse` | Policy check, intent verification, CSRG proofs, ExitPlanMode capture | **Enforcement** |\n| `PostToolUse` | Audit logging (success) | Compliance |\n| `PostToolUseFailure` | Audit logging (failure) | Compliance |\n| `Stop` | Token expiry check | Turn cleanup |\n| `SessionEnd` | Remove session state | Lifecycle cleanup |\n\n## Plan Generation\n\nArmorClaude supports two plan generation strategies:\n\n### 1. Claude's Built-in Plan Mode (primary)\nWhen Claude operates in plan mode, it writes a plan file and calls `ExitPlanMode`. ArmorClaude intercepts `ExitPlanMode` via the `PreToolUse` hook, parses the plan file, and sends it to ArmorIQ for intent token generation.\n\n### 2. MCP Tool (when plan mode is off)\nA directive injected via `UserPromptSubmit` instructs Claude to call `register_intent_plan` as its first tool call. Claude produces the plan as the tool's arguments — using its own LLM in the same turn, with no separate API key or extra LLM call. The MCP tool handler sends the plan to ArmorIQ for a signed intent token.\n\n## Policy Commands\n\nPolicy mutation is human-only. Commands run in the `UserPromptSubmit` hook before Claude's LLM sees the prompt; Claude can read policy through MCP but cannot update it.\n\nPrimary commands:\n- `/armor` — show policy command help\n- `/armor policy list` — show all rules\n- `/armor policy add allow Read and Grep, deny Write, hold Bash` — stage deterministic policy changes\n- `/armor policy confirm [proposal-id]` — apply a staged proposal\n- `/armor policy cancel [proposal-id]` — discard a staged proposal\n- `/armor yes` — apply the current staged proposal\n- `/armor no` — discard the current staged proposal\n- `/armor policy rebind` — reissue the crypto policy token for the current policy\n- `/armor profile save <name>` — save the current policy as a profile\n- `/armor mcp approve <server>` — approve an MCP server\n\nRules staged with `hold` / `require_approval` use Claude Code's native tool approval UI at `PreToolUse` time after ArmorClaude policy and intent checks pass. Unknown MCP servers also use native approval for a one-time tool call; use `/armor mcp approve <server>` only when you want to trust that server persistently.\n\nLegacy `/armor-policy ...` is intentionally unsupported. Use `/armor ...` only.\n\nBeginner guide: [ArmorClaude Policy Guide](./POLICY_GUIDE.md)\n\nMCP tools: `policy_read`, `register_intent_plan`, and Trust Update tools. There is intentionally no `policy_update` MCP tool.\n\n## Security Model\n\n- **Intent Drift Detection**: Every tool call is checked against the approved plan. Unauthorized tools are blocked.\n- **Token Expiry**: Intent tokens have configurable TTL (default 60s). Expired tokens block all tool calls.\n- **Data Class Detection**: Automatic PCI, PAYMENT, PHI, PII detection in tool parameters.\n- **Crypto Policy Binding**: Optional Merkle tree binding via CSRG ensures policy rules can't be tampered with after token issuance.\n- **Audit Trail**: Every tool execution (success/failure) is logged to ArmorIQ IAP.\n- **Fail-Closed**: Missing tokens, failed planning, invalid proofs — all result in denied tool calls in enforce mode.\n\n## Data & Privacy\n\nArmorClaude's security enforcement works by inspecting prompts and tool calls. **What leaves your\nmachine depends entirely on whether an ArmorIQ API key is configured:**\n\n- **Local-only mode (no `api_key`)** — nothing is transmitted. Policy checks, intent-drift\n  detection, and audit logging all run locally.\n- **Connected mode (`api_key` set)** — the following is sent to the ArmorIQ backend\n  (`api.armoriq.ai` / `iap.armoriq.ai`) to provide intent tokens, audit trails, and CSRG proofs:\n  - The captured **prompt and structured intent plan** (goal + steps).\n  - Per-step **audit logs** containing the tool name and its **inputs and outputs**.\n  - **Observability execution traces** (spans for planning, policy checks, and tool\n    inputs/outputs) — **on by default** in connected mode.\n\n  Tool inputs and outputs are passed through secret redaction and parameter sanitization before\n  transmission.\n\n### Turning off observability\n\nObservability traces are **enabled by default** when an API key is set. To disable them (audit\nand intent enforcement still work):\n\n- **Plugin option:** set `disable_observability: true` in the plugin's userConfig, **or**\n- **Environment variable:** set `ARMORIQ_OBSERVABILITY_DISABLED=true` (also accepts `1` / `yes`).\n\n- **Product overview and setup:** <https://armoriq.ai/tools/armorclaude>\n- **Privacy policy (data collected, retention, opt-out):** <https://armoriq.ai/privacy-policy> (Section 6, \"Product-Specific Data Flows\")\n\n## Tests\n\n```bash\nnode --test tests/*.test.mjs\n```\n",
  "bytes": 12961,
  "sha": "57556bf3afc8d65745f817df21339b86761b0abcb85fdcedc9bb216f3e8c1b82",
  "repo_slug": "armoriq/armorclaude",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_armoriq_armorclaude_armorclaude_709dfe51/readme"
}