Skip to main content
OpenAI tool protection has two separate stages:
  • Tool exposure: remove tools before the model sees them.
  • Tool-call check: evaluate a model-requested tool call before your app executes it.
Do not collapse these in your mental model. Exposure controls planning. Tool-call checks control execution.

Responses Tools

For Responses API request-time filtering, the wrapper understands:
  • function tools, keyed by name
  • custom tools, keyed by name
  • hosted OpenAI tools, keyed by type
  • MCP tools, keyed as mcp:<server_label> when server_label exists
If policy blocks send_email, the wrapper forwards only the remaining tools.

Chat Completions Tools

For Chat Completions, the wrapper understands function and custom tools.
When tools are filtered, the wrapper also sanitizes tool_choice so the request does not force a blocked tool.

Decision Callback

Use onDecision to inspect original, blocked, and forwarded tools.

Tool-call Checks

After OpenAI returns a tool call, Averta checks it before guarded tool-call events are exposed to your app. If the tool-call decision is block, the wrapper throws. Your app should not execute the tool.

Debugging