🧩disallowedTools Option
Also known as disallowedTools, disallowed_tools, Agent SDK blocked tools, Claude Agent SDK disallowedTools
The option that blocks a tool, or some uses of it, in all modes.
Think of it like
It is like a lock on the cupboard with the knives in it.
Example
Mia's agent must never reach the web. She puts WebFetch and WebSearch in disallowedTools.
Why it matters
Some things must never happen, whatever mode the agent is in.
Definition
Example code
typescript
disallowedTools: ["WebFetch", "Bash(rm *)"]Common mistake
Key takeaways
- 1Blocks in every mode. Even bypass.
- 2Bare name removes it. From Claude.
- 3Scoped rule blocks calls. Bash(rm *).