Skip to main content
SERV Tools are features you turn on or off by adding a specially named tool to an ordinary request. They are not functions the model calls: SERV recognizes each SERV Tool by its exact name, applies the corresponding feature, and removes the tool before the request reaches the model. Because every major client supports a 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

  1. Declare the tool. Add any of serv_prompt_guard, serv_disable_content_filter, or serv_shadow_agent to the request’s tools array, in whatever tool format your SDK uses.
  2. Configure through schema defaults. When a SERV tool accepts options, you do not pass arguments at call time. Instead, set a default value on each parameter in the tool’s schema, and SERV reads that default as the configured setting.
  3. 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_choice that names a SERV Tool is reset to auto.
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

Include serv_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 502 rather 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_legacy enables the same guard with SERV’s earlier judge. Use serv_prompt_guard unless you depend on the earlier judge’s verdicts. Declaring both in one request returns a 400.
The guard does not run on Responses continuations. See When SERV features are skipped.

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_reason is content_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_call item keeps its place but gets arguments: "{}" and status: "incomplete", so check the status before executing a tool call. The response itself gets status: "incomplete" with incomplete_details.reason: "content_filter".
  • Streams: the stream stops at the leak and ends with a refusal event.
The filter does not protect your own system prompt. Text that also appears in your system prompt or in user messages is excluded from detection, so a model that quotes your instructions or the user’s words back is not blocked. Assistant and tool messages are not excluded. To defend your instructions against extraction, use 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.
With the content filter disabled, SERV no longer stops the model from reproducing its generated reasoning prompt in the response. Only send serv_disable_content_filter on requests where that is acceptable.
/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

Include serv_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 a default in the tool’s schema; SERV uses that default as the value.
A max_iterations outside 1 to 10, a non-string hint, or a hint over 2,000 characters returns a 400. The shadow agent does not support streaming: a request with stream: true and serv_shadow_agent returns a 400 on every endpoint. The one exception is a Responses continuation (previous_response_id), where SERV skips the shadow agent without an error. See When SERV features are skipped.

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.
To run the shadow agent with its defaults (the meaningful-and-valid check and 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 while get_quote is forwarded to the model as an ordinary callable tool:
OpenAI SDK
SERV intercepts 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: X when X is not kronos or multipath.
  • Duplicate SERV model feature: X when 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_guard declared, SERV returns a 502 instead (see serv_prompt_guard).
  • Responses continuations. On a /v1/responses request with previous_response_id, SERV adds no reasoning prompt and skips the prompt guard, the shadow agent and the content filter. A continuation that combines stream: true with serv_shadow_agent is therefore accepted.
  • Messages. /v1/messages does not run the content filter.

See also