AI agents
Integrate an AI agent with AgentFlow — submit approval requests, track human decisions, and verify signed receipts.
AgentFlow puts a verified human decision between an AI agent's intent and the action it wants to take. The agent submits an approval request, a human reviewer decides it in the TrustLoop app, and the agent receives a signed receipt that proves the outcome.
The integration model
- Connect. An operator creates an AI agent connection in the console and gives you an access key. See Connections.
- Submit.
POST /api/v1/ai-agent/submitRequestcreates a request inpendingstate and routes it to a reviewer. Creating a request does not authorize the protected action. See Requests. - Wait for a human. Poll
getStatus, or receive theapproval.completedwebhook event. - Verify the receipt. On a final
approvedoutcome, fetch the Ed25519-signed proof withgetProofand verify it before performing the protected action. See Receipts.
pending is not permission. Do not perform the protected action on
request creation, assignment, or any non-final status. Authorization
requires a final approved status and its signed receipt.
Delivery modes
Each agent connection has a delivery configuration that controls how results reach the agent. All modes report the same canonical API state; polling is always available as the baseline.
| Mode | How it works | Enabled by |
|---|---|---|
polling | Agent calls getStatus, honoring nextPollAfterMs | Always on |
webhook | Signed approval.completed event POSTed to the connection's callback URL | Webhook delivery plus an HTTPS callback configured on the connection. See Webhooks |
API shape
All agent calls are HTTP POSTs against the same base:
POST /api/v1/ai-agent/<procedure>
x-ai-agent-key: <agent access key>
Content-Type: application/json
{"json": { ... }}Responses are {"json": { ... }} on success and a structured error
object on failure. On the hosted platform the API is
https://af-api.ivalt.com.
In this section
- Connections — agent connections, the
x-ai-agent-keyheader,getIdentity. - Requests —
submitRequest,getStatus,getRequest. - Webhooks — delivery config,
approval.completedevents, signature verification, retries, delivery error codes. - Receipts —
getProof, the signed receipt shape, Ed25519 verification. - API reference — generated schemas for every
ai-agentprocedure.