Impact
This is an incomplete fix of GHSA-xhq6-w3f2-m5w6.
The 0.6.1 fix made ToolGuard fail closed when the output[] of a Responses API object ("object": "response") holds an executable item. That check, like the rest of ToolGuard's scan for tool calls in an unrecognised format, only runs when no other tool-call shape is found in the response. If the same object also carries a tool call that ToolGuard does recognise, ToolGuard verifies only that call and nothing else in the object is checked.
Reproduced on 0.6.1 for both the pip and npm packages, with an executable item in output[] such as a local_shell_call running rm -rf / or a function_call to bash:
| Also present at the top level of the response object | 0.6.1 result |
|---|---|
| nothing | blocked |
tool_calls: [{"name": "search", "arguments": {}}] |
verified |
choices: [{"message": {"tool_calls": [ ...search... ]}}] |
verified |
content: [{"type": "tool_use", "name": "search", "input": {}}] |
verified |
type: "tool_call" or type: "function_call" with the name search |
verified |
toolCalls: [{"name": "search", "arguments": {}}] (npm package only) |
verified |
tool_calls: [] (empty) |
blocked |
The same happens when the executable item sits elsewhere beside a recognised call. Also reproduced on 0.6.1 for both packages, with tool_calls: [{"type": "function", "function": {"name": "search", "arguments": "{}"}}] beside it (each of these is blocked when it is the only call in the response):
| Where the executable item sits | 0.6.1 result |
|---|---|
output[] of an object with no object field, or with "object": "realtime.response" |
verified |
item of a stream event such as response.output_item.done |
verified |
output[] of a response wrapper, as in a response.completed event |
verified |
a legacy function_call in the same choices[].message |
verified |
a function_call block in a content list whose other call is a tool_use block (no tool_calls) |
verified |
root tool_name and arguments fields |
verified |
When this happens, none of ToolGuard's checks apply to the hidden call: the default blocklist, allowed_tools, dangerous-argument patterns, and in Python also custom validators and max_calls_per_response.
ArgumentGuard (Python package) has a gap with the same root cause. It never reads call items from a response object's output[]: it treats the output list itself as one argument set, skips it because it is not an object, and passes without applying rules or tool_rules. For example, a response object whose output[] holds a function_call to transfer with {"amount": 1000000} verifies against ArgumentGuard(tool_rules={"transfer": {"amount": {"type": "number", "max": 100}}}). This needs no change to the top level of the response.
Who is affected:
- Applications that verify responses with
ToolGuard,ResponseVerifierorVerifiedOpenAI.responses.create(), where an attacker can shape the response envelope and not only the model's output items. The official OpenAI Python SDK'sResponsemodel has notool_calls,choices,contentortypefield, so a Responses API object that comes straight from OpenAI through the SDK cannot carry the extra call. The chat message andcontentrows above need a message or content list that mixes two call formats. Exposure comes from verifying objects built or relayed by something less trusted: a third-party or self-hosted Open Responses-compatible server, a proxy or gateway, an agent-to-agent hand-off, or application code that merges fields from several sources. - Applications that rely on
ArgumentGuardwithoutToolGuardto bound tool arguments in Responses API objects. A prompt-injected or misbehaving model only has to return out-of-range arguments.
Applications that verify individual Responses items, stream items or tool calls on their own are not affected.
Root cause
The 0.6.1 fix added a fail-closed check for output[] but no extraction of the calls in it, and put that check in ToolGuard's scan for unrecognised tool content. That scan only ran after every recognised envelope shape had come back empty, so any recognised call in the same object took precedence and the rest of the object went unchecked: output[] items, stream items, wrappers and other call fields alike. ArgumentGuard did not consult output[] at all. Both are gaps in the GHSA-xhq6-w3f2-m5w6 fix, which states that its rules apply to output[] members of a response object and in ArgumentGuard.
Patches
Fixed in 0.6.2 (pip and npm). The fix:
- extracts call items from the
output[]of a response object (function_call,local_shell_call,shell_call,apply_patch_call,computer_call,custom_tool_call,mcp_approval_request) and checks each one as it would a standalone call: blocklist, allowlist and argument patterns, plus custom validators andmax_calls_per_responsein Python; - after taking the calls from one envelope, scans everything it did not read for another call, whatever the object's
objectortypesays, and blocks the response if it finds one. This coversoutput[]lists on any object, streamitems,responsewrappers, legacymessage.function_call,function_callcontent blocks and root call fields. Any other*_call/*_requestitem in anoutput[]list, streamitemorresponsewrapper blocks the response too; - rejects, as an ambiguous envelope, a response object whose
output[]holds a call item and that also has a direct calltypeor carries any other call envelope or collection at the top level (tool_call,toolCall,function_call,functionCall,function,tool_use,tool_calls,toolCalls,choices,content), and anoutput[]call item that carries one of these keys; - fails closed when a response object's
outputis not a list of objects (the Python package skipped tuples and SDK models left inoutput); - applies
ArgumentGuardrulesandtool_rulesto each call inoutput[], and reads call items in anoutput[]list, streamitemorresponsewrapper whateverobjectsays (Python).
The same release also rejects calls whose name, tool_name and toolName fields name different tools (issue #64), in both packages and on every path, so the output[] fix cannot be sidestepped by giving one call two identities. It also makes argument normalisation linear-time: a regex that folds spaced spellings such as os . system backtracked quadratically, so a tool argument of about 100,000 spaces took seconds to check (see the CHANGELOG).
As a side effect, VerifiedOpenAI(...).responses.create() no longer raises ResponseBlocked for safe tool calls. In 0.6.1, ToolGuard failed closed on every response object with a tool call in output[].
Workarounds
Until you can upgrade:
- Make sure each response presents its calls in one place before verifying it: reject any object that carries more than one of
output,item,response,tool_calls,toolCalls,choices,contentor a calltype, a chat message that has bothtool_callsandfunction_call, andcontentlists holdingfunction_callblocks. Or rebuild the object from only the fields you need. - Or verify each
output[]item, stream item or tool call on its own: in 0.6.1,ToolGuardandArgumentGuardcheck a standalonefunction_callor client action item correctly. - In the code that dispatches model output, only execute items that were verified individually.
References
- Incomplete fix of GHSA-xhq6-w3f2-m5w6 (fixed in 0.6.1).
- Reproduced on
v0.6.1(45d3e20) for both the pip and npm packages.
