How to Build an AI Code Review Agent - Daksh Gupta, Greptile
Slide chapters
26 slide and demo groups · Timestamps are approximate. 3 additional groups were omitted from this pass.
Read the talk
How to Build an AI Code Review Agent
Daksh Gupta walks through the gap between a sandbox that posts PR comments and a useful reviewer: targeted bug detection, historical evaluations, different models for writing and reviewing, codebase context, autonomous testing, and selective inference spending.
From a talk by Daksh Gupta
At a glance
Ideas worth remembering
Define the bug types worth catching and the nitpicks worth suppressing. Low-value comments can waste human attention and cause coding agents to add unnecessary defensive code.
Evaluate reviewer changes against historical incident PRs, and keep adding new failure modes. Fewer comments or cheaper inference do not establish that the reviewer still catches important bugs.
Try using a different model family for review than for generation. Gupta reports a 10% higher catch rate from model inversion, with author identification and the result’s unspecified experimental scope limiting how directly it can be applied.
Codebase flows help identify contextual bugs such as authentication bypasses; documentation, tickets, logs, and telemetry help connect implementation to intended and observed behavior.
Autonomous UI testing needs both a running PR environment and documented flows. Smaller models can handle context selection and application operation while frontier models focus on consequential review decisions.
A webhook gets you comments. Validation takes more.
When engineers—and increasingly their colleagues outside engineering—can generate code quickly, review becomes the bottleneck. Daksh Gupta, co-founder of Greptile, builds agents that review and test pull requests with codebase context. His starting point is practical: some companies have requirements specialized enough to justify building their own reviewer, and the first working version is surprisingly small.
Put a coding agent in a sandbox. Connect GitHub or GitLab so that opening a pull request sends its contents to the agent through a webhook. Give the agent a prompt asking for a review, then post its feedback through the review API. Codex or Claude Code can supply the agent; Gupta recommends a model-independent harness, a choice that becomes important when the reviewer needs to use a different model from the code’s author. In his sketch, the PR receives feedback about five minutes later.
That proves the plumbing works. It also exposes several different failures:
- Missed bugs: The agent produces comments without necessarily finding the defects most likely to cause an outage or incident.
- Missing context: A change can depend on library behavior, architectural direction, or interactions across thousands of repositories. The PR contents alone do not explain those relationships.
- High inference costs: Gupta reports seeing internal implementations spend between $3 and $25 per pull request. Repeated exploration and file reading can quietly accumulate substantial token bills.
- Nitpicky comments: Technically correct but overly pedantic findings consume attention that should go to consequential problems.
- An unstable stream of findings: Running the reviewer again on the same PR can reveal another batch of issues, making the review feel as though it will never finish.
Nitpicks have a second cost beyond annoying humans. Review comments often become instructions for another coding agent, which attempts to resolve all of them without deciding whether each requested change is worthwhile. A pedantic suggestion can therefore turn into another layer of defensive code. The causal chain matters: noisy review does not merely hide useful feedback; it can actively steer implementation toward unnecessary complexity.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Tell the reviewer which bugs matter—and what to leave alone
The cheapest improvement is to replace the generic review prompt with a more selective one. A request such as “Review this PR” and return comments in GitHub’s API format specifies the output shape, but says little about what deserves a comment. Gupta separates that missing guidance into two parallel instructions:
- Search for specific failure types. Examine previous outages and incidents, identify the kinds of mistakes the company repeatedly makes, and build a catalog. Ask the reviewer to look for those bug types rather than conducting an unrestricted search for anything questionable.
- Define and exclude nitpicks. Explain which technically defensible objections are not useful review findings. Gupta’s examples include demanding three levels of defensive checks or objecting to slightly untidy error handling without establishing a consequential failure.
The difficulty is knowing whether a quieter prompt is better. A small wording change can produce a large change in comment volume. Fewer comments might mean the agent stopped being pedantic, or it might mean the agent stopped catching real bugs. A reviewer can demonstrate the presence of a defect; a clean review cannot establish the absence of defects. Because catastrophic failures are rare, an apparently successful prompt change can remain in production for a long time before a serious miss becomes visible.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Replay the pull requests that caused incidents
Historical incident PRs give prompt tuning a more useful test than comment counts. Start with the company’s incident records, collect the pull requests responsible for those failures, and run each candidate version of the reviewer against them. The question becomes concrete: how often does this version catch the bugs already known to have caused trouble? That comparison lets a team reduce noise while checking whether it has also lost detection ability.
The dataset needs to keep changing. Gupta estimates that about 80–90% of bugs repeat prior mistakes, which makes historical cases valuable, but coding agents also develop new failure modes. An evaluation set that covers yesterday’s mistakes can miss tomorrow’s. Broad coverage is difficult for an individual company because rare bug types require a very large number of PRs to encounter.
This is one of the advantages Gupta attributes to Greptile’s cross-company corpus: it can test changes against a much wider range of pull requests than most internal tools can. Internal incident data still gets a company meaningfully far, particularly on its own recurring problems. The limitation is coverage, not the usefulness of replaying known failures.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Use a different model to review the code
Model independence now earns its place in the architecture. Gupta’s research found different error patterns in Claude and GPT models, including a greater tendency toward authentication bypasses in the GPT models he studied. His proposed explanation is that a model can carry similar blind spots into generation and review: the reasoning that failed to notice a problem while writing code may fail again while checking it.
The correction is model inversion. If Claude Code wrote the change, route the review to a GPT model; use the opposite direction for GPT-written code. Gupta reports a 10% higher bug catch rate when flipping models. The talk does not specify the experimental conditions or whether that means a relative increase or percentage-point gain, so the result supports trying and evaluating cross-model review—not calculating a corresponding reduction in production incidents.
The routing problem is identifying what wrote the PR. Gupta describes fingerprints such as a codex/ branch-name prefix or a Claude co-author attribution in PR or commit metadata. He estimates these clues cover about 80% of cases. Manually named branches and other exceptions make the rest harder. An internal catalog of coding-agent usage or telemetry from development machines can supply additional evidence, but the model’s identity is not always recoverable from the code submission alone.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Authentication bugs require a map of the codebase
A reviewer can use a different model and still misunderstand the system it is reviewing. Greptile began as a codebase-context company, working on retrieval over large repositories. Gupta rejects the idea that grep alone solves that problem: imprecise search encourages the agent to read large quantities of files, then load their contents into model context. The expensive pattern is repeated search, file read, and cache write.
Greptile instead builds an internal knowledge base that catalogs the system’s parts. An authentication entry, for example, describes how authentication works, the flows involved, and the files that implement them. The entry helps the reviewer find the relevant code without reconstructing the entire subsystem through broad searches on every PR.
Authentication bypasses make the need for this context concrete. To decide whether a missing check is a bug, the reviewer needs to know whether execution has already entered an authenticated environment at that point in the codebase. A local code fragment does not necessarily answer that question. The flow and its surrounding files supply the relationship needed to distinguish a real bypass from a check that belongs elsewhere.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A living wiki connects implementation, behavior, and intent
Code can run correctly and still implement the wrong thing. Gupta uses the image of Slack becoming an IDE: someone sends a sentence or two asking an agent to fix something, but those sentences leave much of the intended behavior unstated. The agent may misinterpret the request or make an arbitrary choice where a human colleague would draw on shared knowledge.
Tickets and documentation supply some of that missing knowledge. Jira or Linear can carry the work’s intent; Confluence or Notion can explain the product and its conventions; the codebase index explains the implementation. Engineers often underestimate how much accumulated organizational knowledge helps them fill gaps in a short request. Giving the agent access to these sources makes more of that background available during review.
How do those sources help both review quality and search cost? Greptile places a living wiki between the context sources and the agent. The wiki combines knowledge of the codebase, application behavior from production telemetry and logs, and roadmap information from documentation and tickets. It supplies background for reasoning about a change and helps direct code searches toward relevant files.
The two outputs matter separately. Organizational context helps the reviewer assess whether the change fulfills its intended purpose. More precise retrieval reduces the amount of code it needs to read to make that assessment. Gupta describes the goal emphatically as never reading an unnecessary file; the supported mechanism is the wiki’s guidance about where to look, rather than a demonstrated guarantee of perfect retrieval.
One context layer, two uses
Read the diagram as text
- Codebase knowledge. sources — Subsystems, implementation flows, and the files involved.
- Production behavior. sources — Application knowledge from telemetry and logs.
- Documentation and tickets. sources — Product and roadmap information beyond the PR.
- Living wiki. context — Combines knowledge of the company, application, and codebase.
- Targeted code search. uses — Uses background knowledge to choose which files to read.
- Review agent. uses — Reasons with organizational context and retrieved code.
- Codebase knowledge → Living wiki: Supplies implementation knowledge.
- Production behavior → Living wiki: Supplies observed application behavior.
- Documentation and tickets → Living wiki: Supplies product and roadmap context.
- Living wiki → Review agent: Supplies background context.
- Living wiki → Targeted code search: Guides file selection.
- Targeted code search → Review agent: Supplies relevant file contents.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Render the change and test the user flow
Reading React changes can leave the reviewer satisfied while the rendered interface is unusable on a phone. Gupta’s example is a button that technically appears in the application but is hidden on an iPhone or falls outside the initial visible area. Static review examines the implementation; running the application exposes the result the user actually encounters.
Greptile runs the customer’s stack in dependency-rich, configurable virtual machines and uses a computer-use agent to test it end to end. Two prerequisites make that possible:
- Documented application flows: The agent needs a map of behaviors to exercise, such as authentication and sign-up.
- A reproducible development environment: A sufficiently simple build script must start the stack with its required dependencies. Gupta describes helping customers prepare this environment as one of the trickier implementation tasks.
How do the environment and flow map fit together? The setup Gupta describes has a dev box running the PR branch with its dependencies, plus a flow map that tells the agent what paths to test. The running app supplies something the agent can operate; the map supplies the behaviors it should exercise. Vision models can then assess the rendered result, including the phone-layout problem that reading the changed files did not reveal.
The useful change is from a judgment about source code to an observation about behavior: a button can exist in the implementation yet remain inaccessible in the rendered interface. Gupta is optimistic enough to call end-to-end QA nearly solved by improved computer use, but that is his assessment, not a coverage result established here. Even in this approach, documented flows and a working environment remain necessary inputs.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Spend frontier inference on the decisions that need it
A context-aware agent that also runs the application can still be expensive. After describing autonomous testing, Gupta again puts a review in the range of several dollars to roughly $20. The next optimization is to stop assigning every subtask to a frontier model. He reports that frontier models account for about 20% of Greptile’s mix at the time of the talk, reserved for the most critical work, while smaller models handle much of the exploratory activity and file reading.
Where can a cheaper model take over without replacing the most consequential reasoning? Gupta’s illustrative split separates the jobs:
- Finding context: A small model locates useful information.
- Testing user flows: A lightweight computer-use model operates the application.
- Analyzing and submitting the review: A frontier model handles bug analysis, the review process, and submission.
The distinction is task-specific: finding a file and deciding whether a change contains a serious bug do not automatically need the same model or inference budget.
Greptile’s actual implementation divides the work into 20 subtasks, each with a specific set of models, and a small research team continually revisits those assignments. An internal implementation need not begin with that degree of specialization. Gupta suggests getting much of the benefit by replacing simple tasks with simple models first.
This brings the historical PR dataset back into the design. A smaller model can make a subtask faster and cheaper while quietly reducing the final reviewer’s ability to catch bugs. Without known failure cases to replay, the cost improvement is immediately visible and the quality regression may remain hidden until an outage. Model routing therefore needs evaluation of the resulting review quality, not just a lower token bill.
The final optimization targets what enters the frontier model’s context at all. A cheap model can inspect candidate context pieces and choose which ones to include. Gupta also proposes using a decision model to rerank those pieces before loading them into the frontier model’s cache. This is a proposed allocation mechanism: spend inexpensive inference selecting information so that the more expensive model reads less irrelevant material. In his framing, frontier-model cache is one of the system’s most expensive and scarce resources.
That leaves a concrete build-or-buy decision. A company with unusually specialized needs can build around its own incident history, application flows, and organizational context, but it also takes on environment setup, dataset maintenance, and model-selection work. Gupta closes by offering help to teams that choose to build. The small webhook prototype remains a useful beginning; the ongoing work is making its findings worth acting on at a cost the company can sustain.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Related talks
- The Death of the Code Review: What the Data Actually Says — Laurie Voss, Arize AI
Extends the review-bottleneck discussion with false-positive filtering, multiple review passes, organizational quality standards, and evaluation of the reviewers themselves.
- Why AI Didn't Actually Make You Ship Faster — Gabriel Spencer-Harper, Meticulous
Provides a complementary approach to runtime verification: replaying browser workflows and comparing visual changes, with explicit mechanisms for repeatability and test selection.
- Evals for High-Stakes AI Agents — Doneyli De Jesus & Annabell Schäfer, Langfuse
Develops the evaluation work behind safe prompt and model changes, including representative datasets, expert labels, experiments, and quality gates.
Read the complete timestamped transcript
26 slide groups. Extracted from the recording; expand builds to follow changes. Timestamps are approximate. 3 additional groups were omitted from this pass.
Building an AI code review agent
Daksh introduces Greptile’s agents, which review and test pull requests with full codebase context to find bugs, logical errors and code quality concerns, primarily in AI-generated code.
Text in image
greptile Building an AI code review agent Daksh · Greptile Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 0:12
Um, all right. My name is Daksh. I am one of the co-founders of a company called Greptile, and we build agents that review and test pull requests with the full context of the codebase. And by reviewing and testing these pull requests, we reveal bugs, logical errors, code quality concerns, primarily from AI-generated code. Now, to give you a sense of scale, many thousands of companies use Greptile every day. About one percent of all pull requests on GitHub go through us. And a
Greptile usage and customer examples
Greptile reports handling more than 1% of GitHub pull requests each day. Six customer logos illustrate its reach; Daksh names NVIDIA’s CUDA codebase and Coinbase’s wallet as examples of the different codebases it reviews.
Text in image
More than 1% of GitHub PRs go through Greptile each day NVIDIA® coinbase scale Vanta Decagon PostHog Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 0:42
variety of many different types of codebases, whether it's the CUDA codebase at NVIDIA or the wallet codebase at Coinbase, and many, many others. And every now and then, we meet a company where we are actually not the right code review or code testing product for them. Their needs are so specialized and so esoteric that it's actually more beneficial for them to build their own. And when that happens, we tend to help them for free. There's two reasons for this. One, we have a lot of specialized knowledge about how to do this really, really well. And second, we get to learn a lot about how we can serve
- 1:12
customers like those in the future. And in this presentation, I wanna tell you what we tell them, which is how to build a really great AI code review agent yourself. Now, there's kind of three things that people like about Greptile, and I'm gonna talk through how to implement those yourself. The first one is codebase context. When customers use Greptile on their pull requests, they find that it really understands their codebase. As a matter of fact, before we were a code validation company, we were a codebase context company. We were teaching language models from
Why Greptile
Three inputs converge on pull-request review and testing: codebase context, sandboxed code execution, and task-specific model selection. Gupta frames these as capabilities to implement in your own review agent.
Text in image
Why Greptile Codebase context It runs your code The right model for each task Review + test the pull request Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 1:41
2023 how to understand very large codebases. And as a result of that, we got very good at indexing code. Uh, the second thing that people like about Greptile is that it runs your code, in the sense it spins up your stack in a fully loaded dependency-rich sandbox, and it clicks around and tests things using computer use or through pressure testing API endpoints, and so on. And the third thing is we're actually very efficient allocators of inference. We pick the right model, the right quantity of inference budget for each subtask in the review and validation process. And as a result of that, we're able to get a lot more performance per
- 2:11
dollar than an internal tool could or any competitor could. So there's kind of two reasons that you would want this presentation. Uh, the first one is you want to build your own review agent. And the second reason, which is a bit more subtle, is if you're trying to pick a review or a testing agent for your company, and you want to understand what makes a good one and what makes a great one. All right. So let's dive right in. Now, blank slate. You are part of the platform team of your company, or you're just the, uh,
Who this is for
The talk serves two audiences: people building their own review agent and teams choosing a review or testing tool. Understanding how these agents work helps buyers distinguish a good one from a great one.
Text in image
Who this is for Building your own review agent Choosing a review tool Interface text: Engineering the future of AI
Show 2 builds
- 2:17
Audience slide listing building your own review agent and choosing a review tool.
Text in image
Who this is for Building your own review agent Choosing a review tool Interface text: Engineering the future of AI
- 2:30
Audience slide listing building your own review agent and choosing a review tool.
Text in image
Who this is for Building your own review agent Choosing a review tool Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 2:17
Basic workflow
The walkthrough starts from scratch: build a review agent to address the validation bottleneck as engineers and other teams write more code with AI.
Text in image
Basic workflow OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 2:41
local, uh, AI psychotic member of your team, and you want to build the review validator of your company. Um, company's writing lots of code. People are vibe coding. Uh, you have, of course, engineers vibe coding, some of them a little too close to the sun. Uh, you have marketing people writing code. And, uh, the new problem is the review bottleneck, the validation bottleneck. And so that's what you want to address. The first thing that you should do is you should get yourself a sandbox. There's many, many companies here that will sell you a sandbox. Uh, you can also just use Firecracker or something
Basic workflow: sandbox
Gupta starts the code-review workflow with a sandbox to hold the agent. This initial build shows the environment as an empty box, before introducing what runs inside it.
Text in image
Basic workflow Sandbox OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 3:11
like that. And you'll want to put an agent in that sandbox. Uh, the agent can be Codex or Claude Code. Personally, I recommend going model independent for reasons that I will get into. So you can use something like OpenCode or Pi as your harness. Those are both open source. And, uh, you will need to then connect your GitHub or your GitLab, have a PR webhook send it the contents of a pull request to when a pull request is opened. The agent can have some type of prompt that just says, "Hey, review this and send back some feedback." And then you can wire that back using GitHub's review APIs. Very simple. In fact,
Basic workflow: GitHub webhook to a sandboxed agent
A GitHub PR webhook sends pull-request contents to an agent running inside a sandbox. The agent reviews the code from a prompt, and GitHub’s review APIs carry its feedback back to the pull request.
Text in image
Basic workflow GitHub PR webhook Sandbox Agent OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 3:41
many people think that's actually all it takes to build a review agent. There's a few things that are gonna go wrong when you start using this. But what will happen is you will, in fact, have a pull request go live. The contents will go to an agent, and about five minutes later, you will get some feedback on your pull request. But here's what's going to go wrong in the time that it takes you to build this. The first one is you're gonna miss a lot of bugs. So it turns out that actually bugs are intractably large. They're... In fact, I saw a, a tweet not very long ago that, uh, said that bugs are fractally infinite, so you will never run out of, of
Basic workflow: sandbox
Gupta starts the code-review workflow with a sandbox to hold the agent. This initial build shows the environment as an empty box, before introducing what runs inside it.
Text in image
Basic workflow Sandbox OCTOBER 13, 2026 EXPO SESSION Shannon Room
You can build this in a day
Gupta presents a basic review agent as a one-day build: send it a pull request and get feedback about five minutes later. That working loop is a starting point, not proof that it reviews code well.
Text in image
You can build this in a day Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
Then you run it
A basic review agent can miss bugs and context, run up review costs, and produce nitpicks or fresh findings on every rerun of the same PR. Gupta warns that coding agents resolving every nitpick can leave overly defensive code.
Text in image
Then you run it 1. Missed bugs OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 4:11
bugs in a particular piece of code. That's the first thing that's gonna go wrong, is you're gonna miss bugs. Of course, that's the one thing that your system needs to do, is to prevent at least very catastrophic outages and incidents. Second thing that's gonna happen is it's gonna miss context, and it's, it's going to misunderstand parts of how your codebase works. It maybe won't understand where you're going with your codebase. It won't understand how a specific part of it works. It maybe will not understand how one of your libraries works. It's possible you're one of those companies that never recovered from the microservices apocal- apocalypse of the 2010s, and so you just have thousands and thousands of repos, and
- 4:41
you have to have context of all of them to be able to operate. So that's the second thing that's gonna go wrong. The third thing is it'll be very expensive. I think people are very surprised by this. So generally, from people we've seen try to do this, they'll find that they're spending between $3 and up to $25 per pull request on reviewing it using coding agents. And these tokens can add up really, really fast. Very quietly, they got very expensive.
- 5:04
The fourth problem they'll find is nitpicky comments. Now, this matters more than you might think. Nitpicky comments are comments that are technically correct but overly pedantic. There's two things that go wrong when you have nitpicky comments. If you are a... As a human reading those comments, they're very annoying. They're like a boy that cries wolf. You'll just see lots and lots of comments, and it'll be kind of annoying for you to just read through them and figure out which ones are just minor stylistic complaints and which ones are actually catastrophic problems. The second thing that will go wrong is they will wreck your codebase. Because typically, the way the review agents work is they'll leave comments on GitHub, and your coding agent picks them up
- 5:34
and resolves them. And coding agents are not discerning. They're going to look at review comments just to address all of them. And you'll end up with extremely painfully defensive code, as we found the coding agents are particularly astute at writing. The next thing that'll go wrong is that every time you run a review agent on the same pull request, you will somehow find new bugs, in the sense that it will keep catching new things in the pull request very annoyingly, and you will... And like I said, bugs will appear to be fractally infinite. So the first thing that you
Then you run it
A basic review agent can miss bugs and context, run up review costs, and produce nitpicks or fresh findings on every rerun of the same PR. Gupta warns that coding agents resolving every nitpick can leave overly defensive code.
Text in image
Then you run it 1. Missed bugs 2. Missing context 3. Expensive reviews 4. Nitpicky comments 5. New bugs on every rerun Engineering the future of AI
1. Optimizing the prompt
Gupta introduces prompt optimization as the first improvement to the code review agent, describing it as the lowest hanging fruit.
Text in image
1. Optimizing the prompt OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 6:04
wanna do, the lowest hanging fruit, is you wanna optimize the prompt. You start it with a very simple prompt, something like, "Review this PR and then output the comments in GitHub's API schema format." Generally, there's two themes within the bugs. Look for specific bug types, and second, skip the nitpicks. And that's what you want to orient your prompt around. You'll want to ask for specific bug types, and you can kind of do some internal data science on existing outages and incidents that have happened in your codebase, and figure out what types of bugs you have the highest propensity to produce. Create a catalog of them,
The prompt
Focus the review prompt on specific bug types drawn from past outages and incidents in your codebase. Define what counts as a nitpick, then explicitly tell the agent to skip those comments.
Text in image
The prompt Look for specific bug types Skip the nitpicks OCTOBER 13, 2026 EXPO SESSION Shannon Room
Then you run it
A basic review agent can miss bugs and context, run up review costs, and produce nitpicks or fresh findings on every rerun of the same PR. Gupta warns that coding agents resolving every nitpick can leave overly defensive code.
Text in image
Then you run it 1. Missed bugs OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 6:34
and then have your prompt look for those specific bug types. The second is you'll need to expressly tell it what a nitpick is and not to look for them. And nitpicks can be anything from asking why there isn't three levels of defense on this particular thing or why error handling is done in this slightly shoddy way. Now, the thing that you'll run into when you change these prompts is when you change a small thing in the prompt, it'll have a weirdly big impact on the number of comments that your agent is writing on your pull request. This is quite scary because it means you don't really know if it's missing a bug or
Bugs are rare
One red dot among 1,000 illustrates why missed bugs can stay hidden. Gupta warns that a review agent can appear effective for a long time while missing catastrophic bugs, because those bugs occur so rarely.
Text in image
Bugs are rare 1,000 dots. One bug. Illustration Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 7:04
not. You don't know the counterfactual. The validation agents or really any reviewer or tester can, can tell you about the presence of bugs, but it unfortunately can't tell you about the absence of bugs. That's, that's sort of a, a limitation of the format. And what makes this particularly difficult are bugs are extraordinarily rare and getting rarer by the day. In fact, according to our data science, only about one out of every thousand pull requests has a generally catastrophic bug in it, or I mean one out of every thousand lines of code has a catastrophic bug in it. And so because these bugs are very rare, you might release a version of your
- 7:34
agent that you think is very good, but it secretly misses a catastrophic bug in a pull request. You wouldn't know for a long time because you don't produce those bugs very often. And so that brings us to the second improvement. You will want a dataset of historical PRs. This is relatively easy if you're one of those companies that very nicely catalogs every time something goes wrong in your codebase. If you have that, then you'll have a list of pull requests that have caused outages and incidents in the past. You'll wanna catalog them and then essentially have any version of your review agent run through those and see with what
A dataset of historical PRs
Run the review agent on historical PRs with known bugs, compare what it catches, and tune its prompt in a feedback loop. Keep updating the dataset as bug types change; past incidents cannot cover every new failure.
Text in image
A dataset of historical PRs Different bug types. The same evaluation. Historical PRs with known bugs Run the review agent Compare with the known bugs Tune the prompt OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 8:04
frequency it can catch those bugs. Now, this will allow you to tune the prompt a little bit more confidently. But at the same time, the interesting thing about bugs is, in a changing world, the topology and ontology of bugs changes over time. And so you'll need to have a real-time updating dataset. And this is tricky because unless you have millions and millions of pull requests, it's actually hard to have reasonably high coverage of bug types. It's true that about 80 or 90% of your bugs will be just repeats of prior mistakes, but increasingly, as coding agents get good, they're going to start making novel mistakes.
- 8:34
They'll fail in new ways that we have not anticipated before. And so this is where you will start to hit limitations. Now, quick side note, this is kind of what we did at Greptile, except we actually have a lot of code from a lot of different companies, and we can test across a very, very large corpus of pull requests and therefore improve our agent very confidently. It's one of the reasons why we're able to eke out little bits of performance on the margins in ways that internal review agents can't. But you can get decently far, especially for your particular company, to do this with your internal data. The next thing you'll wanna do is model inversion.
2. Model inversion
Gupta introduces model inversion, motivated by his observation that Claude and Codex models produce different kinds of bugs.
Text in image
2. Model inversion Interface text: AI Engineer
- 9:04
So for... In case anyone was at, uh, my talk earlier this year in San Francisco at AI Engineer, I talked a lot about the ways in which coding agents fail. And I discovered an interesting pattern through that research, which is that the types of bugs produced by Claude models or Codex models are actually quite different from each other. And they're different in a number of ways. As an example, Claude models are something like three times more likely to produce one-off errors than GPT models. GPT models, on the other hand, are significantly more likely to produce auth bypasses than Claude models. And these are all just
- 9:34
artifacts of the post-training, as far as I understand. Now, to prevent this, you'll find that if you're using the same model to review the code written by the same model, um, you'll actually have relatively fewer bugs caught because they fail in the same ways during review that they do during code generation. And so you'll want to invert the model. If you've used Claude Code to write the code, you'll want to use a GPT model to review it, and so on. Now, doing this is somewhat straightforward for the 80th percentile and quite tricky for the last 20. So
Basic workflow
The walkthrough starts from scratch: build a review agent to address the validation bottleneck as engineers and other teams write more code with AI.
Text in image
Basic workflow OCTOBER 13, 2026 EXPO SESSION Shannon Room
Different author, different reviewer
The model inverter routes Claude-authored code to GPT / Codex for review, and vice versa. Gupta recommends switching models because the same model can repeat its code-generation failures during review.
Text in image
Different author, different reviewer Author Claude GPT / Codex Model inverter Reviewer GPT / Codex Claude Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 10:04
if you're using coding agents, you'll notice they leave some type of fingerprint to tell you what coding agent was used for a particular pull request. For instance, Codex will name branches in a codex/branch name format, or Claude is going to write a "Co-authored by Claude" in the PR description and commit message. And about 80% of the time, this will be true. In the final 20, when you happen to manually create a branch name or there was some other reason that a different coding agent was perhaps used, it's significantly harder to figure out which model was used during generation. And you have to develop some type of heuristic to figure out what are the signatures of models being used. Often, you might have an internal
- 10:34
catalog where people report what coding agents they're using these days or have some type of telemetry that's coming out of your dev machines and, and your engineers' computers. We found that there's a 10% higher catch rate if you flip models. And this might sound very small, but you have to know that 10% is, in terms of incidents and outages, is actually quite a lot. That means that there's a 10% higher chance that something will go wrong if you're not using model inversion, which can be quite catastrophic. And so we highly recommend that you use some type of model inversion in your process.
Reported ~10% higher bug catch rate
Greptile reports a ~10% higher bug catch rate in its research when a different model reviews the code than the one that wrote it. Gupta recommends this model inversion for code review.
Text in image
~10% higher bug catch rate in our research OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 11:04
The third improvement that you can make is codebase context. Now, this is something that I care a lot about. Before we were doing code validation, we were doing codebase context. Uh, we were trying to figure out better ways to do RAG over very large codebases. And even today, people consider grep to have effectively solved all of codebase context. I actually think that's not true for a number of reasons. One, grep is extremely imprecise. And second, it's very expensive. To give you some sense of scale, single-digit percentage points of GDP growth last year were inference. A very large percentage of inference was coding agents. And if you actually look at a coding
3. Codebase context
Gupta introduces codebase context as the third improvement to AI code review. He argues that broad grep-and-read searches are imprecise and costly, motivating more targeted retrieval.
Text in image
3. Codebase context Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 11:34
agent trace, the vast majority of tokens used by coding agents are all the same: grep, file read, cache write for the file contents. That means a non-trivial percent of GDP growth is grep, file read, cache write. That's very bad. And this is because grep is very imprecise. It's reading files in very large quantities. And I don't know, there's perhaps some adverse incentives for companies paid by the token to figure out ways to burn more tokens. But even so, you'll find that you'll need to use slightly more surgical methods of figuring out where you should be reading. And the way we do this is we produce an
Codebase context
Changed code in Repo A connects through a service to an auth check in Repo B. Reviewing only the diff risks false positives and missed bugs: catching an auth bypass requires knowing where the code runs in an authenticated environment.
Text in image
Codebase context The diff is only one part of the path Repo A Changed code Service Repo B Auth check False positives + missed bugs Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 12:04
internal knowledge base where we essentially check across the entire codebase all the different parts, catalog them, and then index saying, "Okay, well, this is authentication. Here's how it works. Here are the flows. Here's a diagram of the flows. Here's every file that's involved." One example of where codebase context matters is, for instance, when you're trying to catch an auth bypass It's actually very difficult to figure out if an auth bypass has occurred because you need to have a pretty concrete understanding of whether you're in an authenticated environment when you're in that part of the codebase or not. And that's very tricky. And so you'll find that you will need some type of, uh, of sort of codebase context to be able to
- 12:34
do this. Now, I've been very centered around the concept of bugs, but code can be very, very bad even if it's not buggy. For one, it can be terrible quality, but second, it can just not fulfill the expressed intent of the author. Recently, I saw a post that said that people were increasingly using Slack as their IDE. Now, I think that's a little funny, but at the same time, there's not that much ex- expressed intent in a Slack message. You're only saying maybe a sentence or two, if even, asking an agent to go and fix something, which means the,
Correct code can still do the wrong thing
Bug-free code can still miss the author's intent. Gupta points to one- or two-sentence Slack requests: they give an agent little detail about what the author actually wants.
Text in image
Correct code can still do the wrong thing Interface text: AI Engineer
- 13:04
there's a lot of ambiguity in your instruction. As a result of this, you might find that the coding agent has either misinterpreted your instructions or just it was too ambiguous and it didn't know exactly what to do. And so your correct code can actually still be quite wrong. Now, one of the ways in which we fight this is by giving agents increasingly more context. And we find that the two types of contexts that matter most are docs and tickets and, of course, the codebase from your codebase indexer or knowledge base. You can get remarkably far if you give it access to your Jira and Linear and then your Confluence or Notion or
Two pieces of context
The review agent gets docs and tickets through an MCP gateway and codebase context through an indexer. Together, these inputs help supply the background knowledge developers rely on but may leave out of instructions.
Text in image
Two pieces of context Docs + tickets Jira, Linear, docs MCP gateway Review agent Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
Show 2 builds
- 13:21
Initial diagram under Two pieces of context: Docs + tickets, with Jira, Linear, docs listed beneath, connects to an MCP gateway and then a review agent. Only this input branch is visible.
Text in image
Two pieces of context Docs + tickets Jira, Linear, docs MCP gateway Review agent Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 13:25
Docs and tickets feed an MCP gateway, while the codebase feeds a codebase indexer; both paths supply a review agent.
Text in image
Two pieces of context Docs + tickets Jira, Linear, docs MCP gateway Codebase Codebase indexer Review agent Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 13:21
- 13:34
whatever it is that you store your docs. You'll find that there's a lot of tribal knowledge that is subconsciously helping you produce better code. And when you have agents do the same thing, it feels like they just don't know what's happening, um, because you over-- you underestimate how much depth of knowledge you yourself have.
A wiki the agent can use
Periodic codebase crawls and telemetry from reverts and incidents feed a living wiki. Greptile uses this wiki to supply company context to the sandboxed review agent and make its code searches more precise.
Text in image
A wiki the agent can use Periodic crawls Codebase Reverts + incidents Telemetry Living wiki Sandbox Review agent Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 13:51
Now, the way that Greptile approaches this problem is we actually disintermediate all of these context sources with a living wiki. This wiki is essentially a sort of world model of how your company works. It's everything that it knows about your codebase, everything it knows about your application through production telemetry, through logs, everything it knows about your roadmap from your documentation and your Linear tickets and so on and so forth. And it uses this wiki to supply context, both making the agent more context-aware and making its code searches significantly more
- 14:21
precise because it will never read a file that it didn't need to read.
4. Autonomous testing
Gupta introduces autonomous testing: reading React changes can suggest the code is fine, yet rendering the UI may reveal an element hidden on an iPhone.
Text in image
4. Autonomous testing OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 14:26
The last thing that you should do... All right, this might be four out of five. The next thing that you should do is autonomous testing. One of the things that we think about a lot is that, for instance, for UI changes, you might be able to read through a bunch of change files for React code and conclude that there's nothing wrong with the code. But in fact, when you render it, it might be, for instance, hidden on an iPhone. Now, this is one of the more technically difficult problems to solve. The way that we approach this at Greptile is we essentially build these dependency-rich
3. Codebase context
Gupta introduces codebase context as the third improvement to AI code review. He argues that broad grep-and-read searches are imprecise and costly, motivating more targeted retrieval.
Text in image
3. Codebase context Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
Does the button work on an iPhone?
A browser agent clicks through a PR branch running on a dev server in a mobile viewport, then produces a bug report. The workflow targets UI problems that reading code alone can miss, such as a button hidden on an iPhone.
Text in image
Does the button work on an iPhone? PR branch Dev server Browser agent Mobile viewport Continue Bug report Click through the flow OCTOBER 13, 2026 EXPO SESSION Shannon Room Interface text: localhost:3000
- 14:56
sandboxes, which are completely configurable virtual machines. And we have customers, we work with them to essentially spin up their stack in these sandboxes, and then Greptile's agent uses computer use to test them end-to-end. If you haven't been paying attention, computer use has gotten very good, and it's, like, far better in these new generation of GPT models and Opus models than it was in the previous. For the first time, I think end-to-end QA is n-nearly solved. The thing that you need to do, though, is you've to document all the flows through your application. And second, you need to be able to have a sufficiently simple build
- 15:25
script so that the agent can spin up your stack in your environments. We have a team of forward-deployed engineers that help companies do this. We found that it's one of the trickier parts, unless, of course, you have very good dev boxes already, in which case, congratulations on working at Stripe.
Two things to build
The dev box runs the PR branch with its dependencies; the flow map links code to user journeys, such as auth to sign-in. Together, they let the agent test flows end-to-end and use vision to spot mobile layout problems.
Text in image
Two things to build 1. Dev box PR branch + dependencies Running app 2. Flow map Auth code Sign-in flow Checkout code Purchase flow Example mappings Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 15:43
So... Oh, I-- this is the diagram I meant to show you. But yes, you will need a dev box. You will need PR branch and dependencies where you're running the app, and you'll need some type of flow map that says, "This is the auth code, and then this is the sign-up flow," and so on. And using this, your agent can now test your code end-to-end and use vision models to say, "Oh, like, this button technically appears, but it actually is hidden on iPhones," or, "It's not in the first fold on, uh, the iPhone Duo," et cetera. Now, if you do all of this, you'll find that the costs are still quite high. It can cost you anywhere from three bucks to fifteen to twenty to do a single pull request review.
5. Cheaper models for some things
Gupta reserves frontier models for the most critical review tasks and uses smaller models for exploratory work and file reads to reduce the review agent’s running costs.
Text in image
5. Cheaper models for some things AI Engineer
Show 2 builds
- 15:59
Section heading reading “5. Cheaper models for some things” on a white background with a small green accent.
Text in image
5. Cheaper models for some things AI Engineer
- 16:06
White section slide with a short green dash above the heading “5. Cheaper models for some things.”
Text in image
5. Cheaper models for some things AI Engineer
- 15:59
- 16:14
And the thing you'll want to solve for now is to use cheaper models for some things. Now, to me, frontier models are still, generally speaking, more capable than open source models. This has been true for some time, even though the rubber band is tightening. So our share today is about twenty percent frontier models for the most critical tasks, and then the long tail of tokens, which is exploratory, file reads, and so on, we use a variety of smaller models. And so if you do this, you can actually reduce the cost of running your review agent quite drastically. So this is sort of
Token cost per review run
Each review run costs $2–20 in tokens—and runs on every push. Gupta describes reducing costs by reserving frontier models for critical tasks and using smaller models for exploratory work and file reads.
Text in image
$2–20 in tokens per review run And it runs on every push Interface text: OCTOBER 13, 2026 EXPO SESSION Shannon Room
- 16:44
a illustrative example of what we do, which is we'll use a small model for finding context. We'll use a very lightweight computer use model for testing user flows, and then we use a frontier model for things like analyzing bugs, applying the review process, and for submission. In practice, we have actually 20 different subtasks, and each of them has a very specific set of models that we use for each of them. And we have a small research team that is constantly iterating exactly what models to use for what task. You can probably get seventy to eighty percent of the way there using something of this kind, where you just swap out very simple tasks with very simple
- 17:14
models. Now, this is another example of it really helps to have a very large dataset. If you don't have a good dataset, you might be able to ha- trigger happily replace a lot of different sub-agents with smaller, faster models, and you won't know that it's, this agent is actually now quite a bit worse at catching bugs, and you'll only find out when it misses something that then causes an outage or incident.
- 17:34
And you'll also find that you can kind of combat this problem of overactive file reads using a cheap model that essentially looks through all of your context pieces and figures out which ones actually should be included. In theory, you should be able to use a decision model for this, something like Jev or the Decisions API, to do effective re-ranking on all of the different things and deciding what should be and shouldn't be loaded into frontier model cache, which is, in some ways, your most expensive and most scarce resource. If you do all of these things, you might be able to actually get quite far in building your own review agent. And if you do,
- 18:05
please let me know. My email is daksh@greptile.com. I'd love to help you. And, uh, if you choose not to build it, then you can also just use our product, um, which is free in comparison. But, uh, thank you so much.