Skip to content
Gemini CLI

protect-context for Gemini CLI

io.github.xjtlumedia/protect-context

Agent guardrails: contract, evidence ledger, loop brake, diff-scope warnings, durable journal.

client:Gemini CLI transport:stdio runtime:pypi

Install protect-context in Gemini CLI

~/.gemini/settings.json · windows: %USERPROFILE%\.gemini\settings.json

Held in this page only — never stored, logged, or sent anywhere but back to your screen.

{
  "mcpServers": {
    "protect-context": {
      "command": "uvx",
      "args": [
        "protect-context"
      ],
      "env": {
        "PC_SESSION_ID": "<PC_SESSION_ID>"
      }
    }
  }
}

Gemini expands $VAR and ${VAR} inside env values, so a secret can live in your shell rather than this file. Gemini CLI docs

protect-context in other clients