Topic 3 of 5 · 5 min read
Auto-approve modes and over-broad allow-lists
Goal: Review a coding agent's permission allow-list and remove entries that let it run arbitrary code or send data out.
An allow-list entry is only as safe as the worst thing the allowed command can do, so any entry that runs arbitrary code is the same as approving everything. Permission prompts are the human gate in a coding agent. Skip-permission modes and broad allow rules remove that gate.
Check yourself · 1 of 3
Which allow-list entry is the broadest risk?
Why it matters
Approval fatigue is real. After the fiftieth prompt, people click through or switch on a mode that skips all prompts. Then a poisoned issue or a bad dependency reaches a shell with no one watching. Allow-lists are the sensible middle path, but only if each entry is narrow.
Entries that look safe but are not
- Bare shell runners.
bash,sh,python,nodeornpxwith any argument can run anything. - Network tools.
curlandwgetcan fetch a script or send a file to any host. - Package installs.
npm installorpip installruns install scripts from whoever published the package. - Wildcards on commands. A rule such as
git *also coversgit confighooks andgit pushto any remote. - Editors and find. Tools that can execute through options, such as
find -exec, defeat a narrow-looking rule.
How to review a list
- Ask of each entry: "If the agent were fully steered by an attacker, what is the worst this allows?"
- Prefer exact commands. Allow
npm run test, notnpm run *. - Deny what should never run. Deny rules for reading
.env, SSH keys and cloud credential files, and for network tools, beat any allow. - Keep skip-permission modes for sandboxes only. Use them in a throwaway container with no secrets and no network, never on your laptop with your keys.
- Keep the list in version control and review changes to it.
Before and after
Weak:
{
"permissions": {
"allow": ["Bash(curl:*)", "Bash(python:*)", "Bash(npm run *)", "Bash(git *)"]
}
}
Fixed:
{
"permissions": {
"allow": ["Bash(npm run test)", "Bash(npm run lint)", "Bash(git diff:*)", "Bash(git status)"],
"deny": ["Bash(curl:*)", "Bash(wget:*)", "Read(./.env)", "Read(~/.ssh/**)"]
}
}
What goes wrong
- Allow once, forever. A rule added during one task stays after the task is done.
- Shared settings file. A project settings file in the repo can widen permissions for everyone who opens it.
- False comfort. Listing a command by name does not limit its arguments.
Examples
The convenient rule
A developer adds Bash(python:*) so the agent can run a script. Now any steered agent can run python -c with any code, including one that reads ~/.aws/credentials. The safer entry is the exact script: Bash(python scripts/check.py).
Skip mode on a laptop
A team member runs the agent with all prompts skipped on their own machine, with cloud keys in the environment. An injected README line makes the agent upload .env. No prompt ever appeared. The same mode in a container with no keys and no network would have made the attack useless.
Key points
- Every allow entry should be judged by the worst thing the allowed command can do when the agent is steered.
- Shell, interpreter, curl, wget and package installs run or fetch arbitrary code and defeat a narrow-looking list.
- Prefer exact commands over wildcards, and add deny rules for secrets and network tools.
- Skip-permission modes belong only in a disposable sandbox with no secrets and no network.
- Keep the permission file in version control and review changes to it like code.
Common mistakes
- Allowing a bare interpreter such as bash, python or node to save prompts.
- Using skip-permission mode outside a throwaway sandbox.
- Leaving old allow rules in place after a task ends.
- Allowing curl or wget without limiting hosts, so data can leave freely.
Check yourself · 2 of 3
When is a skip-all-permissions mode acceptable?
Check yourself · 3 of 3
What is a safer way to let an agent run tests?
Practice items, not counted towards your mastery.
Start here
- Security (Claude Code) (opens in a new tab)DocsFree
How a vendor describes permissions, prompt-injection safeguards and trust prompts for a coding agent.
- Configure permissions (Claude Code) (opens in a new tab)DocsFree
How allow, ask and deny rules work, and why broad rules widen what the agent can run.
- Pillar Security: Rules File Backdoor in GitHub Copilot and Cursor (opens in a new tab)ArticleFree
A worked attack using hidden Unicode in rules files to steer code assistants.
More for this topic
- OWASP AI Agent Security Cheat Sheet (opens in a new tab)ArticleFree
Practical controls for agent tools, permissions, human approval and monitoring.