Keep agents out of one folder
Refuses every read and write of a folder named company-secrets, at any depth, however the path is spelled. Rename it to your folder, one line per folder, ending in /. It also carries the lines that protect Isonapse's own files.
Works with: All four agents. On Codex and Hermes Agent these rules refuse a relative path, so the agent must use absolute paths. Supported hosts has the detail for each agent.
Steps
1. Apply it
isonapse hook policy apply folder-denyIt 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 --read company-secrets/plan.txtNothing 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
- It checks the files a command visibly names; it is not operating-system confinement.
- With a read rule, Normal and Enforce also refuse a command that runs code whose reads Isonapse cannot name, such as
pythonornode. Profile records what it would refuse. - Pi's
grep,findandlssearch roots followtool:Readfolder rules, including relative paths and symlinks;grepandfindpath globs are checked too. Normal and Enforce refuse a covered or uncheckable read; Profile reports what it would refuse. Codex'swrite_stdinis not checked. - Unknown programs, changes after an action was approved and hard links that already exist outside the folder are not covered. Confining the agent's host is the durable boundary.
The policy
The whole starter policy, exactly as isonapse hook policy apply folder-deny writes it.
-- folder-deny — keep agents out of one folder.
--
-- Denies every read and every write of a folder named `company-secrets` at
-- any depth (at the repository root, deeper in it, or outside any
-- repository; no working directory or `.git` entry changes that): the folder
-- itself and every file below it, however the path is spelled (relative,
-- absolute, `..`, another letter case, or a symbolic link into it). A
-- repository inside a folder of that name is covered as a whole, so pick a
-- distinctive name. Rename the folder to yours; add one line per folder,
-- ending in `/`. An absolute folder is `/srv/company-secrets/`.
--
-- Covered reads: Read, NotebookRead, Grep/Glob roots (cwd without a path),
-- their path globs, native image paths and visible shell read operands,
-- redirects and copy sources. Unknown reads, including opaque interpreters,
-- sed programs, sourced programs and searches beyond the bounded metadata
-- walk, are refused in Normal/Enforce; Profile records would-deny. Relative
-- Codex reads have no known tool folder, so use absolute paths.
-- Covered writes: Write, Edit, MultiEdit, NotebookEdit, Codex apply_patch and
-- the file writes Isonapse reads in a shell command, including moving or
-- hard-linking covered sources. A tool PERMIT does not lift a file rule.
-- These checks predict visible input. They do not cover Codex write_stdin,
-- arbitrary programs, changes after authorization or a pre-existing hard
-- link outside the folder. Host confinement remains the durable boundary.
-- Also carries the hardened self-protection lines.
return {
blocked_file_patterns = {
["tool:Edit"] = {"company-secrets/", "**/isonapse*", "**/managed-settings*"},
["tool:Read"] = {"company-secrets/"},
["tool:Write"] = {"company-secrets/", "**/isonapse*", "**/managed-settings*"},
},
}
Stuck? Help finds the message you see.