Sentry AI code review, now in beta: break production less
Sentry AI code review, now in beta: break production lessThis could’ve been prevented.
This should have been prevented.
This too.
We all hate getting tagged in PRs. The time, the blame for when you inevitably miss something, and constant “I wouldn’t have written it that way” feeling is just hard to shake. LLMs promised this would get easier. Promised they would do it for us. But as we’ve seen, we’re not there yet.
But this is what Sentry does for a living. We catch bugs… in prod. What if we brought that same expertise to when code is being reviewed? Genius, right?
We added some new capabilities to our AI code review that pulls in your Sentry issues to actually predict bugs when you open a pull request. It won't prevent every error from happening. There are just too many factors outside your poorly written (or prompted) code to factor in, but it will keep you from shipping avoidable mistakes that take prod down.
Bring Sentry context into your PR
With AI tools, context is everything. It’s how Seer saved developers over two years of collective time during its beta. Our AI code review takes the same approach, but before you ship: it draws on Sentry’s context and historical signal with the code you just touched: the rest of the function, the in-repo functions it calls, and the classes or objects it depends on.
That blend of live code context plus real-world issue history makes its feedback specific and actionable, not vague warnings and generic linting advice.
Predict and prevent the errors that matter most
Automated PR reviews – even ones with full repo context – often bury real issues under style nits and best practices, forcing you to find the UnboundExecutionError in a sea of "consider inlining" and “prefer async/await".
Sentry’s code review doesn’t do that. It runs when your PR is marked ready for review and focuses only on what will actually break.
So when you open a PR with changes like:
import { drizzle } from 'drizzle-orm/node-postgres';
import { client } from 'pg';
const client = new Client ({ connectionString: process.env.DATABASE_URL });
client.connect();
export const db = drizzle(client);
You won’t get comments like “Consider adding a blank line after the imports.”
Sentry returns specific and actionable debugging comments like below:
Here's how it works:
How AI Code Review saved @codydearkland’s a*%
During our recent Hackweek, Cody opened a PR to add dynamic instrumentation rules to a new CLI he was building. He started off just supporting one AI model but wanted to extend to others, which meant different configurations, and additional SDKs and client configurations. In the mix of vibe coded setups and diving in at random to hand edit parts, he created different logic for managing the AI client object and the temporary API key during startup. This created a scenario where it wasn't always marked as actually invalid.
The way he was handling API keys created inconsistent error handling that would have caused a crash during project detection when using the different models. Sentry caught it when Cody opened the PR, he fixed it, and averted disaster. He even gave it a thumbs up.
What else it does
Get in-depth PR reviews
You know those reviews where your coworker drops a comment like “you left in debug logging again” or “did you mean !==
here?” PR review handles that.
It’ll catch the typos, the obvious mistakes, and the boilerplate fixes, so human reviewers can focus on whether your architecture is sane instead of the dumb mistakes you made when you were over-caffeinated.
That means faster, higher-quality reviews. And fewer “LGTM 👍” drive-bys that let rookie mistakes slip through just because nobody had the energy to read the whole diff.
Just prompt @sentry review
in a PR comment to get the goods.
Generate unit tests automatically
Untested code has a half-life of about five minutes before it mutates into a bug, so we taught an AI agent to do something useful: write your unit tests for you.
Just comment @sentry generate-test
in your PR.
Sentry reads the code, maps your repo’s structure, and spits out runnable tests covering every new line of code. No plugins. No “let me open a new tab for this.”
Open a PR that updates auth.js
? Drop @sentry generate-test
and get unit tests for expired sessions, invalid tokens, and those ugly edge cases you’d rather not think about.
How to try it
Stuff breaks. Constantly. Before prod, after prod, it doesn’t matter. Sentry’s lurking everywhere, catching issues before they blow up your day. And when things do explode? We’re right there, handing you the flashlight so you can debug the mess without losing your cool.
AI Code Review is in open beta and free to try for all Sentry users.
Toggle on GenAI features and PR review in settings
Read more in the docs, try it on an active PR, and let us know what you think on Discord or GitHub. If you’re new to Sentry, get started for free.