---
title: "Reviewing AI-Generated Code"
url: https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code/
---

# Reviewing AI-Generated Code

This document uses key words such as "MUST", "SHOULD", and "MAY" as defined in

<!-- -->

[RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement levels.

Statuscandidate

Version`1.0.0`[(changelog)](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#changelog)

## [Overview](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#overview)

This playbook extends the standard code review process with AI-specific checks for common failure modes in AI-generated code. It covers hallucinated imports, meaningless tests, over-engineering, speculative changes, missing context, and subtle behavior changes. By following these steps, reviewers will catch issues that automated tools miss while maintaining the same quality standards as human-written code.

Related resources:

* [Reviewing a PR](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-a-pr.md) — base review process
* [Code Quality Standards](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md) — test quality requirements
* [Sentry Skills](https://github.com/getsentry/skills#available-skills) — find-bugs skill for systematic detection

***

## [Standard review first](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#standard-review-first)

Apply the full review checklist from [Reviewing a PR](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-a-pr.md):

#### [1. Check the PR description](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#1-check-the-pr-description)

What, why, linked issue.

#### [2. Check CI status](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#2-check-ci-status)

You **MUST NOT** review failing code.

#### [3. Review for common issues](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#3-review-for-common-issues)

Runtime errors, performance, side effects, backwards compatibility, security, test coverage ([Test requirements by change type](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md#testing)), test quality ([Test quality](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md#testing)).

#### [4. Check @sdk-seniors review triggers](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#4-check-sdk-seniors-review-triggers)

Public API, dependencies, schema changes, security-sensitive code, frameworks.

#### [5. Use LOGAF prefixes on feedback](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#5-use-logaf-prefixes-on-feedback)

([Review feedback conventions](https://develop.sentry.dev/sdk/getting-started/standards/review-ci.md#code-review))

#### [6. Approve when only `l:` items remain](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#6-approve-when-only-l-items-remain)

***

## [Additional AI-specific checks](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#additional-ai-specific-checks)

AI-generated code has specific failure modes. You **MUST** check for these in addition to the standard review:

#### [1. Hallucinated imports and APIs](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#1-hallucinated-imports-and-apis)

Verify every import and function call actually exists. AI tools sometimes reference packages, modules, or functions that don't exist or have different signatures than expected.

#### [2. Tests that test nothing](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#2-tests-that-test-nothing)

You **MUST** check that test assertions would actually fail if the feature broke ([Test quality](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md#testing)). Watch for: hardcoded expected values that happen to match the output, `assert True` or equivalents, testing mock behavior instead of real behavior, asserting only that no exception was thrown.

#### [3. Over-engineering](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#3-over-engineering)

AI tools frequently add unnecessary abstractions, configuration options, and error handling for impossible cases. Ask: "does this need to be this complex?" If a simpler approach works, request it.

#### [4. Speculative changes](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#4-speculative-changes)

Code changes beyond what the issue or PR describes ([One logical change per PR](https://develop.sentry.dev/sdk/getting-started/standards/code-submission.md#one-logical-change-per-pr)). If the PR is "fix null check" but also reorganizes imports and adds docstrings, request a split.

#### [5. Missing architecture context](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#5-missing-architecture-context)

AI tools may not understand SDK-specific patterns and conventions. Check that the change fits the SDK's existing architecture, not just generic "good code" patterns.

#### [6. Subtle behavior changes](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#6-subtle-behavior-changes)

Pay extra attention to edge cases in any "cleanup" or "refactor" PR. AI refactors sometimes change semantics in ways that aren't obvious from a quick scan.

You **SHOULD** use the [`sentry-skills:find-bugs`](https://github.com/getsentry/skills#available-skills) skill for systematic bug and vulnerability detection in the diff.

## [Referenced Standards](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code.md#referenced-standards)

* [Review feedback conventions](https://develop.sentry.dev/sdk/getting-started/standards/review-ci.md#code-review) — LOGAF scale and blocking criteria
* [Test requirements by change type](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md#testing) — test coverage expectations
* [Test quality](https://develop.sentry.dev/sdk/getting-started/standards/code-quality.md#testing) — meaningful assertion requirements
* [AI attribution](https://develop.sentry.dev/sdk/getting-started/standards/code-submission.md#ai-attribution) — Co-Authored-By footer requirement
* [One logical change per PR](https://develop.sentry.dev/sdk/getting-started/standards/code-submission.md#one-logical-change-per-pr) — focused PR scope

***

| Version | Date       | Summary                                                                                          |
| ------- | ---------- | ------------------------------------------------------------------------------------------------ |
| `1.0.0` | 2026-02-21 | Initial playbook — specialized review techniques for AI-generated code with common failure modes |
