Skip to content

SDKControlPermissionRequest

Base classes

Name Children Inherits
_ControlBase
clawd_code_sdk.models.control
Frozen base for all SDK control request models.

⋔ Inheritance diagram

graph TD
  3066219760["control.SDKControlPermissionRequest"]
  1268774935["control._ControlBase"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  1268774935 --> 3066219760
  3879467795 --> 1268774935
  2751680898 --> 3879467795

🛈 DocStrings

Bases: _ControlBase

SDK control permission request.

Source code in src/clawd_code_sdk/models/control.py
class SDKControlPermissionRequest(_ControlBase):
    """SDK control permission request."""

    subtype: Literal["can_use_tool"] = "can_use_tool"
    tool_name: str
    input: dict[str, Any]
    permission_suggestions: list[PermissionUpdate] | None = None
    blocked_path: str | None = None
    decision_reason: str | None = None
    title: str | None = None
    display_name: str | None = None
    tool_use_id: str
    agent_id: str | None = None
    description: str | None = None
    decision_reason_type: DecisionReasonType | None = None
    """Structured discriminator for why auto-mode escalated.

    Lets SDK hosts make policy (e.g. auto-deny safetyCheck) without parsing decision_reason text.
    For compound bash commands this is "subcommandResults" even when a safetyCheck is nested inside
    — check classifier_approvable for that case.
    """
    classifier_approvable: bool | None = None
    """Set when a safetyCheck is present anywhere in the decision reason
    (including nested inside subcommandResults for compound bash).
    false = at least one safety check requires manual approval
    (e.g. Windows path bypass, dangerous rm);
    true = all safety checks MAY be classifier-approved
    (e.g. sensitive-file paths). Absent when no safetyCheck is involved."""

classifier_approvable class-attribute instance-attribute

classifier_approvable: bool | None = None

Set when a safetyCheck is present anywhere in the decision reason (including nested inside subcommandResults for compound bash). false = at least one safety check requires manual approval (e.g. Windows path bypass, dangerous rm); true = all safety checks MAY be classifier-approved (e.g. sensitive-file paths). Absent when no safetyCheck is involved.

decision_reason_type class-attribute instance-attribute

decision_reason_type: DecisionReasonType | None = None

Structured discriminator for why auto-mode escalated.

Lets SDK hosts make policy (e.g. auto-deny safetyCheck) without parsing decision_reason text. For compound bash commands this is "subcommandResults" even when a safetyCheck is nested inside — check classifier_approvable for that case.

:fa-brands-github: Show source on GitHub