permissions
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| BasePermissionUpdate clawd_code_sdk.models.permissions Permission update configuration. |
||
| DirectoryPermissionUpdate clawd_code_sdk.models.permissions Permission update configuration. |
||
| ModePermissionUpdate clawd_code_sdk.models.permissions Permission update configuration. |
||
| PermissionResultAllow clawd_code_sdk.models.permissions Allow permission result. |
||
| PermissionResultDeny clawd_code_sdk.models.permissions Deny permission result. |
||
| PermissionRuleValue clawd_code_sdk.models.permissions Permission rule value. |
||
| RulePermissionUpdate clawd_code_sdk.models.permissions Permission update configuration. |
||
| ToolPermissionContext clawd_code_sdk.models.permissions Context information for tool permission callbacks. |
🛈 DocStrings¶
Permission system types.
OnUserQuestion
module-attribute
¶
OnUserQuestion = Callable[
[AskUserQuestionInput, ToolPermissionContext], Awaitable[PermissionResult]
]
Callback for handling AskUserQuestion elicitation requests.
Called when Claude asks the user a clarifying question. The callback should return a PermissionResultAllow with updated_input containing the answers, or a PermissionResultDeny to cancel.
BasePermissionUpdate
¶
Bases: ClaudeCodeBaseModel
Permission update configuration.
Source code in src/clawd_code_sdk/models/permissions.py
DirectoryPermissionUpdate
¶
Bases: BasePermissionUpdate
Permission update configuration.
Source code in src/clawd_code_sdk/models/permissions.py
ModePermissionUpdate
¶
PermissionResultAllow
¶
Bases: ClaudeCodeBaseModel
Allow permission result.
Source code in src/clawd_code_sdk/models/permissions.py
PermissionResultDeny
¶
Bases: ClaudeCodeBaseModel
Deny permission result.
Source code in src/clawd_code_sdk/models/permissions.py
PermissionRuleValue
¶
RulePermissionUpdate
¶
Bases: BasePermissionUpdate
Permission update configuration.
behavior is required: Claude Code rejects a rule update without it and
then ignores every update in the same response (upstream #1502). A rule
with rule_content=None applies to the whole tool and is sent without a
ruleContent key.
Source code in src/clawd_code_sdk/models/permissions.py
ToolPermissionContext
dataclass
¶
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.