Skip to main content

Tool Policies page

The Tool Policies page lists every tool the gateway has seen and lets you decide how far each tool is trusted, which is how you stop a prompt injection in one tool's output from steering a sensitive tool. Nothing has to be declared up front. When a request offers tools in its tools list, a model response contains tool_calls, or an MCP client calls a tool, the gateway records each new tool name with the team, key, user and user agent of the request, and the tool appears here with the input policy untrusted and the output policy untrusted. Open the page at /ui/tool-policies. It sits in the left nav under AI Gateway, inside the Tools group, after Search Tools, Code Graph and Vector Stores. The policy model and the API behind the page are described in tool registry and tool policies.

The nav item is shown to the session roles Admin and Admin Viewer. Other roles who open the URL directly see "Tool Policies is only available to admin users." Org admins are in that group, because the check uses the session role. No license feature is checked.

A real-world scenario​

At the end of the day the Needs Review banner says three tools were discovered today. The admin clicks Review on each one. jira-search_issues only reads, so its output policy is set to untrusted and left to run. jira-create_issue writes, so its input policy becomes trusted, which means it cannot run after untrusted output has entered a conversation. shell-exec should never run through the assistant, so its input policy becomes blocked for everyone. Later the interns' team asks for jira-create_issue, and the admin blocks it for that team alone from the tool's detail view, leaving the global policy as it is.

Review a new tool and set its policy​

  1. Open Tool Policies. The Needs Review banner lists tools discovered today that still have the input policy untrusted. Click Review on a chip to scroll to its row.

  2. In the row, pick a value in the Input Policy dropdown (untrusted, trusted or blocked) or the Output Policy dropdown (untrusted or trusted). Hover a dropdown to read what the current value means. untrusted and trusted save at once. Picking blocked asks you to confirm first, because a blocked tool makes every request that lists it fail until you change it back. You change any policy back by picking the old value.

  3. Expected result: the dropdown shows the new value with its coloured dot, amber for untrusted, green for trusted and red for blocked. The Blocked Tools card counts the tool when you blocked it. The same change with the API:

    curl -X POST http://localhost:4000/v1/tool/policy \
    -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \
    -d '{"tool_name": "jira-create_issue", "input_policy": "trusted"}'
    {"tool_name": "jira-create_issue", "input_policy": "trusted", "output_policy": "untrusted", "updated": true}
  4. The policy is enforced by the tool_policy guardrail. A request that violates it fails with status 400 and Violated tool policy, see turning enforcement on.

PolicyValueMeaning
Input policyuntrustedThe tool accepts any input, including data from untrusted tool outputs. Default for newly discovered tools.
Input policytrustedThe tool requires trusted input. The call is blocked if the conversation contains output from any tool whose output policy is untrusted.
Input policyblockedThe tool is prohibited. Any attempt to call it is rejected.
Output policyuntrustedThe tool's output may contain unsafe content such as prompt injection or risky code. Downstream tools whose input policy is trusted are blocked.
Output policytrustedThe tool's output is treated as safe and does not trigger trust chain blocks on downstream tools.

Block a tool for one team or key​

  1. Click the tool's name to open its detail view and scroll to Block for team or key.

  2. Choose the Scope, Team (default) or Key. Pick the team in the Team dropdown, or search the key by alias in the Key dropdown, which lists the first 100 keys. Click Block for team or Block for key.

  3. Expected result: the block appears under Blocked for team or key as "Team" with the team id or "Key" with the key alias. Remove deletes it at once. The same with the API:

    curl -X POST http://localhost:4000/v1/tool/policy \
    -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \
    -d '{"tool_name": "jira-create_issue", "input_policy": "blocked", "team_id": "interns"}'
    {"tool_name": "jira-create_issue", "input_policy": "blocked", "output_policy": null, "updated": true, "team_id": "interns", "key_hash": null}

The tool's global policy is unchanged, so every other team keeps using it.

Tool list​

The list view has four metric cards, the review banner and the tools table.

CardMeaning
New TodayTools first discovered today, counted in UTC, with the difference from yesterday.
Total Tools DiscoveredAll tools in the list.
Blocked ToolsTools whose global input policy is blocked, shown in red when above zero. Team and key blocks are not counted.
Active TeamsThe number of different teams that discovered the listed tools, or a dash.

The table is sorted by Discovered, newest first, and shows 50 rows per page by default, with 100 as the other option. Sorting, searching, filtering and paging happen in the browser on the full list.

ColumnMeaning
DiscoveredWhen the tool was first seen. Sortable.
Tool NameThe tool name. Click it to open the detail view. Sortable.
Input Policy, Output PolicyDropdowns that save the global policy at once. Sortable.
# CallsHover the header for a short explanation. How often the tool turned up. It goes up by one each time a gateway writes a batch of discovered tools that includes this one, so it is a trend, not an exact count. Recent invocations in the detail view lists the real calls. Sortable.
Team Name, Key Hash, Key Name, User, User AgentThe team, key and user of the request in which the tool was discovered, and that request's client user agent.

Search by Tool Name filters rows by text and, despite the placeholder, matches every column except Discovered, # Calls and User Agent. The refresh button reloads the list, and Filters opens a drawer with Input Policy, Output Policy, Team Name and Key Name dropdowns, each with an "All" choice that removes the filter.

Tool detail view​

Back to Tool Policies returns to the list. The header shows the tool name, its origin (the MCP server name, user_defined, or a dash), the number of calls, and when present the User Agent, First Discovered and Last Used times. Input Policy and Output Policy panels show the current policy's description and a dropdown that saves the global policy at once. Blocked for team or key and Block for team or key are described above. Recent invocations lists the most recent requests that called the tool, up to 50, newest first, with a Sample size and a click through to the request in the log details drawer. It uses the same log list as the Guardrails Monitor, so every entry is labelled Passed whatever the outcome, and the Blocked and Flagged filter buttons show nothing here. The same data is available with GET /v1/tool/{tool_name}/logs.

Errors​

WhereWhat you seeMeaning and fix
Table dropdown"Failed to update input policy" or "Failed to update output policy" with the reason, and the row keeps its old valueThe gateway refused the save, for example because the session is view only. Use a proxy admin session.
Detail viewA browser alert with the reason after a policy change, block or removeSame causes. Read the reason, which is the gateway's detail.
Block buttonDisabledNo team or key is chosen yet, or a change is saving. Pick one.
Key dropdown"No keys found"No alias among the first 100 keys matches. Type a different part of the alias.
Page"Tool Policies is only available to admin users."Your session role is not Admin or Admin Viewer.
Input Policy dropdownA confirmation dialog "Block this tool for everyone? ..."You picked blocked. Click OK to block the tool, or Cancel to keep the current policy.
List"No tools discovered" with "Send a chat request that offers tools, or call an MCP tool, and the gateway lists the tools it sees."Send a request whose tools list names the tool, or call it through MCP.
List"No matching tools"Clear the search or set the filters back to All.
List or detail"Failed to load tools" or "Failed to load tool details."Use the refresh button or Back to Tool Policies and try again. Check that the gateway has a database.
Recent invocations"No logs for this period. Select a guardrail and date range."The shared log list's wording. The tool has no recorded calls yet.

Logs​

The page writes no log lines of its own. Every save goes to POST /v1/tool/policy or DELETE /v1/tool/{tool_name}/overrides, whose log lines are listed on tool registry, and every change writes an audit row with the value before and after.

Differences by role and license​

RoleWhat changes
Admin (proxy_admin)Full page. Can change policies and add or remove blocks.
Admin Viewer (proxy_admin_viewer)Sees the full page under the view-only banner. The dropdowns and buttons are not disabled, but the gateway refuses the saves because they are writes, so every change fails with an error.
Org Admin, Internal User, Internal ViewerThe nav item is hidden and the page shows the admin only notice.

No license feature is checked on this page.