Block writes to secrets and refuse destructive database tools while you work with data
Blocks writes and edits to .env files, credential files, *.pem keys and Isonapse's own files, refuses MCP tools named dropDatabase and truncateTable, limits how often shell commands run, 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. Apply it
isonapse hook policy apply data-scienceIt 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 .envNothing 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 refuses those two MCP tools by name. SQL run another way, such as in the shell, is not covered.
- 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 data-science writes it.
-- data-science — Python / Jupyter / SQL workflows.
--
-- Blocks writes to secrets (.env, credentials, *.pem) and Isonapse's
-- own runtime, denies destructive SQL (drop / truncate) through MCP,
-- and caps per-task LLM spend. A starting point: copy to your
-- policy_path and edit.
return {
rate_limits = {
["tool:Bash"] = { per_minute = 40, per_hour = 300 },
},
blocked_file_patterns = {
["tool:Edit"] = {"**/.env", "**/credentials*", "**/*.pem", "**/isonapse*", "**/managed-settings*"},
["tool:Write"] = {"**/.env", "**/credentials*", "**/*.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:*:dropDatabase"] = {
decision = "DENY",
reason = "database drop blocked",
},
["tool:mcp:*:truncateTable"] = {
decision = "DENY",
reason = "table truncation blocked",
},
},
llm = {
allowed_models = {"claude-*", "gpt-4o*"},
budget_per_task_usd = 10.0,
},
coherence = {
{
type = "scalar_baseline",
metric = "spend_usd_per_min",
baseline = 0.15,
tolerance = 3.0,
weight = 1.0,
direction = "above",
hard_cap = false,
},
},
}
Stuck? Help finds the message you see.