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
Checking approval status
When a tool call comes back asapproval_required, an approver has been asked to allow or deny it in Slack. Hold the call and poll this endpoint until they answer.
Authorization: Bearer <UNBOUND_API_KEY>.
Request
Send back both values you were given inapprovalCheck — the requestId and the policyIds:
Response
pending is the safe default. If the request can’t be resolved — a missing requestId, or a transient failure — the endpoint answers pending rather than guessing, so a held tool call is never released by accident.That means pending is not self-terminating. Decide your own limit — a maximum number of polls, or a deadline — and choose what happens when you hit it. Treating a timeout as deny fails closed; treating it as allow fails open. Pick the one that matches your security posture, and surface the wait to your user so the agent doesn’t just look hung.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 UIapproval_required— do not execute. Hold the call and poll the approval-status endpoint until the approver decides. See the full contract in Decision Values
- Treat an unrecognized
decisionasdeny. New decision values can be added over time; a client that falls through to “execute” on a value it doesn’t know can bypass a guardrail. Default the unknown case to blocking, not allowing - 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

