Track your app’s errors with a Sentry SDK, without a Sentry account, from your AI agent
Your app crashes, and you find out from a customer. With while, its errors arrive through a Sentry SDK, with no Sentry account to open, and a never-seen-before error alerts your AI agent, which reads the stack trace and fixes it.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 2, 2026.
Prerequisites
- An app in Node.js, Python, Go or any other language that has a Sentry SDK.
- An AI agent that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.
Step 1: Give your agent these instructions
Open your agent in your app’s folder, and paste these instructions into it:
Connect to while with my account (while.sh/agents), then deploy my app.
Your agent adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose “A new app”, then click Authorize.
Step 2: Stop watching for errors
When a never-seen-before error comes in, your agent is notified, reads the stack trace, fixes the code and offers you the new version.
What your agent does
It adds the Sentry SDK to your app and connects it to SENTRY_DSN, which your app already receives1:
import * as Sentry from '@sentry/node';
Sentry.init({ dsn: process.env.SENTRY_DSN });
It loads the SDK before the rest of your app, as Sentry requires:
"scripts": {
"start": "node --import ./instrument.js server.js"
}
There is nothing to open at Sentry and nothing to configure in while: the address points to while, and it works even if your app has no internet access, which is the default. Errors are grouped, and each one keeps its stack trace.
Understand what is crashing
You, to your agent: What has been crashing since the last deployment?
Your agent reads the grouped errors in while, finds the line at fault, fixes it and deploys again.
Track browser errors too
You, to your agent: Add the browser errors too.
Your agent connects the Sentry SDK in your pages to SENTRY_DSN_PUBLIC, the address made for the browser.
Connect a Python API
You, to your agent: Hook up error tracking for our FastAPI API.
The Sentry SDK for Python connects the same way, with the same variable:
import os
import sentry_sdk
sentry_sdk.init(dsn=os.environ.get("SENTRY_DSN"))
Go back to the previous version
You, to your agent: Go back to the previous version.
In the 30 minutes after a deployment, the previous version comes back in a second. After that, it takes a few seconds. Once the previous version is back, your agent reads what broke in while’s logs, fixes it and deploys again.
In the docs: Errors (Sentry) and Versions and rollback.
Next steps
Sources
- Sentry, the SDK for Node.js, accessed November 2, 2026