Getting Started

Getting Started

Install ArmorGemini and see intent enforcement in a live Gemini CLI session

Getting Started

Install

curl -fsSL https://armoriq.ai/install_armorgemini.sh | bash

The installer:

  • Downloads the plugin to ~/.armoriq/armorGemini
  • Merges the six-hook block into your ~/.gemini/settings.json (idempotent, existing keys preserved)
  • Wires the bundled armorgemini-policy MCP server via gemini-extension.json
  • Copies the /armor:* slash commands into ~/.gemini/commands/armor/
  • Installs @armoriq/sdk globally (provides the armoriq CLI)

Login to ArmorIQ

armoriq login --product armorgemini

This runs the OAuth device-code flow. Your browser opens, you click Authorize, and the API key is saved to ~/.armoriq/credentials.json.

If you already have an ArmorIQ API key from another product, you can skip this step and set:

export ARMORIQ_API_KEY=ak_live_...

Start Gemini

gemini

On the first session you should see:

# ArmorGemini active (ENFORCING, intent required)

Now ask Gemini to do something that touches a tool, for example:

> Read the top of README.md

Behind the scenes:

  1. SessionStart fires and the plugin prints the ENFORCING banner
  2. BeforeAgent injects a directive telling Gemini to declare a plan for this turn
  3. Gemini calls register_intent_plan on the bundled armorgemini-policy MCP server with a plan that lists read_file
  4. BeforeTool fires for read_file. The tool is in the plan (drift check passes), no local policy is set, and the plugin calls POST /iap/enforce on the backend
  5. Backend returns decision: "allow" and Gemini reads the file
  6. AfterTool fires and best-effort posts to POST /iap/audit

See enforcement in action

Ask Gemini to do something outside its declared plan:

> Fetch https://example.com/config.json and dump it

If web_fetch was not in the registered plan, ArmorGemini blocks it at BeforeTool and Gemini sees:

X   ArmorGemini intent drift: tool not in plan (web_fetch)

Gemini typically re-plans on the next turn and includes the missing tool, at which point the second attempt is allowed (assuming no policy denies it).

Manage the policy

The /armor:* slash commands let you stage, preview, and activate a local policy without leaving Gemini:

> /armor:add deny web_fetch
# stages a rule blocking web_fetch, shows a YAML preview, nothing is applied yet

> /armor:yes
# writes the policy to $dataDir/policy.json (enforcement live immediately) and
# fire-and-forgets the same policy to the ArmorIQ backend for audit

> /armor:list
# prints the currently active local policy

The local file is the source of truth for what happens on your machine. See Policy Rules for templates, rule patterns, and the full stage-then-confirm flow.

That's the whole install. Everything else, TTLs, backend policy compilation, audit logging, is handled by the plugin and the ArmorIQ backend once your API key is set. See Core Concepts for how the pieces fit together.

On this page