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, enforcement
BoundaryUntrusted sideEnforced by
prompt to agentthe user's text, pasted contentclassify.detect_injection, intake rule
tool output to agentfile contents, web pages, command outputinjection floor in policy.evaluate
agent to filesystemthe agent's chosen pathcheck_path, workspace containment
agent to shellthe agent's chosen commandthe hard-deny table
rule file to dispatchera JSON file that may be editedvalidate_rule, allowlisted handlers
session to sessiona previous transcriptredaction 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.

hard-deny rule names, nine categories
RuleCatches
root-deleterm -rf /, rm -rf ~
disk-overwritedd of=/dev/sd*
mkfsmkfs.* /dev/*
fork-bombthe classic recursive shell bomb
history-rewriteforce-push to a protected branch, git filter-*, git reset --hard, git clean -fdx
credential-exfilcurl or wget of .ssh/id_*, .aws/credentials, .env
pipe-to-shellcurl ... | sh
permission-nukechmod -R 777 /
sudo-anythingany sudo
Why 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.

policy.Autonomy
LevelRead toolsSafe mutationsDestructiveFile writes
read-onlyallowaskdenydeny
askallowaskdenyask
autoallowallowdenyallow
yoloallowallowdenyallow

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
$ 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.

rules are data Validation checks the event against the capability matrix, the action type against the event's capability set, and that the rule has exactly one of action or handler.
handlers are names Handlers and matchers are dictionaries of functions. A rule can only name one that already exists. No importlib, no getattr on a dotted path, no eval.
regexes compile defensively A bad pattern is a validation error, not a traceback at prompt time.
every path exits 0 A crash would block the prompt. Silence does not.

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.

Response targets
StageTarget
Acknowledge3 working days
Triage and severity7 working days
Fix for a reachable issue in a default configuration30 days
Public disclosurecoordinated, after the fix ships

Operator checklist

  • Run with --autonomy ask or read-only unless you have a reason not to.
  • Set a workspace root so containment is enforced.
  • Run zyrompts health and zyrompts validate after 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.