{"slug": "why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip", "title": "Why UNIQUE(event_id) Is the Double-Charge Defense Your Agent Rail Can't Skip", "summary": "IronVision Nexus, led by Sam Hiotis, has implemented a UNIQUE(event_id) constraint in its order ledger to enforce idempotency for payment webhooks, ensuring that duplicate events are rejected and cannot cause double charges. The system verifies webhook signatures on the raw body and uses event_id as the natural key, making the defense auditable and particularly suited for AI agents that may retry or parallelize requests.", "body_md": "*FractalMesh / IronVision Nexus · son, real engineering, no buzzword theater*\n\nEvery payment integration — AI agent or otherwise — has one feature buyers\n\nactually verify before trusting it with money: **can it charge me twice?**\n\nNot \"will it behave.\" Can it *physically* fail in the way that hurts people.\n\nThe cloud-favorite answer is \"webhooks are at-least-once delivery, so make\n\nyour handler idempotent.\" That's a recommendation. This is the enforced version:\n\nOur order ledger stores every event against `UNIQUE(event_id)`\n\n. The webhook\n\nsignature is verified **on the raw body**; the event_id is the natural key for\n\nthat exact charge. If the same event arrives twice — retries, at-least-once\n\nredelivery, a replay, a bug — the second insert hits the UNIQUE constraint and\n\nis **rejected, not debited**.\n\nTwo things happen on a duplicate:\n\nNo double bill. Ever. The database enforces it, not a promise in the handler.\n\nAn AI agent that moves money does not handle \"maybe the SDK throttled, maybe\n\nI retried\" gracefully the way a booked-in-advance human flow does. Agents\n\nretry. Agents parallelize. Agents are exactly the clients that hit your\n\nendpoint more than once and need the *same answer, once.*\n\nBank-grade idempotency keys are table stakes for agent-to-agent payments:\n\nthe reader should get idempotent, deterministic settlement without being\n\nasked to \"just be careful not to double-submit.\"\n\nNone of this is magic. Our live balance is real — currently `-A$462.00`\n\n, zero\n\ncustomers, funnel not yet public. We are not pretending otherwise. The reason\n\nthis proof is worth stating is that it's **auditable**: point a second request\n\nat the same event_id and watch the ledger hold the line.\n\nSovereign automation. Verified by charge. Zero fabrication.\n\n*Built by Sam Hiotis · IronVision Nexus Pty Ltd · ABN 56 628 117 363*", "url": "https://wpnews.pro/news/why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip", "canonical_source": "https://dev.to/sam_hiotis_117598dbfa3ac2/why-uniqueeventid-is-the-double-charge-defense-your-agent-rail-cant-skip-5df0", "published_at": "2026-08-28 23:48:20+00:00", "updated_at": "2026-08-29 00:18:58.578682+00:00", "lang": "en", "topics": ["ai-agents", "ai-infrastructure", "developer-tools"], "entities": ["IronVision Nexus", "Sam Hiotis"], "alternates": {"html": "https://wpnews.pro/news/why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip", "markdown": "https://wpnews.pro/news/why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip.md", "text": "https://wpnews.pro/news/why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip.txt", "jsonld": "https://wpnews.pro/news/why-unique-event-id-is-the-double-charge-defense-your-agent-rail-can-t-skip.jsonld"}}