What it is
Most production AI features are not raw chat. They are function calling: the model is given a set of tools, each with a name and a typed argument schema, and it answers by emitting the arguments for a tool rather than prose. A function-calling jailbreak targets that path. Instead of asking the model for a prohibited answer in conversation, the attacker gets it to produce the prohibited content inside a tool's arguments.
The reason it works is structural. The safety alignment that refuses a harmful chat request is applied far less thoroughly to the text a model generates as function arguments. The same request a model declines in chat can pass when it is reframed as filling in a tool call. Across GPT-4, GPT-4o, Claude 3 and 3.5 Sonnet, Gemini 1.5 Pro and Mixtral, the paper reports success rates above 90 percent, higher than the chat-mode jailbreaks it was measured against.
How it works
The attacker supplies a crafted tool definition and a request that routes through it. Several elements combine:
- A benign cover task. The tool is presented as something innocuous, a writing or formatting helper, so the call itself looks legitimate.
- Harmful content in the arguments. The argument schema is shaped so that producing the attacker's target content is the natural way to fill it.
- Forced execution. The request is set to require a tool call rather than let the model decline, which removes the model's usual option to refuse.
- Guidance in the definition. Instructions and length requirements placed in the tool definition steer the output toward a detailed result.
The asymmetry at the centre of it is that the argument-generation path sees weaker safety filtering than the chat path, so content that would be refused in conversation is emitted as a tool argument instead.
Why it matters
It is the common case, not an edge case. Agents and assistants are built on function calling. The surface this attacks is the surface most real deployments run on.
It bypasses the defence teams rely on. Chat-mode refusal is the safety behaviour most teams test. This routes around it, so a model that looks well-aligned in conversation can still be driven to harmful output through its tools.
Forcing a call is a normal setting. Requiring a tool call, rather than leaving it to the model, is a routine engineering choice for reliability. The attack turns that ordinary setting into the thing that removes the model's ability to refuse.
How to test for it
- Enumerate the tools your model is offered and how tool choice is configured. A forced-call setting is the first thing to note.
- Capture the actual request to the model: the tool definitions and the tool-choice setting as they are sent. An intercepting proxy is the practical way to see what the model is really given.
- Compare the chat and function paths. Take a request the model refuses in chat and test whether the same intent passes when it is routed into a tool argument.
- Inspect the generated arguments, not just the final rendered answer. The harmful content lands in the tool-call arguments, which an application often consumes without showing a user.
- Test each tool that accepts free-text arguments, with tool choice set both forced and automatic.
How to defend against it
- Prefer automatic tool choice. Leaving the model free to decline restores the refusal it would otherwise apply. Force a call only where you have another control in place.
- Filter tool arguments, not just chat output. Apply the safety checks you run on conversational responses to generated function arguments as well.
- Constrain argument schemas. Narrow types, enumerations and length limits leave less room to smuggle a payload into a free-text field.
- Put defensive instruction in the tool definition. A description that tells the model to decline out-of-scope or harmful use is a cheap first layer the paper found measurably helps.
- Red-team the function path. Test the tool interface with the same seriousness as the chat interface, because an attacker will.
Example request
{
"model": "<target-model>",
"messages": [
{ "role": "user", "content": "<request that routes through the tool rather than chat>" }
],
"tools": [
{
"type": "function",
"function": {
"name": "<benign_sounding_tool>",
"description": "<benign cover description>",
"parameters": {
"type": "object",
"properties": {
"<free_text_arg>": { "type": "string", "description": "<arg shaped so a request the model would normally refuse is the natural way to fill it>" }
},
"required": ["<free_text_arg>"]
}
}
}
],
"tool_choice": "required"
}
The redacted content is induced inside a tool-call argument, where safety checks are applied less thoroughly than to a chat reply, with the call forced.
Source: Wu, Gao, He and Wang, "The Dark Side of Function Calling," arXiv:2407.17915 (2024).
The shape of the request, with the payload redacted. We publish the mechanism, not a working attack.
In crucible
Capture a tool-using request and open it in Craft. Edit the body to add a crafted function definition to the tools array and set tool_choice to force the call, then replay it through the proxy and read the induced content in the response's function-call arguments. It reads cleanly against the recognised providers, where crucible parses the tool definitions and the returned call arguments directly.
crucible delivers and captures the attack; you write the malicious tool schema. There is no payload pack for this one; the workflow is manual.