{
  "markdown": "# NetRise Package Firewall — Gemini CLI extension\n\nA Gemini CLI extension that routes every package install an agent runs\n(pip / uv / pipx / npm / pnpm / yarn / cargo) through `netrise firewall`, so\nmalicious packages are blocked at install time.\n\nIt registers a **`BeforeTool`** hook on `run_shell_command` that calls\n`netrise hook gemini`: the binary inspects the command, transparently rewrites\nsimple installs to run through the firewall, and denies unsafe ones. Same\ndecision engine as the Claude Code plugin — no shell script, no `jq`.\n\n## Prerequisites\n\n1. **`netrise` binary** with **Gemini hook support** (`netrise hook gemini`) on\n   PATH. Download the build for your OS/arch from\n   https://github.com/NetRiseInc/provenance/tree/main/releases, then:\n   ```bash\n   chmod +x netrise\n   sudo mv netrise /usr/local/bin\n\n   # macOS only: clear the Gatekeeper quarantine on the downloaded binary\n   xattr -d com.apple.quarantine /usr/local/bin/netrise\n\n   netrise hook gemini --help   # must succeed — if it errors on `gemini`,\n                                #   your netrise is too old for Gemini support\n   ```\n2. **Credentials in your environment** (the extension ships the hook, not\n   secrets). Put these in your shell profile so Gemini CLI inherits them:\n   ```bash\n   export NETRISE_API_URL=https://provenance.netrise.io\n   export NETRISE_API_KEY=<your key>      # must match the endpoint\n   ```\n\n## Install\n\n```bash\ngemini extensions install git@gitlab.com:netrise/provenance/netrise-firewall-gemini-plugin.git\n```\nRestart Gemini CLI. Confirm the extension is loaded with `gemini extensions list`.\n\nFor local development:\n```bash\ngemini extensions link /path/to/netrise-firewall-gemini-plugin\n```\n\n> `gemini extensions install` accepts a git repo or a local path, so the GitLab\n> SSH URL works (requires GitLab SSH access). Use `gemini extensions link` above\n> for local development.\n\n## Verify\n\nAsk Gemini to run `pip install requests` → it executes as\n`netrise firewall -- pip install requests --no-cache-dir`. A known-bad package\nfails with a `403` + `block: <ID>` footer.\n\n## What the hook does\n\n| command | action |\n|--|--|\n| simple `pip`/`uv`/`npm`/`yarn`/`pnpm`/`cargo` install | rewritten through `netrise firewall` (+ registry flags, cache bypass) |\n| non-install (`ls`, `git`, `pip list`, `cargo build`) | untouched |\n| install only mentioned in a quoted arg | untouched |\n| compound / piped / env-prefixed / sudo install | denied, asks to run standalone |\n| `go` installs | untouched (not covered by netrise yet) |\n\n## How it maps to Gemini's hook protocol\n\n`netrise hook gemini` reads the `BeforeTool` event on stdin (`run_shell_command`'s\n`tool_input.command`) and emits Gemini's decision JSON:\n\n- rewrite → `{\"decision\":\"allow\",\"hookSpecificOutput\":{\"tool_input\":{\"command\":\"…\"}}}`\n- deny → `{\"decision\":\"deny\",\"reason\":\"…\"}`\n- pass-through → `{\"decision\":\"allow\"}`\n\nExits 0 on every decision (Gemini parses stdout as JSON on exit 0).\n",
  "bytes": 2963,
  "sha": "640d547db4c739ad2fa51b20824e4a598d3041b0088296da52276d97117d7092",
  "repo_slug": "netriseinc/netrise-firewall-gemini-extension",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_netriseinc_netrise_firewall_gemini_exten_2b2f157a/readme"
}