Hooks classify
Classifies agent tool calls into permission tiers as part of the Docker agent pre-tool-use hook system. This endpoint is called by the hook script running inside Docker agent containers, not by end users directly. When a Docker agent invokes a tool, thepre-tool-use hook script sends the tool name and input to this endpoint. The classifier evaluates the request and returns one of three outcomes:
- Safe — auto-approved, the agent proceeds immediately
- Dangerous — queued for dashboard approval via the permissions API
- Destructive — blocked, the agent cannot proceed
This endpoint uses internal API key authentication, not session-based auth. It is designed to be called by the hook script running inside the agent container, not by the dashboard or end users.
Classify a tool call
requestId that can be resolved through the permissions API. Destructive tools are blocked.
Authentication
Requires a valid internal API key in theAuthorization header:
Request body
Response
The response shape depends on the classification tier.Safe (auto-approved)
Dangerous (queued for approval)
Destructive (blocked)
Response fields
Errors
Hook flow
The classify endpoint is one step in the Docker agent pre-tool-use hook flow:- The agent invokes a tool inside its Docker container
- The
--hook-pre-tool-useflag triggers the hook script - The hook script sends the tool details to
POST /api/hooks/classify - The endpoint classifies the tool call and returns a decision
- For
dangeroustier results, the server pushes apermission_requestmessage to the dashboard via the WebSocket endpoint (the dashboard can also pollGET /api/permissionsas a fallback) - The user approves or rejects via
POST /api/permissionsor through the WebSocketdecisionmessage - The agent receives the decision and proceeds or stops