tools array, the mechanism works identically across the OpenAI SDK, the Anthropic SDK, the Vercel AI SDK, and raw HTTP. There is no SERV-specific API to learn: if you can declare a tool, you can use SERV Tools.
How it works
- Declare the tool. Add any of
serv_prompt_guard,serv_disable_content_filter, orserv_shadow_agentto the request’stoolsarray, in whatever tool format your SDK uses. - Configure through schema defaults. When a SERV tool accepts options, you do not pass arguments at call time. Instead, set a
defaultvalue on each parameter in the tool’s schema, and SERV reads that default as the configured setting. - SERV handles it server-side. SERV removes every SERV Tool before the model runs, so these tools never appear as tool calls in the response and don’t interfere with the model’s own tool use. A
tool_choicethat names a SERV Tool is reset toauto.
SERV Tools coexist with your application’s own tools. You can include
serv_prompt_guard, serv_disable_content_filter, serv_shadow_agent, and your function tools in the same tools array: SERV intercepts only these exact names and forwards the rest to the model unchanged. A misspelled name such as serv_shadow_agents is not recognized: it reaches the model as an ordinary function tool.Available tools
Kronos and Multipath are enabled through a model ID suffix instead of a tool. See Model features.
serv_prompt_guard
Includeserv_prompt_guard to protect your system prompt against injection-based leakage: attempts in user input to make the model reveal or override your instructions. The guard is opt-in: it runs only on requests that declare the tool. Declaring it by name is sufficient; no description or parameters are required.
The guard checks the request before the model runs. A judge compares the request content, including user messages, tools, and response format settings, with the reasoning prompt SERV generated for your system prompt. If it identifies an injection attempt, SERV returns a refusal in the endpoint’s normal response format (as a stream when stream: true) and does not call the requested model. Blocked requests are recorded in the Safety report.
- The guard can’t be armed. If SERV can’t generate the reasoning prompt the guard needs, it returns a
502rather than forwarding an unscreened request. Retry the request. - The judge fails. If the judge call itself fails after the guard is armed, the request continues to the model without a verdict.
serv_prompt_guard_legacyenables the same guard with SERV’s earlier judge. Useserv_prompt_guardunless you depend on the earlier judge’s verdicts. Declaring both in one request returns a400.
serv_disable_content_filter
On Chat Completions and Responses, SERV runs a content filter by default. It blocks a response that copies SERV’s private reasoning prompt: the reasoning layer SERV generates and adds to your request. You don’t declare a tool to get it. Blocked responses are recorded in the Safety report. The filter scans the model’s text output and the arguments of function tool calls. It does not scan custom-tool inputs or reasoning output (reasoning summaries and reasoning text). When it blocks a response:- Chat Completions: the message content is replaced with a short refusal and
finish_reasoniscontent_filter. If a tool call’s arguments leak, all tool calls in the message are removed too. - Responses: leaking text is replaced with a short refusal. In a non-streaming response, a leaking
function_callitem keeps its place but getsarguments: "{}"andstatus: "incomplete", so check the status before executing a tool call. The response itself getsstatus: "incomplete"withincomplete_details.reason: "content_filter". - Streams: the stream stops at the leak and ends with a refusal event.
serv_prompt_guard.
The filter runs only when SERV generated a reasoning prompt for the request. See When SERV features are skipped.
Include serv_disable_content_filter to turn the filter off for a request. As with the other SERV Tools, declaring it by name is enough; it takes no parameters. This is a SERV Tool that disables a default behavior rather than enabling an opt-in one. Turn it off only for a controlled test that needs to inspect whether model output repeats SERV reasoning-prompt content.
/v1/messages does not run the content filter, so serv_disable_content_filter has no effect there. The content filter and serv_prompt_guard are independent: disabling the filter does not affect the guard, and enabling the guard does not disable the filter.serv_shadow_agent
Includeserv_shadow_agent to run a validation loop over the model’s output. By default, the shadow agent evaluates whether the response is a meaningful, valid answer to the request. If it is not, the agent asks the model to revise its answer and validates again, repeating until the output passes or the iteration limit is reached. See Outcomes for what SERV returns in each case.
Because it trades additional inference for higher accuracy on difficult tasks, the shadow agent is opt-in.
Parameters
Both parameters are optional. Set each one by assigning it adefault in the tool’s schema; SERV uses that default as the value.
Outcomes
Nothing in a
200 response marks it as unvalidated. The shadow agent validates text output only: a response that contains only tool calls is returned without validation. Check the Shadow Agent report to see how each request ended.
max_iterations: 3), declare it by name with no parameters, exactly as with serv_prompt_guard above.
Vercel AI SDK versions. The
inputSchema field shown here is AI SDK v5; on v4, use parameters instead. In both versions, the jsonSchema helper lets you set default directly, which is what SERV reads.Combining tools
SERV Tools and your own tools share a single array. In this example, both SERV features run whileget_quote is forwarded to the model as an ordinary callable tool:
OpenAI SDK
serv_prompt_guard and serv_shadow_agent, then forwards only get_quote to the model.
Model features
Kronos and Multipath change how SERV builds the reasoning prompt. You enable them by appending a suffix to the base model ID, not by declaring a tool:
SERV removes the suffix before routing to the provider, so
gpt-5.4-mini-serv-kronos runs gpt-5.4-mini. SERV Tools work with every suffix. A malformed suffix returns a 400:
Unsupported SERV model feature: XwhenXis notkronosormultipath.Duplicate SERV model feature: Xwhen a feature appears twice.Invalid SERV model feature suffix: <model>when the suffix has an empty part, such as a trailing hyphen.
When SERV features are skipped
In these cases a feature you expect does not run, and SERV returns no error:- The reasoning prompt can’t be generated. If generating the reasoning prompt fails, including a Kronos audit or repair failure, the request continues with your original system prompt and no content filter. The shadow agent still runs. With
serv_prompt_guarddeclared, SERV returns a502instead (see serv_prompt_guard). - Responses continuations. On a
/v1/responsesrequest withprevious_response_id, SERV adds no reasoning prompt and skips the prompt guard, the shadow agent and the content filter. A continuation that combinesstream: truewithserv_shadow_agentis therefore accepted. - Messages.
/v1/messagesdoes not run the content filter.
See also
- Why SERV Reasoning: the features SERV adds on top of the base model.
- Chat completions and Messages: the
toolsfield on each endpoint. - SDK Integration: endpoints and the cross-SDK parameter map.

