ToolPermissionContext
🛈 DocStrings¶
Context information for tool permission callbacks.
Source code in src/clawd_code_sdk/models/permissions.py
agent_id
class-attribute
instance-attribute
¶
The agent that initiated the tool call, if in a multi-agent setup.
blocked_path
class-attribute
instance-attribute
¶
The file path that triggered the permission request, if applicable.
For example, when a Bash command tries to access a path outside allowed directories.
decision_reason
class-attribute
instance-attribute
¶
Why the CLI triggered the permission check.
description
class-attribute
instance-attribute
¶
Human-readable subtitle from the bridge.
E.g. "Claude will have read and write access to files in ~/Downloads".
display_name
class-attribute
instance-attribute
¶
Short noun phrase for the tool action (e.g. "Read file").
Suitable for button labels or compact UI.
input
class-attribute
instance-attribute
¶
The input to the tool that generated this permission request.
suggestions
class-attribute
instance-attribute
¶
Permission suggestions from CLI for updating permissions.
So the user won't be prompted again for this tool during this session.
title
class-attribute
instance-attribute
¶
Full permission prompt sentence rendered by the bridge.
E.g. "Claude wants to read foo.txt". Use this as the primary prompt text when present instead of reconstructing from toolName+input.
tool_name
class-attribute
instance-attribute
¶
The name of the tool that generated this permission request.
tool_use_id
instance-attribute
¶
Unique identifier for this specific tool call within the assistant message.
Multiple tool calls in the same assistant message will have different tool_use_ids.
from_permission_request
classmethod
¶
from_permission_request(req: SDKControlPermissionRequest) -> Self
Create a PermissionContext from a permission request.