Tool allowlist
A tool allowlist is the explicit set of commands / APIs / files an agent is allowed to use — deny-by-default permission policy preventing the agent from invoking surprise tools. Claude Code's settings.json, Cursor allowlist, MCP server scoping are 2026 implementations.
Example input
settings.json allowlist: Read:docs/** + Bash:git status auto-approve; git push + Write:src/** require approval
In more detail
What it means
Tool allowlists invert the default: instead of 'allow everything unless flagged unsafe', the agent can only do what's been explicitly permitted. Implementations: per-tool name (`Bash:git status` allowed, `Bash:rm -rf` denied — Claude Code's pattern), per-host network policy (only fetch from allowed.example.com), per-MCP-server scope (this server can read only `/docs`). Production patterns: start narrow (just reads + safe tools — e.g., settings.json `Bash:git status` / `Read:docs/**` auto-approve, `git push` / `Write:src/**` require approval), broaden as the agent proves itself; use stricter allowlists for autonomous / background agents (background GitHub triage that only reads), looser for interactive plan-approval flows. Example: support agent allowed `searchDocs`, `createTicket`, denied direct DB writes — a deny is audited with reason. Least privilege via MCP server scoping is the cleanest long-term model. Allowlists are the simplest + most auditable agent safety mechanism — explicit policy beats implicit trust.
Part 1 of 3
When to use it, and when not
Use it for
- Any production agent.
- Especially autonomous / background agents.
- Background GitHub triage agents that should only read issues and open PRs, never push.
- Support agents allowed searchDocs/createTicket but not direct DB writes.
- Browser agents where fetch must stay inside an allowlisted domain set.
Skip it for
- Early prototype where velocity outweighs least-privilege — add the allowlist before production.
- Disposable sandbox runs with no persistent state or credentials.
Part 2 of 3
Example
What goes in, and what comes out.
Input
settings.json allowlist: Read:docs/** + Bash:git status auto-approve; git push + Write:src/** require approval
Output
Agent reads docs and checks status freely, but a push or src write triggers a gate — every deny is logged with reason for audit.
Avoid substring wildcards like `Bash:git*` — they match `git config --global` and `git push --force` equally; enumerate exactly.
Part 3 of 3
Common mistakes
- Wildcards that match dangerous commands (`Bash:*` allows `rm -rf`).
- Forgetting to allowlist tools the agent legitimately needs — broken UX.
- Substring `Bash:git*` matching `git push --force` — enumerate exact commands instead.
FAQ
Questions readers ask.
What is tool allowlist?
A tool allowlist is the explicit set of commands / APIs / files an agent is allowed to use — deny-by-default permission policy preventing the agent from invoking surprise tools. Claude Code's settings.json, Cursor allowlist, MCP server scoping are 2026 implementations.
Allowlist vs denylist — which for production?
Allowlist (deny-by-default) — denylists miss the tool you forgot to block; allowlists only permit what you explicitly reviewed.
How granular should an allowlist be?
Per-tool and per-command (Bash:git status vs Bash:git push) plus per-path (Read:docs/**) and per-host for network — coarser is faster to write, finer is safer to audit.
Can allowlists contain prompt injection?
Partially — they limit blast radius, but a tool output can still inject instructions that the agent follows within its allowed tools. Pair with output validation and human gates.
When should you use tool allowlist?
Any production agent. Especially autonomous / background agents. Background GitHub triage agents that should only read issues and open PRs, never push. Support agents allowed searchDocs/createTicket but not direct DB writes. Browser agents where fetch must stay inside an allowlisted domain set.
When should you not use tool allowlist?
Early prototype where velocity outweighs least-privilege — add the allowlist before production. Disposable sandbox runs with no persistent state or credentials.
What are the common mistakes with tool allowlist?
Wildcards that match dangerous commands (`Bash:*` allows `rm -rf`). Forgetting to allowlist tools the agent legitimately needs — broken UX. Substring `Bash:git*` matching `git push --force` — enumerate exact commands instead.
Last updated: 2026-09-15. Raw markdown: https://promtable.com/glossary/tool-allowlist.md. Found a mistake? Tell us.