Policy · critical
No write outside project
Allowlist containment: block any write whose target path does not resolve under the session project_root. This is strictly stronger than the previous denylist — it covers /tmp, sibling repos, and every other out-of-project path, not just a hardcoded list of sensitive directories, and it applies whether the write comes from the Write/Edit tools or from a Bash shell write (Layer B sets target.host for shell writes too).
The policy
A few lines of YAML in your repository.
Part of Claude Code safety. Assign the pack, or copy this policy into a manifest of your own.
- Verdict
- Critical: the step is blocked before it runs, and an incident is opened.
- Checked
- Before every step, against everything the agent did earlier in the task.
- Rule
- all_of
- name: "No write outside project" description: | Allowlist containment (#239 Layer C): block any write whose target path does not resolve under the session project_root. This is strictly stronger than the previous denylist — it covers /tmp, sibling repos, and every other out-of-project path, not just a hardcoded list of sensitive directories, and it applies whether the write comes from the Write/Edit tools or from a Bash shell write (Layer B sets target.host for shell writes too). Scoped to write operations: step.exec (Bash, which only sets target.host when the command writes) and step.resource POST/PATCH (Write/Edit/ NotebookEdit). Other reads (GET) are not project-contained — they are governed by the secret-read / taint policies above. Containment requires project_root to be known. kyvvu-claude populates it from the session cwd; if it is unknown the rule fails open (allows), since containment is impossible without a root. Known limit: paths are normalized lexically (no filesystem I/O), so '..' is collapsed but symlinks pointing out of the tree are not resolved. The OS read-only mount complements (does not replace) this control. Also keep the governed agent away from kyvvu-claude and its local enforcement state, including Claude Code hook settings. rule_type: all_of params: conditions: - rule_type: path_within_root params: field: properties.target.host target_kinds: ["step.exec", "step.resource"] target_verbs: ["POST", "PATCH", "DELETE"] - rule_type: not params: condition: rule_type: field_matches_regex params: field: properties.command pattern: "(^|[^A-Za-z0-9_-])kyvvu-claude([^A-Za-z0-9_-]|$)|\\.kyvvu-claude/|\\.claude/settings\\.json" - rule_type: not params: condition: rule_type: field_matches_regex params: field: properties.target.host pattern: "(^|/)\\.kyvvu-claude(/|$)|(^|/)\\.claude/settings\\.json$" severity: critical enforcement_point: step_executionWhy it matters
Scoped to write operations: step.exec (Bash, which only sets target.host when the command writes) and step.resource POST/PATCH (Write/Edit/ NotebookEdit). Other reads (GET) are not project-contained — they are governed by the secret-read / taint policies above.
Containment requires project_root to be known. kyvvu-claude populates it from the session cwd; if it is unknown the rule fails open (allows), since containment is impossible without a root.
Known limit: paths are normalized lexically (no filesystem I/O), so '..' is collapsed but symlinks pointing out of the tree are not resolved. The OS read-only mount complements (does not replace) this control. Also keep the governed agent away from kyvvu-claude and its local enforcement state, including Claude Code hook settings.
How the rule works
all_of: Compound rule: passes if and only if all sub-conditions pass.
conditions:[{"rule_type":"path_within_root","params":{"field":"properties.target.host","target_kinds":["step.exec","step.resource"],"target_verbs":["POST","PATCH","DELETE"]}},{"rule_type":"not","params":{"condition":{"rule_type":"field_matches_regex","params":{"field":"properties.command","pattern":"(^|[^A-Za-z0-9_-])kyvvu-claude([^A-Za-z0-9_-]|$)|\\.kyvvu-claude/|\\.claude/settings\\.json"}}}},{"rule_type":"not","params":{"condition":{"rule_type":"field_matches_regex","params":{"field":"properties.target.host","pattern":"(^|/)\\.kyvvu-claude(/|$)|(^|/)\\.claude/settings\\.json$"}}}}]. Sub-conditions, each a dict with rule_type and params.
In these packs
- Claude Code safety, version 1.0.5
From Kyvvu's open policy library at github.com/Kyvvu/manifests, Apache 2.0.
Next
Watch it decide.
In your browser
Try it in the playground
The policy is loaded. Add the steps your agent takes and watch the engine decide, step by step.
On your machine
Five minutes, no account
kyvvu try runs a demo agent against the bundled baseline. Then assign this pack from the dashboard or the CLI.
For security teams
See it on your agents
A 30-minute demo on the agents you actually run, with the policies that fit them.