serv_, activates 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
- Declare the tool. Add
serv_prompt_guard,serv_shadow_agent, or both to 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 they never interfere withtool_choiceor the model’s own tool use.
SERV Tools coexist with your application’s own tools. You can include
serv_prompt_guard, serv_shadow_agent, and your function tools in the same tools array: SERV intercepts only the serv_* names and forwards the rest to the model unchanged.Available tools
| Tool | What it does | Parameters |
|---|---|---|
serv_prompt_guard | Protects your system prompt from injection-based leakage. | None — declaring the tool enables it. |
serv_shadow_agent | Runs a validate-and-iterate loop over the output to raise accuracy on hard tasks. | hint (string, optional), max_iterations (integer, optional, default 3) |
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.
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. If no attempt passes, the output is marked as a failed output.
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.
| Parameter | Type | Default | Description |
|---|---|---|---|
hint | string | (none) | Additional evaluation criteria applied during validation, beyond the default meaningful-and-valid check — for example, “the answer must cite a specific number.” |
max_iterations | integer | 3 | The number of validate-and-iterate cycles to run before the output is marked as failed. |
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.
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.
- Roadmap — what’s coming next.

