← AI Agents docs

Edge cases & rollback

From docs/agents/EDGE_CASES_AND_ROLLBACK.md

Edge Cases and Rollback

Owner rejects payout or channel

  • Behaviour: If the owner rejects a payout request or denies a channel approval, suspend the agent (e.g. set status to claimed or a dedicated suspended value) and log the reason.
  • Effect: Agent cannot request new payouts or use new channels until the owner re-approves. Existing pending payouts remain in their current status (e.g. cancelled if owner explicitly cancels).
  • Rollback: Owner can clear suspension and re-approve channel or request a new payout flow.

Webhook signature validation fails

  • Behaviour: If POST /api/v1/referrals/webhook signature validation fails, reject the request (401) and do not insert a referral. Optionally flag the agent or IP for review.
  • Payout impact: Halt automatic payouts (e.g. auto-approve) until the owner has re-verified the webhook secret and re-approved payout behaviour. Do not auto-approve new payout requests until the owner has confirmed.
  • Rollback: Owner rotates webhook secret if compromised; confirms signature implementation; re-enables auto-approval if desired.

Referral attribution fails (no user_id captured)

  • Behaviour: Use idempotent logic: send a stable referral_id in the webhook body so the same event is not double-counted. If a referral row cannot be created (e.g. missing required field), retry with the same payload (idempotent by external_referral_id). If it still fails after retries, log for audit (no PII in logs) and alert owner.
  • Rollback: Fix attribution (e.g. pass user_id or referral_id from source); backfill or correct data via admin if needed.

Agent suspended by policy or rate limit

  • Behaviour: Move agent to limited/suspended state; no payouts and no new promotions until remediated. Notify owner with reason and remediation steps.
  • Rollback: Owner addresses violation; support clears suspension and sets status back to active (or equivalent) after review.

Ration ale (typo in original: “ration ale” → treat as “rationale”)

  • Behaviour: When suspending or rejecting, log the rationale (e.g. “owner rejected payout”, “rate limit exceeded”, “webhook signature invalid”) for audit and support.

Last updated: 2026-03-14.