Authorization and isolation
Approval Gates
Human-in-the-loop approval for tool calls
Agentium supports requiring human approval before executing sensitive tool calls. Approvals work via callbacks, events, or REST API.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Agentium 4.0.0 · Upgrade from 3.x.
Human-in-the-loop approval for tool calls
import { Agent, openai } from "@agentium/core";
const agent = new Agent({
name: "careful-bot",
model: openai(process.env.OPENAI_MODEL ?? "gpt-6.1-sol"),
tools: [deleteTool, readTool],
approval: {
policy: ["delete_record"], // only this tool needs approval
timeout: 60_000,
timeoutAction: "deny", // "approve" | "deny" | "throw"
},
});
| Endpoint | Method | Description |
|---|---|---|
/approvals/pending | GET | List all pending approval requests |
/approvals/:requestId/approve | POST | Approve a pending request |
/approvals/:requestId/deny | POST | Deny a pending request |
/approvals/stream | GET (SSE) | Real-time stream of new approval requests |
const source = new EventSource("/approvals/stream");
source.onmessage = (event) => {
const request = JSON.parse(event.data);
// Show approval UI to human reviewer
showApprovalDialog(request);
};
| Action | Behavior |
|---|---|
"deny" (default) | Auto-deny when timeout expires |
"approve" | Auto-approve when timeout expires |
"throw" | Throw an error when timeout expires |