Skip to content

docs: fix dontAsk and auto permission_mode descriptions#863

Merged
ashwin-ant merged 1 commit intomainfrom
docs/fix-permission-mode-descriptions
Apr 22, 2026
Merged

docs: fix dontAsk and auto permission_mode descriptions#863
ashwin-ant merged 1 commit intomainfrom
docs/fix-permission-mode-descriptions

Conversation

@sarahdeaton
Copy link
Copy Markdown
Contributor

Summary

Fixes two misleading lines in the permission_mode docstrings (client.py and query.py).

dontAsk — the description was inverted. It said:

Allow all tools without prompting

That's what bypassPermissions does. dontAsk actually converts any would-be permission prompt into a deny — only tools pre-approved by allow rules run. Someone reading the old docstring could reasonably pick dontAsk expecting permissive behavior and get the opposite.

auto — "Automatically determine permission mode" was vague. Clarified that it uses a model classifier to approve or deny each tool call.

Changes

  • src/claude_agent_sdk/client.pyset_permission_mode() docstring
  • src/claude_agent_sdk/query.pyquery() docstring

Docstring-only, no behavior change.

The dontAsk description was inverted — it said 'Allow all tools without
prompting', which is what bypassPermissions does. dontAsk actually denies
any tool call that isn't pre-approved by allow rules.

Also clarified that auto mode uses a model classifier to approve or deny
each tool call, rather than the vague 'automatically determine'.
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — docstring-only fix, no behavior change.

Extended reasoning...

Overview

This PR updates two docstring lines each in src/claude_agent_sdk/client.py (set_permission_mode) and src/claude_agent_sdk/query.py (query). It corrects the description of dontAsk (previously duplicated the bypassPermissions description and implied permissive behavior) and clarifies auto. Four lines changed in total, all inside docstrings.

Security risks

None. No executable code paths are touched — the PermissionMode literal in types.py and the pass-through to the CLI control protocol are unchanged. This cannot affect runtime permission enforcement.

Level of scrutiny

Low. This is a comment/documentation correction with a well-argued rationale in the PR description. The Python SDK doesn't implement the mode semantics itself (it forwards the string to the CLI), so there's no local logic to cross-check; the new wording is internally consistent (distinguishes dontAsk from bypassPermissions) where the old wording was not.

Other factors

No bugs flagged by the bug-hunting system, no prior reviewer comments, and the change is symmetric across both call sites. Straightforward to approve.

@ashwin-ant ashwin-ant merged commit fb54ccd into main Apr 22, 2026
10 checks passed
@ashwin-ant ashwin-ant deleted the docs/fix-permission-mode-descriptions branch April 22, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants