Block writes to production settings and credentials while you build web apps
Blocks writes and edits to .env.production, credentials.json and Isonapse's own files, refuses MCP tools named deleteDatabase, limits how often shell commands run, and asks before publishing a package or running a download-and-run launcher such as npx.
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. Apply it
isonapse hook policy apply web-devIt 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. Ask what each mode would do
isonapse hook policy test --write .env.productionNothing runs, and no record is written. It prints one line per mode, with the reason; here Normal and Enforce refuse it.
3. Undo it
isonapse hook policy revisionsisonapse 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.
- It also blocks web fetches to an example internal domain. Replace that domain and the MCP tool name with yours.
- These example site rules name Claude Code's
WebFetch. To cover Hermes Agent'sweb_extract, add separate site rules fortool:web_extract;WebFetchrules do not carry over. Hermesweb_extracttakes 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. Atool:WebFetchblocked-site rule can also refuse a blocked host visibly named by shellcurl; its allowed-site list does not limit shell commands. These checks do not confine network traffic. - The
llmandcoherencelines do not limit what a coding agent spends on its own model.
The policy
The whole starter policy, exactly as isonapse hook policy apply web-dev writes it.
-- web-dev — Node.js / git / docker / npm workflows.
--
-- Rate-limits shell use, blocks writes to production env + credential
-- files (and Isonapse's own runtime), denies production database
-- deletion through MCP, and caps per-task LLM spend. A starting point:
-- copy to your policy_path and edit. Self-protection patterns
-- (**/isonapse*, **/managed-settings*) keep the agent from overwriting
-- the control plane — keep them unless you know what you're doing.
return {
rate_limits = {
["tool:Bash"] = { per_minute = 30, per_hour = 200 },
},
blocked_domains = {
["tool:WebFetch"] = {"*.internal.company.com"},
},
blocked_file_patterns = {
["tool:Edit"] = {"**/.env.production", "**/credentials.json", "**/isonapse*", "**/managed-settings*"},
["tool:Write"] = {"**/.env.production", "**/credentials.json", "**/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:*:deleteDatabase"] = {
decision = "DENY",
reason = "production database deletion blocked",
},
},
llm = {
allowed_models = {"claude-*", "gpt-4o*"},
budget_per_task_usd = 5.0,
},
coherence = {
{
type = "scalar_baseline",
metric = "spend_usd_per_min",
baseline = 0.1,
tolerance = 3.0,
weight = 1.0,
direction = "above",
hard_cap = false,
},
},
}
Stuck? Help finds the message you see.