Durable event infrastructure for agents.
Most real agent work involves waiting: for a payment to settle, a build to finish, a customer to reply or a manager to say yes. Today that means polling, glue servers and lost events.
Agents run in sandboxes, serverless functions and laptops. Stripe and GitHub need a public HTTPS URL to call.
An agent sleeps, times out or restarts. An event that lands while it's down is gone, so teams poll instead and pay for it in tokens and rate limits.
A webhook body is text written by someone else, going straight into a model's context: oversized, noisy and a prompt-injection risk.
Four steps between an event out in the world and your agent acting on it.
Point Stripe, GitHub, Slack or any webhook at an Ensue endpoint. Signatures are checked against the provider's own secret.
Every event lands in the agent's inbox and stays there until it's acked, so a crash or timeout means redelivery, not loss.
A transform turns the raw payload into an agent view: only the fields that matter, small enough to stay cheap.
Ensue wakes your agent with a signed hook, or over a stream the agent opens itself, so it works on a laptop too. The agent pulls its events over HTTP or MCP and acks each one.
# Wait up to 30 s for events; each one comes with a lease curl "https://api.getensue.com/v1/agent/inbox/dst_…/next?wait=30" \ -H "Authorization: Bearer ens_…" # Done? Ack it. Crash or run out of time, and it comes back. curl -X POST https://api.getensue.com/v1/events/evt_9f2c1a/ack \ -H "Authorization: Bearer ens_…" \ -d '{ "lease_id": "lse_…", "outcome": "Fixed null check, PR #812" }'
# Start headless Claude Code whenever the inbox has work. # The stream is opened outbound, so no public URL is needed. ENSUE_API_KEY=ens_… ENSUE_INBOX=dst_… \ node ensue-wake.mjs run --on-start -- \ claude -p "Pull the events in Ensue inbox $ENSUE_INBOX with next_events, handle each one, and ack it."
// Wait for the payment this task asked for wait_for_event({ source: "stripe", correlation: "t_42" }) → { pending: "sub_…" } // call again with it to keep waiting wait_for_event({ subscription: "sub_…" }) → { event: { event_id: "evt_9f2c1a", lease_id: "lse_…", view: { … } } } ack_event({ event_id: "evt_9f2c1a", lease_id: "lse_…" })
Ensue tells your agent there's work, then hands over events as it pulls them. You keep your runtime, framework and cloud.
Start a headless run, or nudge an open session, whenever the inbox gets work.
An Agents SDK agent sleeps until its wake hook fires, then pulls and acks its events.
Tools to wait for an event, pull, ack, release and subscribe, from any agent that speaks MCP.
A signed wake to any URL, with bearer, basic or API-key auth to get past your gateway.
No public URL needed. The agent opens a stream outbound and is told when to pull.
Keep a WebSocket open and get events pushed as they arrive, leased like a pull.
Starting an agent costs money and tokens. Ensue decides when to wake it and what goes into its context.
Transforms turn a raw webhook into the handful of fields a model needs, so context stays small and cheap.
{
"action": "completed",
"check_run": {
"id": 2831049...,
"node_id": "CR_kwDO...",
"head_sha": "9f2c1a...",
"external_id": "...",
"url": "https://api...",
"html_url": "https://...",
"details_url": "...",
"status": "completed",
"app": { "id": 15368,{
"repo": "acme/api",
"branch": "fix/login",
"check": "unit-tests",
"conclusion": "failure",
"failed": [
"auth.test.ts:41"
],
"log_tail": "Expected 200…"
}Each delivery holds a lease. If the agent crashes or runs out of time before acking, the event goes back in the inbox and is delivered again.
Twelve pushes in thirty seconds start one agent, not twelve.
An agent that keeps waking itself is stopped until a person lets it continue.
Signatures are checked before the agent sees anything, and every payload is marked as untrusted data.
Forty updates to one CI run reach the agent as one event with the latest state. Final states always arrive on their own.
Every event is kept. Replay last week's events into another inbox to try a new version of your agent.
A coding agent wakes on a red CI check, reproduces the failure and opens a PR.
A purchasing agent sends a payment link, sleeps, and picks up fulfilment the moment Stripe confirms.
A triage agent wakes for each new Linear issue, labels it and assigns an owner.
We're onboarding teams building agents in waves. Tell us where your agents run and we'll prioritise that destination.