Configuration

Configuration

Env vars, data directories, backend endpoints, debug logging

Configuration

ArmorCopilot reads configuration in this order (later wins):

  1. Compiled defaults from the SDK (@armoriq/sdk-dev)
  2. Plugin userConfig set in Copilot CLI
  3. Process env vars (ARMORCOPILOT_*)
  4. Per-hook env block in hooks/hooks.json

Plugin userConfig

After install, open the plugin's userConfig from Copilot (copilot plugin configure armorcopilot) and set:

FieldTypeDefaultNotes
api_keystring(empty)Your ArmorIQ API key. Required. Get one at https://armoriq.ai.
modestringenforceenforce (block on policy/intent failures) or monitor (log only).
intent_requiredbooleantrueRequire every tool to be backed by a registered intent plan. Disable for advisory-only use.
crypto_policy_enabledbooleanfalseBind policy rules to a Merkle tree (CSRG proofs).
use_productionbooleanfalseWhen true, talks to production endpoints. When false, expects local backend on 127.0.0.1 (development).

Plugin config is stored at ~/.copilot/plugin-data/armorcopilot/armorcopilot/config.json.

Env vars

For automation / CI / per-session overrides, use process env vars:

Env varDefaultWhat it controls
ARMORIQ_ENVstaging (from sdk-dev)One of production, staging, local. Drives endpoint defaults below.
ARMORCOPILOT_BACKEND_ENDPOINTresolved from envOverride backend URL.
ARMORCOPILOT_IAP_ENDPOINTresolved from envOverride IAP / CSRG URL.
ARMORCOPILOT_PROXY_ENDPOINTresolved from envOverride proxy URL.
ARMORCOPILOT_MODEenforceenforce or monitor.
ARMORCOPILOT_INTENT_REQUIREDtrueSame as plugin userConfig field.
ARMORCOPILOT_DATA_DIR~/.copilot/armorcopilotWhere policy.json, audit/, pending-plan files live.
ARMORCOPILOT_DEBUGfalseEnable verbose [armorcopilot] stderr logs.
ARMORCOPILOT_VALIDITY_SECONDS600Lifetime of an issued intent token (10 min default).
ARMORCOPILOT_TIMEOUT_MS8000HTTP timeout for backend calls.
ARMORCOPILOT_MAX_RETRIES1Backend retry count.
ARMORCOPILOT_AUDIT_ENABLEDtrue (if api_key set)Enable audit log shipping.
ARMORCOPILOT_USE_SDK_INTENTtrueIssue intent tokens via the ArmorIQ backend.
ARMORIQ_API_KEY(reads ~/.armoriq/credentials.json)Override the API key.

Endpoint resolution

Backend endpoints resolve based on ARMORIQ_ENV:

ARMORIQ_ENVBackendIAPProxy
productionhttps://api.armoriq.aihttps://iap.armoriq.aihttps://proxy.armoriq.ai
staging (default for sdk-dev)https://staging-api.armoriq.aihttps://iap-staging.armoriq.aihttps://cloud-run-proxy.armoriq.io
localhttp://127.0.0.1:3000http://127.0.0.1:8000http://127.0.0.1:3001

Explicit ARMORCOPILOT_*_ENDPOINT env vars always win.

Data directory layout

~/.copilot/armorcopilot/
├── policy.json                       # Current policy rules + version
├── runtime.json                      # Session state, runtime metadata
├── pending-plan.<session_id>.json    # Per-session registered intent plan
├── pending-plan.json                 # Legacy global path (mirror for compat)
└── audit/
    ├── audit.wal                     # Pre-flush write-ahead log
    └── archive/                      # Shipped & rolled-over WAL segments

Everything except ~/.armoriq/credentials.json lives here. Wipe the directory to fully reset state.

Debugging

Enable verbose logging:

ARMORCOPILOT_DEBUG=true copilot

Then watch the Copilot CLI log:

RECENT_LOG=$(ls -t ~/.copilot/logs/*.log | head -1)
tail -F "$RECENT_LOG" | grep -E "armorcopilot|hook="

You should see lines like:

[armorcopilot] hook=SessionStart
[armorcopilot] session started: <uuid>, mode=enforce
[armorcopilot] hook=UserPromptSubmit
[armorcopilot] hook=PreToolUse

Copilot CLI marks hook stderr output with [ERROR] level in its logs even for normal INFO lines. Don't be alarmed by [ERROR] [armorcopilot] hook=.... That's expected. Real errors say error=... in the message.

Uninstall

bash ~/.armoriq/armorCopilot/install_armorcopilot.sh --uninstall

Removes the plugin + marketplace registration. Plugin source at ~/.armoriq/armorCopilot is left in place. Run rm -rf ~/.armoriq/armorCopilot to remove fully.

Credentials at ~/.armoriq/credentials.json are preserved across uninstall/reinstall by default.

On this page