From 5132e148415e927159f30f2718b38e121bc120fa Mon Sep 17 00:00:00 2001 From: Dickson Tsai Date: Sat, 17 Jan 2026 06:13:05 +0000 Subject: [PATCH] Add missing permission modes: delegate and dontAsk The Python SDK was missing two permission modes that are available in the TypeScript SDK and CLI: - 'delegate': Delegate mode, restricts to only Teammate and Task tools - 'dontAsk': Don't prompt for permissions, deny if not pre-approved This brings the Python SDK PermissionMode type in sync with the TypeScript SDK. Fixes #483 --- src/claude_agent_sdk/types.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/claude_agent_sdk/types.py b/src/claude_agent_sdk/types.py index 9c09345f..14594014 100644 --- a/src/claude_agent_sdk/types.py +++ b/src/claude_agent_sdk/types.py @@ -15,7 +15,15 @@ McpServer = Any # Permission modes -PermissionMode = Literal["default", "acceptEdits", "plan", "bypassPermissions"] +# - 'default': Standard behavior, prompts for dangerous operations +# - 'acceptEdits': Auto-accept file edit operations +# - 'bypassPermissions': Bypass all permission checks (requires allowDangerouslySkipPermissions) +# - 'plan': Planning mode, no actual tool execution +# - 'delegate': Delegate mode, restricts to only Teammate and Task tools +# - 'dontAsk': Don't prompt for permissions, deny if not pre-approved +PermissionMode = Literal[ + "default", "acceptEdits", "bypassPermissions", "plan", "delegate", "dontAsk" +] # SDK Beta features - see https://docs.anthropic.com/en/api/beta-headers SdkBeta = Literal["context-1m-2025-08-07"]