ToolPause SDKs
Libraries so agents can gate tool calls against a running ToolPause server.
Quick path: developers.md · HTTP contract: api.md
Python
Install (agent apps)
pip install toolpause
Install (server + Inbox UI)
pip install "toolpause[server]"
toolpause-server
# open http://127.0.0.1:8000/
Protect a tool
from toolpause import protected_tool
@protected_tool(
risk="high",
backend_url="http://127.0.0.1:8000",
api_key="YOUR_SERVICE_KEY", # if auth is enabled
agent_id="billing-agent",
)
def send_refund(customer_id: str, amount: float) -> dict:
...
When the agent calls send_refund, ToolPause evaluates policy, waits for Inbox approval if required, then runs the function.
If the operator uses Respond in Inbox, the decorator returns the human’s text and does not execute the function. Denials may include a structured reject_reason_code (see security.md).
HTTP client (no decorator)
from toolpause import ToolPauseClient, ToolCallRequest, RiskLevel
with ToolPauseClient("http://127.0.0.1:8000", api_key="...") as client:
clearance = client.gate(
ToolCallRequest(
tool_name="send_refund",
arguments={"customer_id": "c1", "amount": 20},
risk=RiskLevel.HIGH,
agent_id="billing-agent",
)
)
# use clearance.arguments (may be edited), then complete after exec
Framework helpers
Wrappers are available for LangChain, CrewAI, OpenAI Agents, and LangGraph via the Python package integrations.
TypeScript / Node
Install
npm install toolpause
Gate a tool call
import { ToolPauseClient, protectedTool } from "toolpause";
const client = new ToolPauseClient({
baseUrl: "http://127.0.0.1:8000",
apiKey: process.env.TOOLPAUSE_API_KEY, // or ACTIONGATE_API_KEY
});
const sendRefund = protectedTool(
async (customerId: string, amount: number) => {
return { status: "refunded", customerId, amount };
},
{
client,
toolName: "send_refund",
risk: "high",
agentId: "billing-agent",
mapArgs: (customerId, amount) => ({ customer_id: customerId, amount }),
},
);
await sendRefund("cust_42", 49.99);
What you need
| Piece | Who | How |
|---|---|---|
| ToolPause server + UI | Operator | pip install "toolpause[server]" → toolpause-server |
| Python SDK | Developer | pip install toolpause |
| TypeScript SDK | Developer | npm install toolpause |
| API key | Operator | Settings → Rotate API key |
Agents call the SDK; humans clear calls in the Inbox.