Before You Start
You need:- an Averta API key with an attached policy
- a provider API key for the model you already use
- code that can call
POST https://api.averta.io/v1/decide - stable IDs for request context
Request Flow
Call Averta before and after the provider operations your agent performs:- Call the
requestcheckpoint before the provider sees user input. - If the decision is
block, stop before the provider call. - If the decision is
restrict_tools, remove the blocked tools, then call the provider with the reduced tool list. - If the model requests a tool, call the
tool_callcheckpoint before executing it. - After your tool returns data, call the
tool_resultcheckpoint before sending that data back to the model. - When the provider returns final text, call the
outputcheckpoint before returning it to the user.
Minimal Request Check
Decision Handling
Your adapter must handle every valid decision for the checkpoint it calls:| Decision | Adapter behavior |
|---|---|
allow | Continue to the next step. |
block | Stop before crossing the next boundary. Do not call the provider, execute the tool, send the tool result, or return the output. |
restrict_tools | Remove blocked_tools from the provider tool list before provider execution. |
rewrite | For output checkpoints, request a safer replacement and check that rewritten output once. |
Tool Filtering
For tool-using agents, send tools on the request checkpoint:send_email before calling the provider.
Media
For image-capable adapters, send supported images in the request checkpointmedia array. Keep text in payload.text.
Endpoint Reference
Create decision
Full request and response fields for
POST /v1/decide.Checkpoints
Understand when each checkpoint runs.
Policies
See how API keys map to enforcement.
Request context
Correlate API decisions with application logs.