Skip to Content
AgentShield
API Reference

Tool Execution

The authorize-then-execute flow over HTTP, with complete request and response examples for allow, deny, approval, and adapter results.

A tool call is two signed requests to the gateway. This page walks through both with concrete bodies. For the lifecycle and guarantees, see Tool execution lifecycle.

1. Authorize

POST /api/v1/runtime/authorize
{
  "agent_id": "3f2b8c1e-6a4d-4f7e-9b21-5c8d0e7a4b13",
  "organization_id": "9a7e5d2c-1b3f-4c6a-8e0d-2f4b6a8c0e1d",
  "execution_id": "c4d6e8f0-2a4c-4e6a-8c0e-1a3c5e7a9b2d",
  "tool_name": "http.request",
  "operation": "http.get",
  "resource": "https://api.github.com/repos/octo/hello",
  "arguments": { "headers": { "Accept": "application/json" } },
  "requested_at": "2026-11-30T12:00:00Z",
  "idempotency_key": "idem-5f0d2c8e9a1b4c7d9e0f1a2b3c4d5e6f"
}
{
  "decision_id": "7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b",
  "outcome": "allow",
  "explanation": {
    "policy_id": "2e8d…",
    "policy_version": 3,
    "matched_rule": "allowed:http.get",
    "reason": "allowed"
  }
}

2. Execute

POST /api/v1/runtime/execute
{
  "decision_id": "7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b",
  "idempotency_key": "idem-5f0d2c8e9a1b4c7d9e0f1a2b3c4d5e6f",
  "arguments": { "headers": { "Accept": "application/json" } }
}

For a require_approval decision, add "approval_id" after a person approves it.

200 OK
{
  "decision_id": "7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b",
  "outcome": "allow",
  "adapter": "http.request",
  "result": {
    "status": 200,
    "headers": { "Content-Type": "application/json; charset=utf-8" },
    "truncated": false,
    "json": { "id": 1296269, "full_name": "octo/hello" }
  },
  "analysis": { "status": "clean", "ruleset": "2026.11.1", "verdict": "none", "findings": [] }
}

analysis is present only when the gateway has INTELLIGENCE_URL.

Execute errors

StatusCodeCauseRetry?
400validation_failedBody invalid, or the adapter rejected the call (non-canonical URL, host not allowed, blocked address, unsupported argument)Fix the request; authorize again
403forbiddenThe decision is deny, or the agent is no longer activeNo
404not_foundNo such decision for this agentNo
409approval_requiredrequire_approval without an approved approvalAfter approval
409approval_expiredThe approval expiredAuthorize again
409conflictIdempotency key or arguments mismatch, approval mismatch or rejected, or a previous attempt failed or was interruptedAuthorize again
500internal_errorAdapter timeout ("tool adapter timed out") or a server failureAuthorize again
501not_implementedNo adapter for the tool or operationNo
503circuit_openThe tool's circuit is openAfter 30 s

Sample adapter

sample.echo ignores arguments and returns its inputs:

{
  "decision_id": "…",
  "outcome": "allow",
  "adapter": "sample.echo",
  "result": {
    "adapter": "sample.echo",
    "label": "sample adapter with no external side effect",
    "operation": "sample.echo",
    "resource": "demo"
  }
}

Full contracts

Was this page helpful?

On this page