diff --git a/docs/developers/sdk-java.md b/docs/developers/sdk-java.md index 74a3226f50..76ed30177d 100644 --- a/docs/developers/sdk-java.md +++ b/docs/developers/sdk-java.md @@ -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 diff --git a/docs/developers/sdk-python.md b/docs/developers/sdk-python.md index 9a21083da9..eb0e43184f 100644 --- a/docs/developers/sdk-python.md +++ b/docs/developers/sdk-python.md @@ -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. | diff --git a/docs/developers/sdk-typescript.md b/docs/developers/sdk-typescript.md index f34bac68d4..e04227a942 100644 --- a/docs/developers/sdk-typescript.md +++ b/docs/developers/sdk-typescript.md @@ -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: diff --git a/packages/sdk-java/qwencode/README.md b/packages/sdk-java/qwencode/README.md index cfb749ba0c..f3c021a27c 100644 --- a/packages/sdk-java/qwencode/README.md +++ b/packages/sdk-java/qwencode/README.md @@ -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 diff --git a/packages/sdk-python/README.md b/packages/sdk-python/README.md index 664e634188..0f567b7a15 100644 --- a/packages/sdk-python/README.md +++ b/packages/sdk-python/README.md @@ -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 diff --git a/packages/sdk-typescript/README.md b/packages/sdk-typescript/README.md index 44580db924..d179b9f65c 100644 --- a/packages/sdk-typescript/README.md +++ b/packages/sdk-typescript/README.md @@ -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: