🧩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
Example code
typescript
return { behavior: "deny", message: "Deleting is not allowed here" };Common mistake
Key takeaways
- 1Allow or deny. The behavior field.
- 2Allow can change input. updatedInput.
- 3Deny can stop the run. interrupt: true.