Skip to content
Isonapse
Install

Block writes to cluster credentials and refuse destructive production tools

Blocks writes and edits to kubeconfig files, Terraform state, *.pem files and Isonapse's own files; refuses MCP tools named deleteCluster and destroyStack; blocks web fetches to production hosts such as *.prod.internal; limits shell use; and asks before publishing a package or running a download-and-run launcher.

Works with: All four agents. On Codex and Hermes Agent an ask is a refusal. Whether the rules on MCP tools apply depends on the agent. Supported hosts has the detail for each agent.

Steps

  1. 1. Apply it

    isonapse hook policy apply infra

    It asks for the password you log in to this computer with and replaces your whole policy. The old one is backed up first, and the command prints where.

  2. 2. Ask what each mode would do

    isonapse hook policy test --write terraform.tfstate

    Nothing runs, and no record is written. It prints one line per mode, with the reason; here Normal and Enforce refuse it.

  3. 3. Undo it

    isonapse hook policy revisions
    isonapse hook policy rollback <revision>

    The first lists earlier policies; the second restores one, with one approval and the password you log in to this computer with. Use a plain terminal window that runs no agent, such as macOS Terminal or Ghostty.

What it does not do

  • Applying it replaces your whole policy. It is a starting point: edit it for your work, and keep the lines that protect Isonapse's own files.
  • It does not stop the agent reading these files, or running kubectl or terraform in the shell, which is only rate-limited.
  • Replace the example production hosts and MCP tool names with yours.
  • These example site rules name Claude Code's WebFetch. To cover Hermes Agent's web_extract, add separate site rules for tool:web_extract; WebFetch rules do not carry over. Hermes web_extract takes one valid HTTP(S) URL per call. A batch, even for one site, or an empty or uninspectable URL list is refused in Normal and Enforce; Profile reports what it would refuse. Send one URL per call. A tool:WebFetch blocked-site rule can also refuse a blocked host visibly named by shell curl; its allowed-site list does not limit shell commands. These checks do not confine network traffic.
  • The llm and coherence lines do not limit what a coding agent spends on its own model.

The policy

The whole starter policy, exactly as isonapse hook policy apply infra writes it.

-- infra — kubectl / terraform / aws / docker workflows.
--
-- Blocks writes to cluster/state credentials (kubeconfig, tfstate,
-- *.pem) and Isonapse's own runtime, denies production destructive ops
-- (cluster delete / stack destroy) through MCP, blocks fetches to prod
-- hosts, and keeps a tight LLM budget. A starting point: copy to your
-- policy_path and edit.
--
-- Note: tool:Edit intentionally omits **/*.pem (present under
-- tool:Write) — editing an existing cert in place is treated
-- differently from creating one; mirror the pre-migration JSON shape.
return {
  rate_limits = {
    ["tool:Bash"] = { per_minute = 20, per_hour = 150 },
  },
  blocked_domains = {
    ["tool:WebFetch"] = {"*.prod.internal", "*.production.*"},
  },
  blocked_file_patterns = {
    ["tool:Edit"] = {"**/kubeconfig", "**/.kube/config", "**/terraform.tfstate", "**/isonapse*", "**/managed-settings*"},
    ["tool:Write"] = {"**/kubeconfig", "**/.kube/config", "**/terraform.tfstate", "**/*.pem", "**/isonapse*", "**/managed-settings*"},
  },
  actions = {
    ["tool:Bash:bunx"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
      defer_unless_local_bin = true,
    },
    ["tool:Bash:cargo:publish"] = {
      decision = "DEFER",
      reason = "publishing a crate is irreversible; confirm it first",
    },
    ["tool:Bash:npm:exec"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
      defer_unless_local_bin = true,
    },
    ["tool:Bash:npm:publish"] = {
      decision = "DEFER",
      reason = "publishing a package is irreversible; confirm it first",
    },
    ["tool:Bash:npx"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
      defer_unless_local_bin = true,
    },
    ["tool:Bash:pipx:run"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
    },
    ["tool:Bash:pnpm:dlx"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
    },
    ["tool:Bash:uv:tool-run"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
    },
    ["tool:Bash:uvx"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
    },
    ["tool:Bash:yarn:dlx"] = {
      decision = "DEFER",
      reason = "Download-and-run launcher requires operator approval.",
    },
    ["tool:mcp:*:deleteCluster"] = {
      decision = "DENY",
      reason = "cluster deletion blocked",
    },
    ["tool:mcp:*:destroyStack"] = {
      decision = "DENY",
      reason = "stack destruction blocked",
    },
  },
  llm = {
    allowed_models = {"claude-*"},
    budget_per_task_usd = 3.0,
  },
  coherence = {
    {
      type = "scalar_baseline",
      metric = "spend_usd_per_min",
      baseline = 0.05,
      tolerance = 3.0,
      weight = 1.0,
      direction = "above",
      hard_cap = false,
    },
  },
}

Stuck? Help finds the message you see.