Integration · Custom agents
Any agent. Any runtime.
If your platform isn't listed in the integrations menu — a custom Python service, a TypeScript orchestrator, a Go microservice, a Power Automate flow — you can still certify every decision with a single HTTPS POST.
The integration surface
Whatever framework you use, the integration is one HTTP call per decision:
POST /v1/receipts
X-API-Key: ak_live_...
Content-Type: application/json
{ ...execution metadata... }Python (no framework)
import os, requests
def certify(agent_id, user_intent, output, tools, retrieval=""):
return requests.post(
f"{os.environ['AGENT_CERT_API_BASE']}/v1/receipts",
headers={"X-API-Key": os.environ["AGENT_CERT_API_KEY"]},
json={
"agent_id": agent_id,
"platform": "custom",
"user_intent": user_intent,
"agent_output": output,
"tools_used": tools,
"retrieval_summary": retrieval,
},
timeout=30,
).json()
# After your agent produces a decision:
receipt = certify(
"my_invoice_bot",
"Approve this invoice",
"approved",
["lookup_invoice", "lookup_vendor"],
)
print("Verify at:", receipt["verify_url"])TypeScript / Node
async function certify(opts: {
agentId: string;
userIntent: string;
output: string;
tools: string[];
retrieval?: string;
}) {
const r = await fetch(`${process.env.AGENT_CERT_API_BASE}/v1/receipts`, {
method: "POST",
headers: {
"X-API-Key": process.env.AGENT_CERT_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
agent_id: opts.agentId,
platform: "custom",
user_intent: opts.userIntent,
agent_output: opts.output,
tools_used: opts.tools,
retrieval_summary: opts.retrieval,
}),
});
if (!r.ok) throw new Error(`certify failed: ${r.status}`);
return r.json();
}Go
func Certify(agentID, userIntent, output string, tools []string) (map[string]any, error) {
body, _ := json.Marshal(map[string]any{
"agent_id": agentID,
"platform": "custom",
"user_intent": userIntent,
"agent_output": output,
"tools_used": tools,
})
req, _ := http.NewRequest("POST", os.Getenv("AGENT_CERT_API_BASE")+"/v1/receipts", bytes.NewReader(body))
req.Header.Set("X-API-Key", os.Getenv("AGENT_CERT_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { return nil, err }
defer resp.Body.Close()
var out map[string]any
return out, json.NewDecoder(resp.Body).Decode(&out)
}Shell (curl)
For one-off tests or shell-based pipelines:
curl -X POST "$AGENT_CERT_API_BASE/v1/receipts" \
-H "X-API-Key: $AGENT_CERT_API_KEY" \
-H "Content-Type: application/json" \
-d @decision.json | jq .verify_urlWhere to call from
- Web request handler — certify after generating the response, before returning to the client. Add the verify_url to the response payload.
- Queue worker — certify as part of message processing. Persist the receipt_id alongside your domain record.
- Cron / scheduled job — certify each batch decision. Store the verify_urls in your audit log.
- Streaming agent — certify on stream-end (when the full response is finalized). The execution metadata you send is the complete answer, not the partial chunks.
Required fields
| Field | Type | Notes |
|---|---|---|
agent_id | string | Stable identifier for the agent. Used to group receipts and bind policies. |
platform | string | One of bedrock / copilot / langchain / crewai / custom. |
user_intent | string | What the user asked. |
agent_output | string | The final answer / decision your agent produced. |
tools_used | string[] | Tools / functions the agent invoked during this execution. |
Optional fields
| Field | Notes |
|---|---|
retrieval_summary | Summary of RAG / KB / database reads, in plain language. |
policy_rules | Ad-hoc rules to enforce on this call only. |
policy_id | OR — reference a Policy you defined at /policies. |
model | Name of the LLM (e.g. claude-3-7-sonnet). |
metadata | Free-form JSON for anything else you want signed into the receipt. |