Skip to content
BENIBIX Learn

PermissionResult

Also known as PermissionResultAllow, PermissionResultDeny, Claude Agent SDK PermissionResult

What your code says back for each tool call. It is yes or no.

Think of it like

It is like a guard at a gate. The guard says go in, or says stop.

Example

An agent tries to delete a folder. The callback says no and gives a reason, so Claude picks another way.

Why it matters

The message on a deny steers Claude. A clear reason helps it pick a better next step.

Definition

PermissionResult is the answer your approval callback gives for each tool call. It says allow or deny. An allow can carry a changed input, so the tool runs with safer values. It can also add new permission rules. A deny carries a message that tells Claude why, and it can set interrupt to stop the whole run. Python has one class for each of the two answers.

Example code

typescript
return { behavior: "deny", message: "Deleting is not allowed here" };
Say no, and tell Claude why.
Allow lets the tool run, maybe with a safer input. Deny tells Claude why.

Common mistake

Returning deny with no useful message. Claude then guesses why and may try the same thing again.

Key takeaways

  1. 1
    Allow or deny. The behavior field.
  2. 2
    Allow can change input. updatedInput.
  3. 3
    Deny can stop the run. interrupt: true.