Scan a tool's output
Inspect a tool's returned output before it re-enters the agent loop.
Inspect a tool's returned output before it re-enters the agent loop.
Your API key as a bearer token.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/agent/tool-output" \ -H "Content-Type: application/json" \ -d '{ "tool_name": "string", "output": "string" }'{
"job_id": "string",
"decision": {
"action": "ALLOW",
"engine_action": "ALLOW",
"needs_review": true,
"confidence": 0.98,
"suggestion": "ALLOW",
"rationale": "Prompt-injection pattern detected.",
"score_breakdown": {}
},
"policy": {
"directives": [
"string"
],
"matched_rule_ids": [
"string"
]
},
"language": {
"language": "string",
"detected": "string",
"confidence": 0,
"source": "string",
"hint_agrees": true,
"support_status": "string",
"model_set": "string",
"degraded": true,
"message": "string"
},
"tool_name": "string"
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}Scan a proposed tool call POST
Inspect a proposed tool call before execution.
Subscribe to a session's live event stream GET
Server-Sent Events. Every scan (`/scan`, `/rag/*`, `/agent/*`) that carries the same `session_id` publishes a compact decision summary here the moment it's made (no scanned text, tool arguments, or redacted content ever appears on this stream, only the decision itself). This is what the SDK's `subscribe()` connects to. Three event shapes appear as `data:` frames, distinguished by `stage`: - A decision (`stage`: `prompt`, `rag`, `tool`, or `response`): `action`, `risk` (0-100), `latency` (ms), the policy directives that fired, a `job_id`, and a `pii` summary when any was found. `action` is the engine's label (lowercase, so `review` appears here). `needs_review` (boolean) and `enforced_action` (`allow` or `block`, the action the gateway enforced after applying your app's `reviewCollapse` setting) are added from the `review_flag` release onward. `tool`/`rag` stages also carry `phase` (`call`/`output` or `chunk`/`context`) and, for `tool`, the tool name. - `{"stage": "audit", "id": "<job_id>"}`: sent once that job's decision has been durably persisted, always after that job's decision event. - `{"stage": "_meta", "dropped": <n>}`: this connection fell behind and missed `n` events; never sent silently. The connection is long-lived: it stays open with periodic keep-alive comments until the caller disconnects. Capped at 40 concurrent connections per organization.