Approval Management
List pending approval requests with the request under review, and approve or reject them.
Approval requests are created by the gateway when policy returns require_approval. Humans with the owner, admin, or approver role decide them here. Lifecycle and binding rules: Human approvals.
List approvals
Listing also marks pending requests past their expires_at as expired. Each item includes what an approver needs to decide: the tool, operation, resource, redacted arguments, request time, and the policy reason.
/api/v1/approvalsList approval requests
Implemented for owner, admin, and approver. Agents cannot call this route.
Responses
200ApprovalPageApproval page
curl -X GET "http://127.0.0.1:8080/api/v1/approvals" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Approve
Approving records the deciding user and time, and appends approval.decided. It does not execute anything; the agent's next execute call with this approval_id consumes it.
/api/v1/approvals/{approvalId}/approveApprove the exact bound payload
The caller must be a human approver, admin, or owner in the same organization. The same user id cannot approve an agent with that id. The approval binds to payload_hash and expires.
Parameters
approvalIdpath · string (uuid)required
Responses
200ApprovalApproved, not yet consumed
409ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/approve" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
| Error | Cause |
|---|---|
403 self_approval | The deciding user's id equals the agent id |
404 not_found | No such approval in your organization |
409 approval_expired | expires_at has passed |
409 conflict | The approval is not pending |
Reject
/api/v1/approvals/{approvalId}/rejectReject an approval request
A rejected approval cannot be replayed.
Parameters
approvalIdpath · string (uuid)required
Responses
200ApprovalRejected approval
curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/reject" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
A rejected approval cannot be approved or consumed. The agent's execute call returns 409 conflict.
Reserved
/api/v1/approvals Reserved · not registeredRecord an approval request for an existing authorization decision
Not implemented. Reserved for the gateway service identity. Agent credentials and the agent that initiated the action are rejected.
Request body · required
authorization_decision_idstring (uuid)requiredpayload_hashstringrequiredpattern
^[0-9a-f]{64}$expires_atstring (date-time)required
Responses
201ApprovalPending approval
403ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/approvals" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
This operation is reserved in the contract for a gateway service identity and is not registered. Approval requests are created only by the gateway, bound to the exact request body, so no caller can mint one.
Was this page helpful?