Skip to content
BENIBIX Learn

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

disallowedTools is an Agent SDK option that blocks tools. In Python it is disallowed_tools. A bare name, such as Bash, takes the tool away from Claude. A scoped rule, such as Bash(rm *), keeps the tool but blocks the calls that match. A block holds in every permission mode, even bypassPermissions, and even when a hook said yes.

Example code

typescript
disallowedTools: ["WebFetch", "Bash(rm *)"]
No web fetches, and no rm commands.

Common mistake

Leaving a tool off allowedTools and thinking that blocks it. Only this option blocks.

Key takeaways

  1. 1
    Blocks in every mode. Even bypass.
  2. 2
    Bare name removes it. From Claude.
  3. 3
    Scoped rule blocks calls. Bash(rm *).

Compare