[DOCS] Missing required `allowDangerouslySkipPermissions` flag in Agent SDK Overview example
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://platform.claude.com/docs/en/agent-sdk/overview
Section/Topic
"Capabilities" section → "Permissions" tab → TypeScript code example
Current Documentation
The TypeScript example under the Permissions tab shows:
import { query } from "@anthropic-ai/claude-agent-sdk";
for await (const message of query({
prompt: "Review this code for best practices",
options: {
allowedTools: ["Read", "Glob", "Grep"],
permissionMode: "bypassPermissions"
}
})) {
if ("result" in message) console.log(message.result);
}
What's Wrong or Missing?
The TypeScript SDK Reference explicitly states that allowDangerouslySkipPermissions: true is required when using permissionMode: 'bypassPermissions':
|allowDangerouslySkipPermissions|boolean|false| Enable bypassing permissions. Required when usingpermissionMode: 'bypassPermissions'|
The Overview example omits this required flag. Users copying this code will likely encounter a runtime validation error.
Suggested Improvement
Update the TypeScript example to include the required flag:
import { query } from "@anthropic-ai/claude-agent-sdk";
for await (const message of query({
prompt: "Review this code for best practices",
options: {
allowedTools: ["Read", "Glob", "Grep"],
permissionMode: "bypassPermissions",
allowDangerouslySkipPermissions: true
}
})) {
if ("result" in message) console.log(message.result);
}
The Python example on the same page may also need updating if it has an equivalent required flag (e.g., allow_dangerously_skip_permissions=True).
Impact
High - Prevents users from using a feature
Additional Context
- Mirror location:
platform.claude.com/docs/en/agent-sdk/overview.md - Related reference: TypeScript SDK Reference - ClaudeAgentOptions
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗