
Show HN 发布 Permission Slips:编码代理的高风险操作只能由人类手写提示授权
来源标题:Show HN: Permission Slips: only your prompt can issue coding-agent grants
开发者发布 Permission Slips 项目,让编码代理的高风险操作只能由人类手写提示授权,代理无法自签。该项目借鉴 sudo 和能力令牌机制,由模型外的钩子在工具调用前校验许可是否满足条件。
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
permission slip noun A permission slip grants one risky agent action that only a prompt the human types can issue. It names what the action permits, ends on a defined condition, and a hook outside the model checks it before the tool call runs.
An agent can't sign its own permission slip.
The idea comes from sudo, break-glass access and capability tokens. The repo's shape, an essay with working code beside it, comes from 12-Factor Agents by HumanLayer. (sudo, 12-Factor Agents)
Coding agents now run deploys, apply database migrations, publish packages, spend money on ad platforms and start many subagents at once. Most of those actions should happen only after you approve them and only for the thing you named.
Writing "never deploy without asking" in the prompt does not enforce the rule. The model treats it as context. A long task, a summarised history or a confident plan can outweigh it, and the agent that broke the rule also decides whether it followed the rule.
Approving every tool call does not enforce the boundary. After the fortieth prompt, you approve without reading, and the call that matters looks like the others.
How do you give an agent permission for one dangerous thing, for one stretch of work, in a form it cannot forge?
Two hooks share a small ledger. The issue hook reads each prompt you submit and records any slip you typed. The check hook runs before every tool call, matches the call against your rules, and denies a guarded call that holds no valid slip. The model never writes the ledger. It sees only a line saying what was issued or why a call was denied.
sequenceDiagram actor Human participant Issue as slip.py issue<br/>(UserPromptSubmit) participant Ledger as Ledger<br/>(per session, locked) participant Agent participant Check as slip.py check<br/>(PreToolUse) participant Tool
Human->>Issue: prompt: fix the login bug, then /slip deploy api Issue->>Ledger: record deploy (api), until-spent Issue-->>Agent: Permission slip issued by the user: deploy (api) Agent->>Check: Bash ./scripts/deploy.sh api Check->>Ledger: valid deploy slip for api? Ledger-->>Check: yes Check->>Tool: allow Agent->>Check: Bash ./scripts/deploy.sh billing Check->>Ledger: valid deploy slip for billing? Ledger-->>Check: no Check-->>Agent: deny, with the command to ask for
Loading
The four rules
The pattern has four rules. Each rule has its own page with the incident behind it and the code that enforces it.
Install the plugin in Claude Code. For Codex, see the Codex setup guide. (Codex, Claude Code)
/plugin marketplace add kyisaiah47/permission-slips /plugin install permission-slips@permission-slips
Write a policy. A slip kind says how long a slip lasts. A rule says which tool calls need one. This policy guards a deploy script and takes the target from the command line:
// ~/.config/permission-slips/config.json (or .permission-slips.json in a project) { "slips": { "deploy": { "lifetime": "until-spent", "needs_target": true, "aliases": ["force-deploy"] } }, "rules": [ { "name": "production deploy", "tool": "^(Bash|exec_command)$", "pattern": "scripts/deploy\.sh\s+(?P<target>[A-Za-z0-9_.-]+)", "slip": "deploy" } ] }
Now type the slip anywhere in a prompt:
fix the login bug, then /slip deploy api
The issue hook adds one line to the agent's context:
Permission slip issued by the user: deploy (api), good until it is spent.
The slip covers api and nothing else. If the agent tries another target, the check hook denies the call and tells it what to ask for:
production deploy needs a permission slip. Only the user can issue one, by typing: /slip deploy billing
An until-spent slip lasts through failed builds and retries. Your own deploy script ends it once the deploy has been verified live:
./scripts/deploy.sh "$target" curl -fsS "https://$target.example.com/health" >/dev/null python3 ~/.permission-slips/slip.py spend deploy "$target"
The fuller example policy is in slips/config.example.json.
These are the slips I run every day. Each one exists because something went wrong without it.
The incidents and their details are in How I use them. (docs/05)
The same two hooks cover more than deploys. Each row is a rule plus a slip kind.
Simon Willison's lethal trifecta says an agent with private data, untrusted input and a way to communicate externally can be made to leak. Removing outbound access closes one leg. An egress slip reopens that leg for one named host, for one session, when you decide it is needed. (the lethal trifecta)
Config sketches for each row are in Slips you could write. (docs/06)
Allowlists and permission modes. Allowlists and permission modes are standing policy. They say what an agent may always do in a project. A permission slip is a one-time exception to that policy that you issue for a stretch of work and that ends on its own.
Bypass mode. Bypass mode removes every check for the whole session. A slip lifts one check for one named target until a defined end. Everything else stays guarded.
Approval prompts the agent triggers. An approval prompt the agent triggers asks you to judge a call the agent chose to show you, worded the way the agent chose. A slip comes from you first. You type what you want permitted before the agent acts, and the guard holds the agent to it.
Using slips with an allowlist Slips and allowlists work well together. Keep the allowlist strict, then use slips for the few actions you want gated by intent rather than by command. A slip also leaves a record: the ledger shows what was issued, in which prompt, and whether it was spent.
This is a guard against an agent drifting past your intent, not a sandbox against a hostile one. The full threat model is in its own page. (threat model)
The same author has other skill repos for Codex and Claude Code:
This repo draws on sudo and its timestamp, break-glass emergency access, capability tokens and object-capability security, the hooks systems in Claude Code and Codex that make an outside guard possible, Simon Willison's writing on the lethal trifecta, and 12-Factor Agents for showing that a set of principles can live in a repo.
Copyright 2026 Isaiah Kim. Released under the skills license in LICENSE: you may install, use and privately adapt it. See LICENSE. Isaiah Kim (kyisaiah47). LICENSE · PRIVACY.md
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。
