Return action outcomes an agent can interpret
Keep pending, denied, refused and unknown results explicit so a tool wrapper does not encourage duplicate side effects.
Returning only "error" after an uncertain refund invites the agent to try again. Return the existing operation identifier, known state and permitted next step. Keep that information structured so your application can enforce behavior independently of the model's interpretation.
Anlyon's invocation status and governed-effect grade describe different aspects of the result. A capacity refusal can have invocation status failed and grade refused. An unknown outcome means the external operation may have happened. Preserve those distinctions in the wrapper.
Define your application result
The following is an application-owned example shape, not an Anlyon API response:
{
"operationId": "refund-request-42",
"state": "unknown",
"nextStep": "operator_reconciliation",
"message": "The refund may have happened. Do not create another refund."
}
Map actual SDK responses into this shape after checking the response and error fields. Do not report confirmed merely because the transport returned 200.
Choose next steps by state
| Result | Application behavior |
|---|---|
| Pending approval | Surface the existing review request |
| Pending provider result | Observe the existing operation |
| Denied | Stop this request and report the decision |
| Refused | Report the specific boundary that prevented dispatch |
| Unknown | Preserve identity and route to reconciliation |
| Acknowledged | Report acceptance with its verification limitation |
| Confirmed | Report the specific verified outcome |
Do not delegate permission escalation to the model. A tool refusal should not expose an administrative shortcut that lets the agent raise its own limit.
Enforce outside the prompt
Persist operation identity, constrain available tools and reject prohibited duplicate or changed requests in application code. A sentence saying "do not retry" is useful communication, but it is not an execution control.
Test your mapping with recorded or controlled fixtures for each state. Include missing data, admission errors without receipts, and transport failure before your application receives a response.
Use outcome fields, operation identity and restart recovery.
