Handle Nava Guardian verdicts
Developer Preview
Poll the status resource with the same agent key used to create the request:
GET /transactions/:requestHash/approval-status
x-api-key: <agent-api-key>The response is an approval-status envelope. Read Nava Guardian's result from
verdict.
The following JSON is an abridged excerpt showing the decision fields. The actual verdict contains the complete schema documented in the API reference.
{
"verdict": {
"schemaVersion": 1,
"outcome": "rejected",
"reasonCode": "chain_not_allowed",
"humanReason": "The proposed chain is not allowed by the active policy.",
"triggeringPolicyField": "venues.uniswap.chainAllowlist"
}
}The full verdict includes checks, evidence, policy version, freshness, trust, redaction, latency, notional, and timestamp fields. See the Nava Guardian API reference for the complete schema.
Treat outcome as authoritative
| Outcome | Builder behavior |
|---|---|
pending | Keep the action paused and poll again after backoff. |
approved | Stop polling. The builder may continue its own signing and venue-submission flow for this exact action. |
rejected | Stop polling and do not submit. Surface reasonCode, humanReason, and triggeringPolicyField when present. |
An absent or null verdict means no Guardian verdict is available yet. Treat
it like a non-terminal state within the same bounded polling window, never as
approval.
Poll safely
Use exponential backoff with a maximum delay, a maximum attempt count, and an
overall abort signal or deadline. Stop immediately on 401 or 403. A bounded
retry of the GET is safe after 429, a transient 5xx, or a network interruption,
but the action must remain paused throughout.
Fail closed when:
- the attempt or time limit expires;
- the response is not JSON or does not match the expected envelope/verdict;
- authentication or ownership fails;
- Nava Service remains unavailable;
- an unknown
outcomeappears.
Do not retry an unchanged deterministic rejection. Correct the proposed action, or make a deliberate reviewed policy change, then submit a new request.
The runnable example in examples/guardian-node implements bounded exponential
backoff, an abort signal, terminal verdict handling, and fail-closed errors
without logging the API key.
Read the tested polling implementation
// [!include ../../../../examples/guardian-node/index.mjs:guardian-poll]Try the branching rule
Edit the outcome and run this local sandbox. It makes no network requests.