Loading...
Loading...
OmegaEngine · Human-in-the-Loop
High-risk authorizations are escalated for human review before execution. The agent gets back approval links to poll, a human approves in the ops queue, and the agent claims a one-time execution capability — full oversight without slowing down low-risk operations.
Your agent calls POST /api/authorize. OmegaEngine evaluates risk level, policy compliance, and safety checks.
Escalated decisions return approval_id plus hypermedia links: approval_status_url to poll, human_action_url where a reviewer approves, and execution_start_url to claim. Configured approval webhooks fire on escalated / approved / rejected.
Once approved, the agent claims a one-time execution_capability token at POST /api/authorize/approval/claim. Second claims are rejected (409), and everything is logged.
// 1) Ask for authorization
const res = await fetch("https://omegaengine.ai/api/authorize", {
method: "POST",
headers: { "Content-Type": "application/json", "x-api-key": process.env.OMEGA_API_KEY },
body: JSON.stringify({
agent_id: "payments-agent",
action: "wire_transfer",
tool_name: "bank.wire_transfer",
tool_args: { destination_account: "external-bank", amount: 15000, currency: "USD" },
amount: 15000,
vendor: "external-bank",
risk_level: "high",
metadata: { user_id: "user_123" },
}),
});
const response = await res.json();
if (response.decision === "escalated") {
// 2) Poll response.approval_status_url until a human approves
// at response.human_action_url (/ops/approvals).
// 3) Claim the one-time execution capability (Idempotency-Key required)
const claim = await fetch("https://omegaengine.ai/api/authorize/approval/claim", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.OMEGA_API_KEY,
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
authorization_id: response.authorization_id,
agent_id: "payments-agent",
}),
});
const claimed = await claim.json();
// claimed → { ok, decision: "approved", execution_capability, capability_expires_at, ... }
// Still pending → 409 { status: "pending" }; already claimed → 409 CAPABILITY_ALREADY_CLAIMED.
await executeTransfer({ capability: claimed.execution_capability });
} else if (response.decision === "approved" && response.execution_capability) {
// Low-risk exact action: proceed with the capability.
await executeTransfer({ capability: response.execution_capability });
}// Fired to your configured approval webhook (APPROVAL_WEBHOOK_URL)
// on escalated | approved | rejected — HMAC-signed when a secret is set.
{
"event": "approved",
"timestamp": "2026-02-05T15:30:00Z",
"approval": {
"id": "apr_abc123",
"title": "wire_transfer",
"kind": "authorize_action",
"riskScore": 0.82,
"agentId": "payments-agent",
"status": "approved",
"escalationLevel": 0,
"reviewedBy": "user_reviewer"
},
"sla": {
"timeoutHours": 24,
"deadline": "2026-02-06T15:30:00Z",
"currentRole": "operator"
}
}Escalated decisions carry a machine-readable reason_code so agents can react programmatically:
The evaluated risk score crossed the escalation threshold — a human must approve before execution.
The action's category (e.g. financial, destructive) is configured to always require human approval.
Layered safety checks flagged the request for human review instead of outright denial.
Policy marks this exact action as approval-gated regardless of score.
A successful claim returns a single-use execution_capability token with an expiry. A second claim returns 409 CAPABILITY_ALREADY_CLAIMED.
Claims require an Idempotency-Key header — retries replay the original result instead of double-claiming.
HMAC-signed webhooks fire on escalated, approved, and rejected — point them at Slack, PagerDuty, or your own service.
Approvals carry an SLA deadline and escalation level, surfaced in the webhook payload and the ops queue.
View, approve, or reject pending decisions in the review dashboard. Available to authorized reviewers in your organization.
HITL is not a separate add-on — it is included in the Pro plan ($799/mo) and above. See the pricing page for the full plan comparison.