← Blog

OpenAI MCP Allowed Tools Policy for Narrow Responses Routes

Parminder Singh
Parminder Singh··6 min read
Summarize with AI

OpenAI Responses accepts allowed_tools inside an MCP tool definition, either as tool names or as a filter object. A route should build that field from a reviewed application allowlist, reject unknown names, and keep imported capability narrower than the remote server catalog. This guide covers policy compilation, read-only metadata, change control, and request evidence.

Platform & Architectureai-securityllm-securityagentic-aipolicy-enforcementzero-trustarchitecture
OpenAI MCP Allowed Tools Policy for Narrow Responses Routes

The OpenAI Responses API can import a subset of a remote MCP server's catalog through allowed_tools. That field is a capability boundary inside the routed model request. If a server publishes forty tools and the route needs two, sending the full catalog gives the model thirty-eight capabilities the workflow never reviewed. I want allowed_tools compiled from route policy, rather than copied from a server response or accepted from a user payload.

TL;DR

  • Generate allowed_tools from a versioned route policy with exact MCP tool names.
  • Intersect policy with the current server catalog, then fail closed on missing, renamed, duplicated, or unexpected tools.
  • Treat readOnlyHint as server-supplied metadata and keep sensitive reads under explicit data policy.
  • Record the compiled allowlist and policy version beside the outbound OpenAI Responses request.

Allowed tools limits what OpenAI imports

OpenAI's MCP guide says allowed_tools imports only the selected subset of tools from an MCP server. The guide frames the feature partly around cost and latency when servers expose dozens of definitions. The same field also gives application policy a precise request surface.

The current Responses create schema accepts an array of tool-name strings or a filter object containing tool_names and an optional read_only value. Those are provider request semantics. The decision to permit search_accounts on one route and withhold update_account is an application recommendation that your team owns.

Keep the distinction visible in configuration. OpenAI parses the field and limits imported tools. Your application decides which names enter it for an authenticated user, agent, tenant, and route. The remote MCP server remains responsible for authorization when a call reaches it.

This is LLM API parameter allowlisting applied to a nested capability field.

Compile the field from route policy

Start with a policy object that names the OpenAI route, registered MCP server label, authenticated role, and approved tool names. The provider adapter should receive the compiled result, never an unchecked allowed_tools value from the request caller. An end user may choose among capabilities already assigned to the route, but that choice can only narrow the configured set.

Use set intersection: route allowlist, role entitlement, tenant entitlement, and any workflow-specific selection. Sort and deduplicate the result before creating the Responses request. Reject an empty result when the route requires MCP, or omit the MCP tool entirely when the workflow can proceed without it. Sending an empty or ambiguous shape and hoping the provider interprets it safely creates a brittle contract.

Exact matching is worth the mild inconvenience. get_invoice and get_invoices should remain different identifiers. Wildcards and prefix rules make catalog growth dangerous because a newly published tool can become eligible without policy review.

The per-route policy pattern gives every compiled set an owner and revision history.

Reconcile against the imported catalog

OpenAI documents an mcp_list_tools output item containing the tools successfully imported from the server. Retain that item in protected workflow state and compare its names with the set you requested. Missing names can indicate a server change, a typo, or a catalog retrieval problem. Extra names indicate a policy or adapter defect and should block the route.

Catalog reconciliation needs a stable outcome for renamed tools. Do not silently map an old name to a new one. Tool names are capability identifiers, and a rename may coincide with changed arguments or effects. Require a policy revision, schema review, and fixture update before the new name enters production traffic.

Run the same review when a known tool's input schema changes. A stable name does not prove stable behavior. Keep a digest of the imported definition or the fields your validator depends on, then alert on change. The gateway record can identify the requested allowlist and observed catalog digest without claiming control over the remote server's implementation.

A deployment screen showing one unexpected tool in red is more useful than a green check for successful catalog retrieval.

Read-only filters need a trust boundary

The create schema says the read_only filter can match an MCP tool annotated with readOnlyHint. That hint originates in server-provided tool metadata. It is useful for selection, but it is not a substitute for an application-reviewed tool list or data classification policy.

A read-only CRM search can return customer email addresses, contract values, or support notes. The absence of mutation does not make the disclosure harmless. OpenAI's MCP safety guidance gives a concrete prompt-injection example where a CRM read feeds an email address into a URL, showing that read tools still move data.

For sensitive routes, use exact tool_names and treat read_only as an additional catalog property. If your policy permits a broader read-only filter, document which server supplies the hint and what happens when the annotation is absent. Fail closed on uncertain classification. Approval policy can add a human checkpoint, but it cannot repair an overly broad imported catalog.

Allowed tools and approvals solve different problems

allowed_tools decides which MCP tool definitions OpenAI may import for the model. require_approval decides which proposed calls wait for approval. A tool excluded by the allowlist should never reach the approval stage. A tool included in the allowlist may still require approval every time.

Keep those fields in separate policy blocks. For example, a support route may import find_customer and read_ticket, require approval for both when protected data is involved, and exclude every mutation tool. Another route may import one narrowly scoped status lookup and skip approval after a risk review. The first decision defines capability. The second defines the human checkpoint.

The AI tool call policy enforcement guide covers the application authorization that remains necessary around action-bearing workflows. OpenAI's imported-tool filter does not grant a user permission inside the target service.

I would block any pull request that sets allowed_tools to the server's entire discovered catalog for convenience. The discovery result reports what exists, while route policy sets the permitted exposure.

Evidence and tests for the compiled request

Record the authenticated identity context supplied by the application, route, server label, policy version, source entitlements, compiled tool names, catalog digest, and allow or deny outcome. Avoid copying full tool descriptions into the primary audit row because descriptions can contain sensitive or untrusted text. A digest and protected catalog snapshot support later comparison.

Test the compiler with one allowed tool and then with several. Add cases for duplicates, unknown identifiers, an empty intersection, changed entitlements, catalog additions, removals, and a schema change under a stable name. Include a caller-supplied allowed_tools field that tries to add a mutation tool. Confirm that input can only narrow the route set.

Also inspect the actual outbound Responses body in a test adapter. The tool definition should contain the expected server label and compiled allowed_tools value, with no extra MCP registration injected by a generic request merger. OpenAI API gateway patterns provide a clean seam for that final request check.

DeepInspect

DeepInspect can inspect the MCP tool definitions inside authenticated Responses requests deliberately routed through its HTTP proxy to OpenAI. A per-route policy can reject unknown server labels, caller-supplied capability expansion, and allowed_tools sets that exceed the approved names. The resulting decision record can retain the normalized set and policy version before the request reaches OpenAI.

Remote MCP catalog behavior, server authorization, and tool execution remain outside this boundary. The application owns its entitlement sources and catalog-review process. DeepInspect enforces the compiled request contract on the routed user or agent-to-LLM exchange.

Book a demo today.

Frequently asked questions

Does allowed_tools authorize the remote MCP action?

No. It limits which tool definitions OpenAI imports for the model on that Responses request. The remote MCP server and target service still own caller authorization, argument checks, and execution. Treat the field as a model capability boundary within the routed provider exchange.

Should a route use tool names or the read-only filter?

Exact names give reviewers the clearest capability set. A read-only filter can help when a trusted server maintains accurate annotations, but reads can disclose sensitive data. Sensitive routes should pair exact names with independent data policy and approval rules.

What happens when the server renames a tool?

Fail the policy reconciliation and require a reviewed configuration change. Silent aliasing can hide changed schemas or effects. Update the allowlist, validator fixture, catalog digest, and policy version together.

Can a user choose fewer tools than route policy permits?

Yes. Intersect the user's requested subset with the server-side route allowlist. The user input may narrow capability. It should never add a tool absent from the route, role, or tenant entitlements.