Qwen Code can now block agent actions when policy hooks fail
Qwen Code v0.29.4 lets teams make command and HTTP hook failures block tool calls, prompt submissions or permission requests. Here’s how to choose the event and verify the block.


Qwen Code v0.29.4, released December 4, adds an opt-in control for teams that require a policy check before their coding agent acts. Command and HTTP hooks can now set onFailure to block at three events. If a configured hook fails at one of those events, Qwen Code turns the failure into a blocking decision. A team can require a check before a tool call and stop that call even when the check itself fails to deliver a verdict. Qwen Code v0.29.4 release notes

Choose the event that matches the policy
Qwen Code’s documentation describes a terminal agent that can edit files, run commands and create commits. Decide which step your policy needs to control before choosing an event. The release names these three events for blocking on failure. Qwen Code overview · v0.29.4 release notes
| Event | What a failed hook can block | Example policy placement |
|---|---|---|
PreToolUse |
The affected tool call before execution | Require a check before a tool writes to a designated path. |
UserPromptSubmit |
The prompt submission | Require an intake check before accepting a task from a shared workflow. |
PermissionRequest |
The permission request | Require a policy check at the point where the session requests permission. |
If the policy concerns a particular write, start at PreToolUse and verify that the hook matches the tool used for that write. If the policy concerns the submitted task, put the check at prompt submission. For PermissionRequest, first reproduce the workflow with the hook healthy and confirm that it actually raises the permission event your policy depends on.
The release history gives two reasons to check the exact call. The v0.29.2 notes describe PreToolUse hooks running concurrently for independent tool calls. The v0.29.3 notes describe a fix to settings checks for how hook matchers handle older tool names. In a session that proposes several calls, inspect the result of the call your policy covers and confirm that it reached the intended hook. Qwen Code release history
Test the block and the recovery
Start with one required check and one harmless operation in a disposable repository. For PreToolUse, a request to write a marker file gives you an observable result. Begin with the hook healthy and returning the result that should let the test proceed. Confirm that the intended tool call reaches the hook and that the marker appears. Reset the fixture, keep the request and policy the same, and repeat with the hook deliberately failing. Confirm that the call reached the hook, that Qwen Code blocked the call and that the marker stayed absent. An absent marker by itself could mean the agent never attempted the write.
If the hook can deliberately deny an operation, exercise that outcome with the hook healthy. Record whether the check passed, evaluated and denied the request, or failed and caused Qwen Code to block the event. Include the Qwen Code version, the event and the observed result in the test record. For prompt submission or permission requests, check whether the submitted task starts or the expected permission request advances. For more on recording policy decisions and human approvals, see the vendor permission verdicts guide.
Decide which checks should interrupt work
Use the setting where proceeding without a working check would violate team policy. For an HTTP hook, identify who can restore the policy service and what developers should report when the hook blocks an operation. For a command hook, identify who maintains the executable and its dependencies in the environments where the agent runs. After restoring the hook, reset the fixture and repeat the healthy case to verify that the operation can proceed again.
The release notes establish the setting, hook types and three events. Which failures trigger a block and how the client presents it are details to verify in your deployment. Use the client and configuration your team relies on, and simulate the dependency failure you expect to encounter there. Qwen Code v0.29.4 release notes

