Skip to main content
ai-coding-agents18 min read

Real-SWE Shows Why AI Coding Agents Need Private Evals Before Production

Use Real-SWE-style private evals to test coding agents on enterprise tickets, regression tests, review gates, and model routing.

ai-coding-agentsbenchmarkssoftware-engineering2026model-routing
Real-SWE Shows Why AI Coding Agents Need Private Evals Before Production
Read time
18 min
Sections
12
Focus
ai-coding-agents

Real-SWE puts a spotlight on the problem engineering leaders have been seeing in production: public coding benchmarks are not enough to decide whether an AI coding agent is ready for an enterprise repo. A model can look strong on issue-resolution leaderboards and still fail when the real task requires internal service knowledge, repo-specific conventions, flaky integration tests, protected files, stale docs, private package permissions, or a senior reviewer’s unwritten rules.

The market cares because coding agents have moved from autocomplete into pull-request automation. Teams are asking agents to inspect tickets, modify multi-file code paths, run tests, respond to reviews, and propose deployable changes. That turns model choice into an operational decision, not a leaderboard decision. A failed agent run burns tokens, CI minutes, reviewer time, and trust.

This post turns the Real-SWE lesson into a workflow your engineering team can copy: build a private coding-agent evaluation loop using representative tickets, regression tests, review gates, and model routing. You will learn what changed, what to measure, which workflows become possible, how to route premium agentic models versus cheaper fallbacks, and how to estimate costs before letting agents touch production branches.

💡 Key Takeaway: Treat public coding benchmarks as model discovery, not deployment approval. Production approval should come from private evals built from your own tickets, tests, permissions, conventions, and reviewer standards.


What changed: coding-agent evaluation is moving from public benchmarks to private repo proof

Real-SWE’s core message is timely because coding agents are now being evaluated against tasks that look more like actual software work: issue context, repository state, tests, patches, and agent behavior across a workflow. That is a better direction than single-function coding prompts, but enterprise teams still need a private layer on top.

Public benchmarks answer: “Can this model solve a representative open-source software issue?”

Private enterprise evals answer: “Can this agent safely solve our tickets in our codebase with our dependencies, test reliability, security rules, permissions, and review expectations?”

Those are different questions. An enterprise codebase contains hidden constraints that rarely appear in public benchmark tasks:

Production constraint Why public benchmarks miss it Eval signal to add
Private dependencies Models cannot infer internal package behavior Build and integration-test success
Repo conventions Naming, layering, lint rules, migration patterns Static checks and reviewer rubric
Permission boundaries Agents may not access secrets, prod configs, or restricted services Sandbox and tool-access audit
Flaky tests Passing once is not enough Re-run policy and flake classification
Monorepo complexity Small ticket can span services, schemas, and generated code Multi-directory diff analysis
Review culture “Works” is not the same as “mergeable” Human review score and requested changes
Deployment risk Correct patch can still break rollout assumptions Canary, feature flag, rollback plan checks

The practical shift is simple: stop asking “Which model tops the benchmark?” and start asking “Which model clears our private gate at the lowest cost per accepted PR?”

This unlocks a more reliable model strategy. Premium agentic models can handle ambiguous, multi-step implementation work. Cheaper models can triage tickets, summarize code, draft tests, or fix narrow lint failures. The best engineering orgs will not standardize on one model for every coding task. They will build routing rules from private eval data.


What Real-SWE-style evaluation makes possible for engineering teams

A private coding-agent eval loop is not just a safety exercise. It creates infrastructure your team can reuse for automation, onboarding, planning, and model procurement. Here are seven practical things you can build now.

1. A private coding-agent leaderboard for your repo

Instead of ranking models on generic coding ability, rank them on your accepted-ticket rate. Use 50 to 200 historical tickets across bug fixes, test updates, refactors, migrations, and small features. Run each agent in the same sandbox and score it on:

  • Patch correctness
  • Test pass rate
  • Lint/typecheck pass rate
  • Reviewer acceptance
  • Security and permission compliance
  • Cost per successful ticket
  • Time to usable PR

This gives engineering leadership a procurement-ready artifact: “Model A costs more, but passes 18% more of our backend migration tickets. Model B is good enough for frontend copy and test maintenance.”

2. A regression suite for coding agents

Once agents start changing code, the agent itself becomes part of your delivery system. Model upgrades, prompt changes, tool changes, and repository restructuring can degrade performance. A private eval suite lets you regression-test the agent before changing the model or system prompt.

Run the same ticket set weekly or before any model upgrade. Track solve rate, average cost, tool-call count, hallucinated file edits, and reviewer rejection reasons.

3. Model routing by ticket class

Not every ticket deserves a premium coding model. A private eval loop lets you route tasks by difficulty.

Ticket class Recommended route Reason
Typo, docs, config, simple tests Cheap model Low ambiguity, easy verification
Isolated bug with strong tests Mid-tier coding model Tests provide reliable feedback
Multi-file feature Premium agentic model Needs planning and repo navigation
Security-sensitive change Premium model + human gate High consequence of subtle mistakes
Database migration Premium model + migration checklist Hidden rollback and data constraints
Flaky test investigation Specialist route with repeated test runs Needs evidence, not just patching

This is where cost savings become real. You do not save money by picking the cheapest model everywhere. You save money by avoiding premium models on simple work and avoiding cheap-model retries on hard work.

4. Review-gated autonomous PRs

A production-ready coding agent should not merge code directly. The safer workflow is autonomous PR creation with strict review gates:

  1. Agent reads ticket and repo context.
  2. Agent proposes plan.
  3. Agent edits code in sandbox.
  4. Agent runs tests and records evidence.
  5. Agent opens PR with summary, risk notes, and test output.
  6. Human reviewer approves, requests changes, or rejects.
  7. Eval system records outcome.

Over time, you can loosen or tighten gates by ticket class. For example, docs-only PRs can be auto-merged after checks pass, while auth, billing, or data migration changes always require senior review.

5. Failed-agent spend reporting

Failed agent runs are expensive because they combine model tokens, tool execution, CI, and reviewer attention. A private eval loop makes failed spend visible. Track:

  • Cost per attempted ticket
  • Cost per accepted ticket
  • Retry count by model
  • Reviewer minutes wasted per rejected PR
  • CI minutes per agent attempt
  • Most common failure category

A model with a higher token price can be cheaper if it gets accepted on the first run. A cheaper model can be expensive if it burns three retries and still needs a human rewrite.

6. Agent permission hardening

Private evals reveal where the agent asks for too much access. You can test whether it tries to read secrets, modify generated files, hit external services, or bypass failing tests. Build permission policies before production:

  • Read-only access for discovery
  • Write access only in branch sandbox
  • No production secrets
  • Approved package install list
  • Network restrictions
  • File path denylist
  • Tool-call logging

7. Engineering onboarding and codebase documentation

The same ticket set can show where your codebase is hard to understand. If several strong models fail because internal patterns are undocumented, humans probably struggle too. Use failed evals to identify missing architecture docs, unclear test commands, brittle setup scripts, and ownership gaps.

[stat] 10x to 40x The practical cost spread between cheap coding-agent routing and premium-only routing on repeated enterprise ticket attempts


The private coding-agent eval architecture

A production-grade eval loop needs more than prompts. It needs a repeatable system that gives every model the same ticket, same repo state, same tools, and same scoring process.

Here is the reference architecture:

Layer What it does Implementation detail
Ticket sampler Selects representative historical or synthetic tickets Pull from Jira, Linear, GitHub Issues
Repo snapshotter Freezes codebase state before the fix Use commit SHA and container image
Agent runner Executes model with tools Shell, editor, grep, test runner, PR tool
Sandbox Prevents unsafe access Ephemeral container with scoped credentials
Test harness Runs unit, integration, lint, typecheck Same commands as CI, plus reruns for flakes
Review gate Scores patch quality Human rubric or senior-engineer review
Cost logger Captures model tokens and tool costs Input/output tokens by step
Results warehouse Stores pass/fail and failure reasons BigQuery, Postgres, or analytics table
Router Chooses model for future tasks Rules from private eval performance

The most important design choice is to evaluate complete workflows, not isolated answers. A coding agent should be judged on whether it produces a reviewable PR with evidence, not whether it writes a plausible code snippet.

⚠️ Warning: Do not let coding agents evaluate themselves as the final gate. Use automated tests, static checks, permission logs, and human review for production-impacting changes. Self-critique is useful for iteration, not approval.


Workflow 1: Build a private ticket eval set from historical engineering work

This workflow creates the foundation: a representative set of private tickets that agents must solve before production use.

Step 1: Select 50 to 200 closed tickets

Start with tickets that already have accepted human fixes. Include a balanced mix:

  • 20% small bug fixes
  • 20% test additions or test repairs
  • 20% medium feature changes
  • 15% refactors
  • 10% dependency or config updates
  • 10% database, schema, or API contract changes
  • 5% security, permissions, or auth-sensitive changes

Avoid only selecting clean tickets. Enterprise value comes from messy integration work, so include tickets with ambiguous descriptions, multiple touched files, and non-obvious test commands.

Step 2: Reconstruct the pre-fix repo state

For each ticket, identify the commit before the human fix. Store:

  • Repository URL or mirror reference
  • Base commit SHA
  • Ticket title and description
  • Linked discussion or acceptance criteria
  • Original human PR diff
  • CI commands used
  • Known flaky tests
  • Files that should not be edited

This makes the task reproducible. The agent should start where the human started, not from the already-fixed code.

Step 3: Define the allowed context

Give the agent enough information to work, but not privileged knowledge from the future. Allow:

  • Ticket description
  • Current repo files at base commit
  • Existing tests and docs
  • Build scripts
  • Internal package docs available at that time

Do not include the final human patch in the prompt. Use it only for scoring and comparison.

Step 4: Run each model in the same sandbox

Every model gets the same environment:

  • Same container image
  • Same time limit
  • Same tool list
  • Same retry policy
  • Same test budget
  • Same branch permissions

This prevents false conclusions. A model with better tools will look better even if the underlying model is not stronger.

Step 5: Score with a mergeability rubric

Use a 100-point rubric:

Category Points Scoring rule
Functional correctness 30 Fixes ticket behavior
Test evidence 20 Adds/runs relevant tests
Code quality 15 Follows repo conventions
Minimality 10 Avoids unnecessary rewrites
Safety 10 No secrets, unsafe commands, or broad changes
Maintainability 10 Clear structure and naming
PR quality 5 Good summary, risk notes, and commands

Set production thresholds. For example, require 80+ for autonomous PR creation and 90+ for any auto-merge candidate.

Step 6: Store costs and failure reasons

For every run, capture input tokens, output tokens, tool calls, wall-clock time, CI cost, reviewer score, and failure category. Use consistent labels:

  • Misunderstood ticket
  • Could not navigate repo
  • Wrong abstraction
  • Test failure
  • Lint/type failure
  • Overbroad diff
  • Permission violation
  • Incomplete PR evidence
  • Flaky test confusion

Step 7: Convert results into routing rules

After 50 to 200 tickets, build routing rules:

  • Cheap model for docs, tests, formatting, simple config
  • Mid-tier coding model for isolated bugs with strong tests
  • Premium model for multi-file implementation, architecture-sensitive changes, and ambiguous tickets
  • Human-only for secrets, compliance, payments, and production incident patches

✅ TL;DR: A private eval set should reproduce the pre-fix state of real tickets, run every model in the same sandbox, score mergeability, and record cost per accepted PR. That gives you routing data you can trust.


Workflow 2: Add review gates to autonomous coding-agent PRs

Once your eval set identifies promising models, the next step is a gated production workflow. The goal is to let agents create useful PRs without giving them uncontrolled merge authority.

Step 1: Classify incoming tickets

Use labels or a triage model to classify every ticket by risk and complexity:

Label Examples Gate
Low risk Docs, copy, tests, comments Auto PR after checks
Medium risk Isolated bug, UI behavior, logging Human review required
High risk Auth, billing, permissions, migrations Senior review required
Restricted Secrets, incident response, legal/compliance Human-only

A cheap model such as GPT-5 nano, Gemini 2.5 Flash-Lite, or Mistral Small 4 can classify tickets at very low cost. Save premium models for implementation.

Step 2: Require a plan before edits

Before modifying files, the agent must produce:

  • Problem summary
  • Suspected files
  • Proposed implementation steps
  • Tests to run
  • Risk areas
  • Rollback considerations for risky changes

This plan is cheap compared with a failed implementation. For high-risk tickets, require human approval of the plan before edits.

Step 3: Run in a branch sandbox

The agent receives write access only in an ephemeral branch or workspace. It cannot push to protected branches, access production secrets, or alter CI configuration outside approved paths.

Log every shell command and file edit. If the agent attempts disallowed paths, terminate the run and record a permission failure in the eval dataset.

Step 4: Require evidence in the PR body

A coding-agent PR should include:

  • Ticket summary
  • Files changed and why
  • Test commands run
  • Full test result summary
  • Known skipped or flaky tests
  • Risk assessment
  • Rollback plan if relevant

This is a review accelerator. If the agent cannot explain what it changed, the PR is not production-ready.

Step 5: Use automated and human review gates

The PR must pass:

  1. Formatting and lint
  2. Typecheck
  3. Unit tests
  4. Relevant integration tests
  5. Security scans for sensitive paths
  6. Human review for medium/high-risk work

For high-risk changes, require the reviewer to score the PR with the same rubric used in eval. That keeps production feedback connected to your private benchmark.

Step 6: Feed outcomes back into routing

Every PR outcome should update your routing table. If a cheap model repeatedly fails backend integration tickets, remove that route. If a premium model consistently handles migrations well, reserve it for those cases.

The loop is continuous: evaluate, route, review, record, improve.


Practical model stack for enterprise coding-agent evals

A strong coding-agent stack uses multiple models rather than one model for every step. The best model for implementation is not always the best model for triage, summarization, review, or cost control.

Workflow step Recommended model tier Example models Why
Ticket triage Cheap/fast GPT-5 nano, Gemini 2.5 Flash-Lite, DeepSeek V4 Flash Low-cost classification
Repo summarization Cheap long-context Gemini 3 Flash, Grok 4.1 Fast, Llama 4 Scout Large context at lower cost
Implementation Coding/premium GPT-5.3 Codex, Claude Sonnet 5, Claude Opus 5 Strong code editing and reasoning
Hard debugging Premium reasoning GPT-5.2 pro, o3-pro, Claude Fable 5 Ambiguous failures and deep analysis
Review assistant Mid-tier GPT-5.2, Gemini 3 Pro, Claude Sonnet 5 Diff review and risk analysis
Cheap fallback Budget DeepSeek V3.2, Mistral Large 3, GPT-5 mini Narrow fixes and retries

For coding-specific work, GPT-5.3 Codex is a strong default candidate because it is priced at $1.75 input / $14 output per 1M tokens with a 256,000-token context window. For broader agentic implementation, Claude Sonnet 5 at $2 input / $10 output per 1M tokens and 1,000,000-token context is a practical premium route. Claude Opus 5 costs $5 input / $25 output per 1M tokens, so reserve it for tickets where correctness, planning, and review quality justify the premium.

If your team is already comparing frontier models, use the GPT-5 vs Claude Opus 4.6 comparison and GPT-5 vs Gemini 3 Pro comparison as a starting point, then validate against your private eval.


Model Choice and Cost: premium agents versus cheaper fallbacks

Cost analysis for coding agents must be task-based. A single agent attempt often includes ticket reading, repo search, planning, code edits, test interpretation, PR writing, and review response. That can easily reach tens or hundreds of thousands of tokens.

For a realistic enterprise coding-agent run, assume:

  • 120,000 input tokens from ticket context, repo snippets, tool outputs, and test logs
  • 20,000 output tokens from plans, code patches, explanations, and PR content
  • One complete attempt, excluding CI infrastructure cost

Using current pricing:

Model Input / output price per 1M tokens Estimated cost per run Cost per 1,000 runs Best use
GPT-5.3 Codex $1.75 / $14 $0.49 $490 Default coding-agent implementation
Claude Sonnet 5 $2 / $10 $0.44 $440 Premium implementation with long context
Claude Opus 5 $5 / $25 $1.10 $1,100 Hard multi-file or ambiguous changes
GPT-5.2 pro $21 / $168 $5.88 $5,880 Deep debugging and critical changes
o3-pro $20 / $80 $4.00 $4,000 Complex reasoning and failure analysis
GPT-5 mini $0.25 / $2 $0.07 $70 Simple fixes and cheap fallback
DeepSeek V3.2 $0.28 / $0.42 $0.042 $42 Low-cost triage and narrow edits
Mistral Large 3 $0.5 / $1.5 $0.09 $90 Budget implementation and review
Gemini 2.5 Flash-Lite $0.1 / $0.4 $0.02 $20 Classification, summaries, small tasks
$0.042
DeepSeek V3.2 estimated coding-agent run
vs
$1.10
Claude Opus 5 estimated coding-agent run

The cheapest model is not automatically the cheapest workflow. If DeepSeek V3.2 needs four attempts and still requires a human rewrite, the real cost includes reviewer time and delay. If Claude Sonnet 5 solves the ticket once and produces a clean PR, its $0.44 model cost can be the better business decision.

Use this routing policy as a starting point:

Task type Primary model Cheaper fallback Premium escalation
Ticket classification GPT-5 nano Gemini 2.5 Flash-Lite None
Docs or comments DeepSeek V3.2 Mistral Small 4 GPT-5 mini
Unit test generation GPT-5 mini Mistral Large 3 Claude Sonnet 5
Isolated bug fix GPT-5.3 Codex Mistral Large 3 Claude Sonnet 5
Multi-file feature Claude Sonnet 5 GPT-5.3 Codex Claude Opus 5
Ambiguous production bug Claude Opus 5 Claude Sonnet 5 GPT-5.2 pro
Security-sensitive change Claude Opus 5 + human None Human-only
Deep failing-test analysis o3-pro Claude Sonnet 5 GPT-5.2 pro

Premium models are overkill for classification, docs, formatting, simple test snapshots, translation of error logs, and PR summaries. Use cheaper models there. Premium models are justified when the task requires long-horizon planning, cross-service reasoning, hidden dependency inference, or careful tradeoff explanation.

📊 Quick Math: If your team runs 5,000 coding-agent attempts per month, routing all attempts to Claude Opus 5 at $1.10/run costs about $5,500/month in model usage. A mixed route with 50% DeepSeek V3.2, 30% GPT-5.3 Codex, and 20% Claude Sonnet 5 costs about $1,007/month before CI and review time.

Use AI Cost Check to adjust these estimates with your actual input/output token mix. Coding-agent workloads with huge test logs can skew heavily toward input tokens, while review-response loops can increase output tokens.


How to decide whether a coding agent is production-ready

A coding agent is production-ready for a ticket class when it clears measurable thresholds in your private environment. Do not approve a model globally. Approve model-task pairs.

Use these gates:

Gate Production threshold
Eval set size Minimum 50 tickets for pilot, 200 for broad rollout
Mergeable PR rate 70%+ for low-risk, 85%+ for high-value automation
Permission violations 0 tolerated in production pilot
Test evidence quality 90%+ of PRs include relevant commands and results
Overbroad diffs Under 5% of accepted PRs
Reviewer rejection for misunderstanding Under 10%
Cost per accepted PR Below your internal engineering-time benchmark
Regression stability No major drop across two consecutive eval runs

The best single metric is cost per accepted PR, not cost per run. Calculate:

Cost per accepted PR = total model cost + CI cost + reviewer time cost / accepted PR count

If a model costs $0.50 per attempt but produces a clean PR in one run, it beats a $0.05 model that fails repeatedly and consumes a senior engineer’s review time.

Also measure time-to-merge. Coding agents can produce fast drafts that sit in review because the patch is hard to trust. A useful PR should include enough evidence to reduce reviewer burden.


Risks, limits, and when not to use AI coding agents

Real-SWE-style evaluation reduces risk, but it does not remove it. Coding agents should be constrained in production, especially in complex enterprise systems.

Do not use autonomous agents for these tasks

  • Production incident mitigation without human command
  • Secrets, key rotation, or credential handling
  • Payment logic changes without senior review
  • Compliance, legal, or audit-sensitive code
  • Large architectural rewrites
  • Database migrations without rollback validation
  • Security patches where exploitability analysis is required
  • Code where tests are known to be weak or missing

Watch for hidden cost traps

Coding-agent costs do not come only from token prices. Watch for:

  • Repeated test logs pasted into context
  • Agents running full integration suites too often
  • Long review-response loops
  • Retry storms after flaky failures
  • Overuse of premium models on small tickets
  • Agents reading entire monorepo context instead of targeted files
  • CI minutes from failed branches
  • Human review time for low-quality PRs

Control the context window

Long-context models are useful, but dumping the whole repo into context is wasteful. Use search and retrieval first. Feed the model targeted files, dependency graphs, test output, and conventions. For very large monorepos, build a repo map and let the agent request files on demand.

Treat model upgrades as breaking changes

A newer model can be worse for your conventions, tools, or prompts. Before switching from one model to another, run the private eval suite and compare:

  • Accepted PR rate
  • Average run cost
  • Tool-call count
  • Permission issues
  • Review quality
  • Failure categories

Model upgrades should go through the same release discipline as compiler upgrades or CI changes.


Implementation checklist for the next 30 days

Here is a practical rollout plan.

Week 1: Build the eval foundation

  • Select 50 historical tickets
  • Reconstruct base commits
  • Create containerized sandbox
  • Define allowed tools and denied paths
  • Write scoring rubric
  • Decide initial model candidates

Start with three models: one cheap fallback, one coding default, and one premium escalation. For example: DeepSeek V3.2, GPT-5.3 Codex, and Claude Sonnet 5.

Week 2: Run baseline evals

  • Run each model on the same tickets
  • Capture token usage and tool logs
  • Score PRs with the rubric
  • Record failure categories
  • Calculate cost per accepted PR
  • Identify ticket classes where each model wins

Do not tune prompts after every failure. First run the baseline consistently so you have comparable data.

Week 3: Add routing and review gates

  • Define ticket classification labels
  • Route low-risk tasks to cheaper models
  • Route ambiguous work to premium models
  • Require plan-before-edit for medium/high-risk tickets
  • Require PR evidence templates
  • Connect reviewer feedback to eval records

Week 4: Pilot on live tickets

  • Start with low-risk and medium-risk tickets
  • Require human review on all agent PRs
  • Track accepted PR rate
  • Track reviewer time
  • Track failed-agent spend
  • Run a weekly regression eval
  • Update routing rules

At the end of 30 days, you should have a private leaderboard, a cost model, and a production policy for which coding-agent workflows are safe.


Frequently asked questions

What is Real-SWE and why does it matter for AI coding agents?

Real-SWE is part of the broader shift toward evaluating coding agents on realistic software-engineering tasks instead of isolated coding prompts. It matters because enterprise success depends on repo integration, tests, permissions, conventions, and reviewability, not just benchmark problem solving.

How much does a coding-agent run cost?

A realistic coding-agent attempt with 120,000 input tokens and 20,000 output tokens costs about $0.042 on DeepSeek V3.2, $0.49 on GPT-5.3 Codex, $0.44 on Claude Sonnet 5, and $1.10 on Claude Opus 5. Use AI Cost Check to recalculate with your actual token mix.

Which model should we use for enterprise coding agents?

Use GPT-5.3 Codex or Claude Sonnet 5 as the default implementation tier, DeepSeek V3.2 or GPT-5 mini for cheaper low-risk work, and Claude Opus 5 for ambiguous multi-file changes. Approve each model by ticket class after private evals.

How many private tickets do we need for a useful coding-agent eval?

Start with 50 historical tickets for a pilot and expand to 200 before broad rollout. Include bugs, tests, refactors, config updates, migrations, and security-sensitive examples so your eval reflects real engineering work.

When should we not use AI coding agents?

Do not use autonomous coding agents for production incidents, secrets, payment logic, compliance-sensitive code, large architecture rewrites, or database migrations without senior review. Use agents to draft and test, but keep human approval for high-risk changes.


CTA: build your private coding-agent cost and eval plan

Real-SWE’s practical lesson is clear: public benchmarks help you shortlist models, but private enterprise evals decide production readiness. Build a ticket-based eval loop, measure mergeable PR rate, record failed-agent spend, and route models by task difficulty.

Next steps:

The winning workflow is not “pick the top benchmark model.” It is “prove the agent on your tickets, in your repo, with your tests, then route every task to the cheapest model that reliably produces a mergeable PR.”