docs(sdk): clarify empty core-tool allowlists across SDKs (#13949)

Co-authored-by: Zhangchenhao-111 <285911435+Zhangchenhao-111@users.noreply.github.com>
This commit is contained in:
haochen 2026-10-12 13:19:59 +00:00 • committed by GitHub
parent 7e5131d97b
commit 008c0de746
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 4 deletions

View file

@ -315,7 +315,7 @@ The `TransportOptions` class allows configuration of how the SDK communicates wi
- `permissionMode`: Permission mode that controls tool execution
- `env`: Environment variables to pass to the CLI process
- `maxSessionTurns`: Limits the number of conversation turns in a session
- `coreTools`: List of core tools that should be available to the AI
- `coreTools`: A non-empty allowlist of core tools. An omitted or empty list is treated as unspecified; an empty list does not disable tools. MCP and other non-core tools have separate registration and permission rules. Use `excludeTools` to exclude named tools explicitly; `allowedTools` controls approval rather than registration.
- `excludeTools`: List of tools to exclude from being available to the AI
- `allowedTools`: List of tools that are pre-approved for use without additional confirmation
- `authType`: Authentication type to use for the session

View file

@ -151,7 +151,7 @@ with query_sync(
| `append_system_prompt` | `str` | Append extra instructions to the system prompt. |
| `debug` | `bool` | Forward CLI stderr to stderr when no `stderr` hook exists. |
| `max_session_turns` | `int` | Maximum turns before the CLI ends the session. |
| `core_tools` | `list[str]` | Restrict the available tool set. |
| `core_tools` | `list[str]` | Non-empty core-tool allowlist. Omitted or empty lists are unspecified; `core_tools=[]` does not disable tools. |
| `exclude_tools` | `list[str]` | Exclude matching tools. |
| `allowed_tools` | `list[str]` | Allow matching tools without callback approval. |
| `auth_type` | `openai`, `anthropic`, `qwen-oauth`, `gemini`, `vertex-ai` | Authentication mode passed to the CLI. |

View file

@ -78,6 +78,10 @@ Creates a new query session with the Qwen Code.
> [!note]
> For `coreTools`, aliases like `Read`, `Edit`, and `Bash` also work, but invocation specifiers such as `Bash(git *)` are stripped. `coreTools` restricts tool registration, not invocation patterns.
#### Empty core-tool allowlists
An omitted or empty `coreTools` list is treated as unspecified; `coreTools: []` does **not** create a tool-free session. A non-empty list restricts core tools, not every tool category: MCP and other non-core tools have separate registration and permission rules. Use `excludeTools` to exclude named tools explicitly. `allowedTools` controls approval, not which tools are registered.
### Timeouts
The SDK enforces the following default timeouts:

View file

@ -358,7 +358,7 @@ The `TransportOptions` class allows configuration of how the SDK communicates wi
- `permissionMode`: Permission mode that controls tool execution
- `env`: Environment variables to pass to the CLI process
- `maxSessionTurns`: Limits the number of conversation turns in a session
- `coreTools`: List of core tools that should be available to the AI
- `coreTools`: A non-empty allowlist of core tools. An omitted or empty list is treated as unspecified; an empty list does not disable tools. MCP and other non-core tools have separate registration and permission rules. Use `excludeTools` to exclude named tools explicitly; `allowedTools` controls approval rather than registration.
- `excludeTools`: List of tools to exclude from being available to the AI
- `allowedTools`: List of tools that are pre-approved for use without additional confirmation
- `authType`: Authentication type to use for the session

View file

@ -147,7 +147,9 @@ Common fields:
- `env`: extra environment variables passed to the CLI process
- `system_prompt` / `append_system_prompt`: override or extend the system
prompt
- `core_tools`, `exclude_tools`, `allowed_tools`: constrain tool availability
- `core_tools`: a non-empty allowlist of core tools. An omitted or empty list is treated as unspecified; `core_tools=[]` does not disable tools. MCP and other non-core tools have separate registration and permission rules.
- `exclude_tools`: exclude named tools explicitly.
- `allowed_tools`: bypass approval for matching tools; this is not a tool-registration allowlist.
- `timeout`: seconds for control requests, permission callbacks, and stream
close waits

View file

@ -77,6 +77,10 @@ Creates a new query session with the Qwen Code.
> [!tip]
> If you need to configure `coreTools`, `excludeTools`, or `allowedTools`, it is **strongly recommended** to read the [permissions configuration documentation](../../docs/users/configuration/settings.md#permissions) first, especially the **Tool name aliases** and **Rule syntax examples** sections. Rule patterns such as `Bash(git *)`, `Read(.env)`, and `Edit(/src/**)` apply to `excludeTools` and `allowedTools`; `coreTools` accepts aliases but strips invocation specifiers.
#### Empty core-tool allowlists
An omitted or empty `coreTools` list is treated as unspecified; `coreTools: []` does **not** create a tool-free session. A non-empty list restricts core tools, not every tool category: MCP and other non-core tools have separate registration and permission rules. Use `excludeTools` to exclude named tools explicitly. `allowedTools` controls approval, not which tools are registered.
### Timeouts
The SDK enforces the following default timeouts: