Source: vercel.com/changelog/vercel-sandbox-adds-session-lifecycle-webhooks
Vercel Sandbox can now notify backends through three events: sandbox.session.started, sandbox.session.expiring, and sandbox.session.stopped. They are enabled in a team's webhook settings. Each event carries sandbox and session details so a backend can identify which session is affected.
Stopped events report a stop reason of requested, snapshot, timeout, exited, or error, along with the session's duration, active CPU time, and network transfer. Vercel sends the expiring event one minute before a session times out, or at the lead time set by expiryNotificationLeadTime, and sends a new warning before each extended timeout.
Agents can subscribe to the same events through Vercel MCP. An agent that creates a sandbox can listen for sandbox.session.expiring and call extend_session_timeout to keep it running. Vercel also shows a workflow that waits on these events and extends the session while the agent is still working.
Why it matters if you build agents
Agent code no longer has to poll sandbox state to learn when a session is near its timeout. It can extend a session only while work is still in progress, or clean up after a stop.
Events can be delivered more than once, so handlers should deduplicate on the session ID and, for expiring events, on sandbox.expiresAt.
Get stories like this every weekday
One short email with the day's agent tooling news.