Overview
The Tool Policy Hooks endpoint lets you enforce your organization’s tool policies on agent tool calls. Before your agent executes a tool — whether it’s a terminal command, an MCP tool, or any other action — your agent sends an inbound request to this endpoint and the gateway returns a decision. This is a request the agent makes to Unbound; Unbound does not call out to your agent. Any agent framework or custom application can integrate with it. Policies are configured at gateway.getunbound.ai/policies/tool-policies.Endpoint
Authentication
Include your API key in the Authorization header:Request Body
pre_tool_use_data Object
Response
Decision Values
How It Works
The endpoint handles two types of tools differently: Terminal commands (Bash, Shell, exec): The command is automatically classified and matched against your configured terminal command policies.
MCP tools: The mcp_server and mcp_tool from metadata are matched against your MCP tool policies.
Other tools: Tools that don’t match a terminal command or MCP tool pattern return allow.
Examples
Terminal Command (Blocked)
Terminal Command (Allowed)
MCP Tool
Error responses
The gateway currently returns200 OK with decision: "allow" for requests that are malformed or unauthenticated — a fail-open posture. There is no structured error envelope today.
This is the current behavior, not an aspirational contract. If you need a structured error response shape, file a request with Unbound support.
Integration Guide
To integrate tool policies into your agent framework:- Before each tool execution, send a
POSTrequest to/v1/hooks/pretoolwith the tool details - Check the
decisionin the response:allow— execute the tool normallydeny— block execution and surface thereasonto the userask— prompt the user for confirmation, or treat asallowif your agent has no interactive UI
- Handle errors gracefully — if the endpoint is unreachable, decide whether to fail open (allow) or fail closed (deny) based on your security requirements
- Configure policies at gateway.getunbound.ai/policies/tool-policies

