Overview/Security
The controls that matter are not prompts
Every boundary on this page is a branch in policy.py, not a
sentence in a prompt. It states the trust boundaries, every hard denial,
and what is explicitly out of scope for a report.
Trust boundaries
Six boundaries. Each one has an untrusted side, and a named mechanism that holds it.
| Boundary | Untrusted side | Enforced by |
|---|---|---|
| prompt to agent | the user's text, pasted content | classify.detect_injection, intake rule |
| tool output to agent | file contents, web pages, command output | injection floor in policy.evaluate |
| agent to filesystem | the agent's chosen path | check_path, workspace containment |
| agent to shell | the agent's chosen command | the hard-deny table |
| rule file to dispatcher | a JSON file that may be edited | validate_rule, allowlisted handlers |
| session to session | a previous transcript | redaction before logging |
Hard denials
Matched against the command string before any autonomy band is consulted. These fire at read-only, ask, auto and yolo alike.
| Rule | Catches |
|---|---|
root-delete | rm -rf /, rm -rf ~ |
disk-overwrite | dd of=/dev/sd* |
mkfs | mkfs.* /dev/* |
fork-bomb | the classic recursive shell bomb |
history-rewrite | force-push to a protected branch, git filter-*, git reset --hard, git clean -fdx |
credential-exfil | curl or wget of .ssh/id_*, .aws/credentials, .env |
pipe-to-shell | curl ... | sh |
permission-nuke | chmod -R 777 / |
sudo-anything | any sudo |
git reset --hard is denied rather than asked.
It discards uncommitted work with no recovery path. The right
answer is commit or stash first, not a confirmation dialog the user will
click through.
Protected paths
Writes are denied to a fixed list, and to any path containing a null
byte. With a workspace root set, a write outside it is denied as
workspace-containment.
/etc/passwd /etc/shadow /etc/sudoers ~/.ssh/* ~/.aws/* ~/.config/gh/* **/.git/config /boot/* /dev/sd*
The protected-path check runs before the autonomy band, so a protected path is denied even under yolo. This is the difference between a policy that a configuration change can weaken and one that a configuration change cannot reach.
The injection floor
Content that came from tool output or a fetched page is marked untrusted. An untrusted call that would otherwise be allowed is capped at ask, even under yolo.
if untrusted and verdict.decision is Decision.ALLOW:
return Verdict(Decision.ASK,
"untrusted content cannot escalate privilege",
"injection-floor")
This is what makes "the web page told me to run this" a question rather than an action. A write from untrusted content is capped the same way.
What is defended
- Instruction-like text in the prompt is flagged, and the workflow drops to LIGHT so the agent reads before it acts.
- Untrusted tool output cannot escalate privilege.
- The security-review skill reports embedded instructions rather than following them.
What is not defended
The model's own judgement about ambiguous content. A classifier reduces the attack surface; it does not eliminate the class. Treat the injection floor as a seatbelt, not a guarantee.
Autonomy levels
Four levels, set per session or per project. The hard-deny table and the protected-path table sit above all four.
| Level | Read tools | Safe mutations | Destructive | File writes |
|---|---|---|---|---|
read-only | allow | ask | deny | deny |
ask | allow | ask | deny | ask |
auto | allow | allow | deny | allow |
yolo | allow | allow | deny | allow |
Read-only denies writes outright rather than asking, because ask implies yes is a valid answer, and one approval would negotiate the level away. Unknown tools are treated as mutating.
Secret handling
The redactor recognises OpenAI, Anthropic, GitHub, AWS, Slack, Stripe,
Google and npm credentials, JWT tokens, PEM private key blocks, and
generic password= or token: assignments. It
returns both the redacted text and the kinds it found, so a caller can
log that a secret was present without logging the secret.
It runs in two places, not just the CLI. Every state and event-log
write is redacted before it reaches disk, and a policy verdict carries
redacted_args whenever the call's arguments held a
credential, so an approval prompt or a log line shows the command
without the secret.
$ zyrompts redact < output.log
{
"text": "token: [REDACTED]\n",
"kinds": [
"github_token"
]
}
The rule for agents: never paste a real credential into a report, a commit or a prompt. Redact it, then name the location.
The hook dispatcher as an attack surface
A hook runs with the user's privileges on every prompt, so its input is hostile by assumption. Four properties keep a rule file to data.
action or handler.
importlib, no getattr on a dotted path, no eval.
In and out of scope
The attack surface is specific, so the report scope is explicit.
In scope
- A tool call that bypasses a hard denial, for example a destructive command allowed under yolo.
- A write that escapes the workspace root or reaches a protected path.
- A way for untrusted tool output to escalate past the injection floor.
- A rule that can execute arbitrary code through the rule file.
- A redaction bypass in a common credential format.
- A crash in the dispatcher that blocks a user's prompt.
Out of scope
- A prompt that persuades a model to misbehave. That is the model's judgement.
- Findings that require write access to the rules directory or the source. At that point the attacker is the operator.
- Denial of service through deliberately enormous input.
- Anything in
adapters/, which is generated build output.
Reporting a vulnerability
Report privately, not in a public issue. Use GitHub's private vulnerability reporting on the repository, under Security then Report a vulnerability.
Include the version, the configuration, the exact steps to reproduce and the impact you believe it has. Do not include real credentials. If a credential is part of the finding, say where it is and redact its value.
| Stage | Target |
|---|---|
| Acknowledge | 3 working days |
| Triage and severity | 7 working days |
| Fix for a reachable issue in a default configuration | 30 days |
| Public disclosure | coordinated, after the fix ships |
Operator checklist
- Run with
--autonomy askorread-onlyunless you have a reason not to. - Set a workspace root so containment is enforced.
- Run
zyrompts healthandzyrompts validateafter any rule change. - Treat a rule file as code, and review it before installing it.
- Keep the Python runtime patched. The core has no third-party dependencies, so the interpreter is the dependency.
Read the source behind this page
core/zyrompts/policy.py is the whole enforcement layer, and the policy eval suite pins each rule.