Daily Edition Sources +3

A Local HTTP Callback Can Stop Qwen Code’s Next Tool Call

Qwen Code’s opt-in Tool Guard gives managed ACP deployments a small local API that can allow or deny a supported top-level tool call at its final execution boundary.

A rough paper diagram sends a Qwen Code tool call through handshake and prepare cards to a green allow-or-deny policy card, with a red NOT EVERY SIDE EFFECT stamp.
Diagram Punkinspect the final execution boundary—and the effects it does not cover.
repo QwenLM/qwen-code evidence
3 source signals 1 repo commit 5631f4b
Evidence: commit 5631f4b / August 5, 2026 / Daily Edition
Open Edition Evidence below

API discovery: Qwen Code’s public Tool Guard documentation describes a deliberately narrow interposition point for a managed agent. Start qwen serve in required mode with a loopback provider URL. The provider completes POST /v1/handshake at startup, then answers POST /v1/prepare before each supported top-level managed tool invocation reaches the executor.

The prepare request carries a session ID, prompt ID, tool-call ID, canonical tool name, and final arguments. A minimal affirmative reply is { "protocolVersion": 1, "requestId": "<echo>", "allowed": true }. Timeouts, malformed responses, a mismatched request ID, and a denial all stop execution. The companion capability protocol says the daemon advertises the feature only after the required startup handshake succeeds.

Try it as a tiny change-control desk

Build a loopback-only provider that lets read-only inspection proceed but asks a small local policy service to decide when an agent wants to write a file, invoke a shell, or call a connector. The useful prototype is not a magical security oracle. It is a visible decision record: “this is the final tool name and arguments Qwen Code was about to execute; allow or deny it here.” Use a disposable workspace and a local secret, because the guard receives final arguments that may contain sensitive application data.

Copy-paste agent instruction

Build a disposable, loopback-only Qwen Code Tool Guard provider for a test workspace. Implement POST /v1/handshake and POST /v1/prepare with bearer-token authentication, protocolVersion 1, and exact requestId echoing. Log only the tool name and a redacted decision summary; do not persist final arguments. Default to deny on timeout, malformed input, or an unknown tool. Configure qwen serve with required Tool Guard mode, then demonstrate one allowed read-only tool call and one denied write-like call. Document every command that remains outside this guard boundary.

Test caveat

This is a source-level API discovery, not a claim that a policy service is ready to deploy. Qwen Code’s docs cap request and response sizes, require an operator-managed bearer token, and specify a per-call timeout; your setup may still fail on credentials, process startup, latency, or tool semantics. More importantly, the source says Tool Guard does not sandbox a command, does not govern hooks, and does not cover every side effect. Treat it as one final-call control, then test its gaps before you call it a safety boundary.

Evidence Trail

Receipts below the story

The article above is the public narrative. This section keeps the source trail and limits on the same page.

Edition
DateAugust 5, 2026
LaneDaily Edition
Confidence78%
Sources3
ReposQwenLM/qwen-code

Primary Evidence

  • Public API source: Qwen Code’s required external Tool Guard documentation
    • Shows: Qwen Code documents a loopback-only provider with POST /v1/handshake and POST /v1/prepare, bearer authentication, protocol version 1, and an allowed decision before supported top-level managed tool execution.
  • Supporting definition or documentation: Qwen Serve capability protocol
    • Shows: the capability appears only after the required startup handshake response, and each supported managed ACP channel plus final tool invocation must make the documented external pre-execution provider request before it can run.
  • Public implementation receipt: Qwen Code Tool Guard change
    • Shows: the public repository added the external Tool Guard mode, its operator-facing configuration, and the protocol documentation used in this brief.

Evidence Limits

  • These sources describe an implementation contract, not a working policy service on a reader’s machine. They do not prove credentials, latency, model behavior, provider correctness, audit durability, or that a permitted command is safe.
  • Guard requests can carry sensitive final arguments. Qwen Code documents a partial boundary: hooks and some command shapes sit outside it, and nested/delegated calls are restricted rather than universally governed. Test a disposable local deployment before relying on it.
Letters & Corrections

Send a note to the desk

Corrections, missing context, or a follow-up lead.