Our team's PR approval rate dropped from 78% first-pass to 52% first-pass within two months of adopting GitHub Copilot. Not because the code was worse. Because our review process wasn't designed for AI-generated code.
After 10 months of adjusting, our first-pass approval rate is back to 74%. But the review process looks nothing like it did before. Here's exactly what changed.
Before Copilot, a typical PR on our team had 80-200 lines of changes. The developer wrote every line intentionally. Each change had a reason.
After Copilot, PRs ballooned to 200-500 lines. The extra lines came from three sources:
Copilot completions that were accepted but unnecessary. Auto-complete suggests adding error handling, logging, or utility functions that look useful but aren't needed for the current task.
Boilerplate that Copilot generates beautifully but shouldn't exist. Copilot will generate an entire CRUD API with full error handling in 30 seconds. Impressive, but if you only needed the "read" endpoint, the rest is dead code.
Inconsistent patterns from different Copilot sessions. Copilot generates slightly different code each time, depending on what files you have open. Morning PRs use one pattern, afternoon PRs use another.
We implemented a hard limit: 300 lines per PR. No exceptions.
Before Copilot, this limit felt unnecessary because developers naturally kept PRs manageable. After Copilot, developers would accept a stream of completions and end up with 600+ line PRs without realizing it.
# Change 2: We Added "Copilot Context" to PR Descriptions
Every PR now includes a section explaining which parts were Copilot-generated and which were hand-written. Not to shame anyone, but to help reviewers allocate their attention correctly.
markdown
## AI Context- **Copilot-generated:** API route handler, Zod schema validation- **Hand-written:** Business logic in calculateShipping(), migration file- **Modified from Copilot:** Error handling (changed from try/catch to Result pattern)
This single change cut our review time by 20%. Reviewers knew exactly where to look closely and where to skim.
Old review focus: "Is this code correct?"
New review focus: "Does this code fit?"
Review both correctness and fit. A Copilot suggestion can contain logic or security errors as well as inconsistent patterns, unnecessary libraries or an unsuitable structure.[1]
When reviewing Copilot-heavy PRs, the first question is always: "What can we remove?"
Copilot generates generous code. It adds comprehensive error handling to functions that are only called from trusted internal code. It generates utility functions "just in case." It creates types for objects that are only used once.
Our reviewers now have explicit permission to comment "remove this" on any code that isn't directly needed for the PR's stated goal. Before Copilot, suggesting code deletion could feel aggressive. Now it's expected.
Real example from our codebase:
typescript
// Copilot generated a complete validation utility// for a field supplied by an internal servicefunction validateWebhookPayload(payload: unknown): WebhookPayload { if (!payload || typeof payload !== "object") { throw new ValidationError("Invalid payload"); } if (!("event" in payload) || typeof payload.event !== "string") { throw new ValidationError("Missing event field"); } if (!("data" in payload) || typeof payload.data !== "object") { throw new ValidationError("Missing data field"); } // ... 20 more lines of validation return payload as WebhookPayload;}// Validate at the receiving boundary, including internal service calls.const payload = WebhookPayloadSchema.parse(body);
WebhookPayloadSchema represents the application's runtime schema for this payload. Type assertions perform no runtime validation. Reuse a validator that enforces the receiving component's requirements when data crosses a trust boundary, including an internal API.[2][3]
We created a set of custom ESLint rules that catch the most common Copilot inconsistencies:
The no-restricted-imports example below restricts specified modules and import patterns. The other rule reflects the repository's chosen error-handling convention.[4]
typescript
// .eslintrc.js (partial)module.exports = { rules: { // Catch Copilot's tendency to use different HTTP clients "no-restricted-imports": ["error", { patterns: [{ group: ["axios", "node-fetch", "got"], message: "Use our internal apiClient from @/lib/api", }], }], // Catch Copilot's tendency to use try/catch instead of our Result pattern "no-restricted-syntax": ["error", { selector: "TryStatement", message: "Use Result<T,E> pattern. See ARCHITECTURE.md#error-handling", }], },};
These rules catch about 40% of pattern violations before the PR reaches a human reviewer. That's 40% less work for the reviewer and 40% less back-and-forth.
Figure 2. Use the change's behaviour and risk to decide where review needs more attention.
1. Is the file in the "AI Context" section as hand-written?
YES → Standard review (trust the developer's judgment)
NO → Continue to step 2
2. Does the file touch auth, payments, or data mutations?
YES → Deep review (line by line, check every edge case)
NO → Continue to step 3
3. Is the file a test file?
YES → Check test quality (behavior vs implementation)
NO → Continue to step 4
4. Is the file UI/presentation only?
YES → Light review (visual check, accessibility basics)
NO → Standard review with pattern check
I initially blamed Copilot for the quality drop. "The AI is generating bad code" was my diagnosis. I was wrong. Copilot generates reasonable code. The problem was that our review process assumed every line of code was intentionally written by a human who understood the system.
Once I stopped blaming the tool and started adapting the process, things improved fast. The tool isn't the problem. The process gap is the problem.
If your team just adopted Copilot and your quality metrics are dropping, don't turn off Copilot. Update your review process. Start with the five changes above, measure for a month, and adjust from there.
Frequently asked questions
Should Copilot-generated code receive a different correctness standard?
Apply the same correctness and security requirements to all changes. AI involvement can help a reviewer decide where to investigate, but hand-written origin and an approved suggestion both leave the team responsible for the implementation.
Does a TypeScript assertion validate a webhook payload?
A type assertion tells the compiler how to treat a value. It does not inspect the value at runtime. Validate data crossing a trust boundary with the appropriate schema and authorization checks, including requests from an internal service.
What information belongs in a Copilot-assisted pull request?
Explain the purpose of the change, where AI helped and which constraints or repository patterns apply. Include tests and relevant failure cases. The description should help a reviewer understand the implementation and the decisions behind it.
Which review checks can a team automate?
Automate rules that have a clear definition, such as restricted imports or known repository conventions. Test the rules and investigate false positives. Keep design, correctness and failure handling in the human review alongside those checks.
Five predictions for where code intelligence is heading by 2028, based on 6 years of building tools in this space. Includes what's real, what's overhyped, and a maturity model for planning.
Most code quality dashboards fail because they track too many metrics and live outside the team's workflow. Here are exactly 7 metrics and a 3-week adoption plan that actually works.
Compare cyclomatic and cognitive code complexity with change risk. Check corrected examples, understand each measure’s limits and target refactoring effort.
Code churn reveals more about team health than any code quality score. Learn to distinguish healthy churn from warning signs using the CHURN framework.
30-45% of engineering time produces zero customer value. Here's a 4-week audit process that identifies exactly where time goes and the AUDIT cadence for continuous productivity improvement.
A repeatable quarterly process for measuring codebase health using the VITAL Signs Framework. Covers velocity, incidents, test effectiveness, architecture, and legacy burden with real metrics and thresholds.