The runtime for
verified software work

ML.ai turns an issue into a tested pull request through an engineered pipeline: a code graph that knows your repo, a contract fixed before work starts, twelve gates around every agent step, a sandbox per attempt, and an evidence bundle behind every claim. This is how it works, in detail.

acme-storefront · ml fix #381 · trace
$ml fix github.com/acme/storefront/issues/381
contracttask_7f3a · scope 4 paths · 3 checks
graphindex @4e1a9c2 · 18 files re-parsed
retrieveRRF(lexical, semantic, graph) → 11 symbols
impact2 tests affected · review tier: high
sandboxworktree wt_02 · egress off · lease ok
── agent step · edit ───────────────
verifyscope ✓ tsc ✓ lint ✓ tests 214/214 ✓
evidencebundle sha256:e83b… chained
verdictapproval_required (src/payments)
✓PR #392 opened with proof card4m 12s

Why we’re buildingML.ai

Software should be something anyone can build, and AI-written code should be something anyone can trust.

We believe everyone should be able to build software.

A student, a freelancer, a two-person startup, a platform team in a large enterprise: anyone with an idea should be able to turn it into working, tested software. Today that ability is rationed. Coding agents are priced by the token, stop when the budget runs out, and hand back work you still have to check line by line. Cheap generation hasn’t made software cheap, because trust is still expensive. We don’t ask you to trust the agent. We show you the evidence: the agent proposes, contracts and checks decide, you approve.

src/checkout/PayButton.tsxuntrusted
const submit = async () => {
- await charge(cart)
+ if (paid.current) return
+ paid.current = true
+ await charge(cart)
}

The agent writes a diff. Nothing it produces is trusted yet.

The hard problems are system problems

Look at why agents fail on real repositories. Almost none of it is about raw intelligence. It's about context, control and checking, and those can be engineered. Every row here is a component on this page. That's the product.

What you seeIt edits the wrong file

Changes code nobody asked it to touch

What it actually isA context problem
Where it is solved
code graphranked retrievalscope gates

Every failure maps to a component you can inspect on this page.

Why this means unlimited

When the system eliminates wasted work, each verified task costs less, so there's no reason to make you count tokens. Fair-use and concurrency rules apply.

Token budgetallowance for the period
migrate auth
62%

Budget spent. The task stops at 62%.

A meter stops the work the moment the budget runs out.

HowML.airuns a task

Every task takes the same path: twelve gates, five planes that each own one job, and eight rules the system never bends.

One task, start to finish

This example is modelled on a real fix: a checkout bug where clicking Pay twice charged the customer twice. Running ml fix #381 starts the task. The chart follows it from the first safety check to the moment it waits for you to approve. Most bars are the system working. The striped one is the system waiting for you.

Trace · task_7f3a · 252s totalExample trace
Gates
1.3s
Context
9.5s
Agent
94s
Checks
63s
Evidence
6s
You
77s
0s60s120s180s240s
gate · t+0.0sclassify: payments touched, risk high
Agent steps 94sChecks 63sYour approval 77sEverything else 18s

Checks and your approval take longer than generation. They run in parallel where they do not share state, and typecheck and lint start the moment the patch lands.

The twelve gates

Every agent step passes the same fixed path: six gates before it, six after. Same gates on every surface, whatever happens inside the step.

Core gates shipping
6
gates before the step
1
agent step, untrusted
6
gates after the step
mlai run · task_7f3a checking before the step
Agent stepuntrusted until checked
Classify

Works out what kind of step this is: edit, plan, fix, review or question, plus its risk.

$checkout bug · touches payments → risk: high

Eight invariants

Rules the runtime never breaks. Every component is designed around them.

I-6Side effects stay safe
No write without a lease

Attempts hold path-level leases on their worktree. Two attempts never edit the same file.

I-5Side effects stay safe
Side effects are idempotent

Every external action carries an idempotency key, so a retry can never double-apply.

I-4Who is in charge
Deterministic before generative

If a tool, recipe or cache can do the step, the agent doesn't.

I-8Who is in charge
Humans own merges

The runtime opens PRs. It never merges or deploys on its own.

I-1No completion without evidence
I-1What counts as done
No completion without evidence

'Done' is a verdict computed from checks, never a summary written by the agent.

I-3What counts as done
Contracts are immutable

Scope and acceptance checks are fixed before work starts. The agent can't move the goalposts.

I-7What counts as done
Fail closed

If a gate can't decide (missing evidence, unknown path), the answer is no.

I-2Who is in charge
Agent output is untrusted input

Every diff, command and tool call is validated against schema and policy before it runs.

How it is built

Each part of ML.ai has one job. The control plane makes decisions, the context plane knows your repo, the execution plane runs the work, the verification plane checks it, and the evidence plane records what happened.

mlai · system Control plane · Gateway
CLIIDEGitHubWebDesktop
Control planeOwns decisions.
Gateway

Auth, tenancy, rate and concurrency limits

Orchestrator

Mission → Task → Attempt lifecycle, retries, timeouts

Policy engine

Evaluates mlai.yml and contracts into allow/deny/approve

Gate pipeline

Six pre-step and six post-step gates

Context planeOwns knowledge of your repo.
Code graph

Symbols, calls, imports, routes, tables, tests, owners

Ranked retrieval

Lexical + semantic + graph, fused with RRF

Repo memory

MLAI.md, Skills, durable decisions

Execution planeOwns side effects.
Sandbox per attempt

Ephemeral container, CPU/mem/time caps, egress off

Worktree + lease

Fresh checkout at baseline SHA, path-level write leases

Tool runner

Allow-listed commands, schema-validated tool calls

Verification planeTurns evidence into a verdict.
Check runner

Tiered checks chosen by impact and risk

Verdict engine

Pure function of contract + evidence + policy

Proof builder

PR proof card, shareable proof page

Evidence and telemetryOwns the truth about what happened.
Evidence store

Append-only, hash-chained bundles

Traces

Span per gate, step and check

Learning signals

Accepted, rejected and edited diffs

Deep dives

The parts that do the work, with the data structures and code behind them.

Code graph and ranked retrieval

Most agent mistakes start with the wrong context. ML.ai keeps a map of your codebase, every function, call, import and test, and hands each task only the slice it needs, inside a fixed budget.

To find that slice, three searches run side by side: by keyword, by meaning, and by how code connects. Their scores can’t be compared directly, so we merge the rankings instead, using Reciprocal Rank Fusion. After a change, we walk the graph backwards to find what it could break, so the most affected tests run first.

  • ShippingCode graph and ranked retrieval
  • In developmentImpact map
  1. 01
    ParseSyntax trees

    Per-language parsers turn files into symbols. Keyed by content hash.

  2. 02
    LinkTyped edges

    calls · imports · routes · tested_by · owned_by

  3. 03
    ClusterCommunities

    Hierarchical clustering groups related code into named modules.

  4. 04
    LabelBudgeted labels

    One representative per cluster gets a summary; exact names remain.

  5. 05
    ServeQuery + impact

    Ranked retrieval and reverse-edge impact for each task.

Incremental on every commit. Parsing is keyed by content hash, so unchanged files are skipped.

Task contracts and policy as code

A contract fixes what one task must achieve and may touch, before the agent starts. A policy sets what any task in your repo may ever do. Both are plain files, reviewed like any other change.

  • ShippingMLAI.md and permissions
  • In developmentTask contracts and mlai.yml
# Task contract: fixed before the agent starts. Immutable (I-3).
id: task_7f3a
objective: "Stop double charges when Pay is clicked twice"
source: github.com/acme/storefront/issues/381
baseline: 4e1a9c2
scope:
  allow:
    - src/checkout/**
    - src/components/PayButton.tsx
  deny:
    - infra/**
    - "**/*.env*"
acceptance:
  - id: regression
    run: pnpm test -- checkout/double-submit.spec.ts
    expect: pass
  - id: suite
    run: pnpm test
    expect: pass
limits:
  wall_clock: 30m
  repair_attempts: 3
risk: high
approval: required

Fixed before the agent starts, and it cannot be changed mid-task.

Sandboxes and isolation

Every attempt runs in its own throwaway environment. That is why parallel jobs can’t step on each other, and why a failed attempt leaves nothing behind.

  • ShippingIsolated parallel jobs
  • In developmentFull isolation spec
Fresh checkout per attempt

A git worktree at the contract's baseline SHA. A failed attempt is discarded.

worktree
Path-level write locks

Parallel tasks in one mission lease disjoint paths.

leases
CPU, memory, wall clock

Hard caps per sandbox. Runaway processes are killed and recorded.

limits
Network off by default

Package registries go through an allow-listed cache.

egress
Injected, never shown

Credentials go to allowed commands, never into the agent's context.

secrets
Schema-checked calls

Tool calls are validated by name and schema.

tools

Verification engine

Checks are picked by risk and by what the change touches. The cheap ones that catch the most run first, and checks that don’t share state run at the same time.

  • ShippingTests and pull requests
  • In developmentCheck tiers and verdicts
tier_1seconds

Every task. Scope, typecheck, lint, impacted tests, new regression test.

tier_2minutes

Before any PR. Full test suite, secrets scan, build.

tier_3minutes or more

When risk is high. Static security analysis, dependency audit, migration dry-run.

humanyour call

On sensitive paths. Approval, with the proof card attached.

Checks that catch the most for the least time run first. Checks that share no state run together.

Evidence bundles and proof cards

Every claim in a pull request points to a record: the command that ran, its exit code, how long it took, and a digest of its output. Records are append-only and chained by hash, so nothing can be quietly edited.

  • In developmentEvidence bundles and proof cards
PR #392: Fix double-charge on checkout4e1a9c2 to b7d03f1 · policy v3
approval required

Checks

scope, 2 of 4 paths · 0.2s
tsc --noEmit · 11.4s
regression spec · 2.8s
214 tests · 48.0s

Not yet proven

gateway latency under load
Safari double-tap timing

What a reviewer sees on the pull request. Shared proof pages show the evidence, never your conversation.

The repair loop

“Try again” isn’t a strategy. Each kind of failure has its own response, and the same error twice in a row is never retried a third time.

  • In developmentFailure taxonomy and limited repair
build_error
Compiler exit is not zero

Targeted fix at the reported locations

test_failure
Assertion diff and stack trace

Reproduce, find the cause, make a scoped fix

wrong_target
The scope gate was hit

Discard the worktree, retrieve again, re-plan

misread_spec
Suite passes, regression test fails

Re-plan from the contract with fresh context

environment
Timeout or flaky infrastructure

One retry with backoff, then a human

repeat_signature
The same error hash twice

Stop. New approach or a human, never a third try

Durable missions

Quick edits stay interactive. Long work, such as a migration or an overnight upgrade, runs as a mission: a set of tasks that survives crashes, CI waits and restarts.

At every checkpoint ML.ai saves a short packet: the contract, the baseline, decisions made, failures seen, links to evidence, the budget left and the next step. A resumed attempt starts from that packet instead of replaying a long transcript.

  • ShippingParallel jobs
  • In developmentDurable missions
queuedplanningrunningverifyingsuspendedrepairingverifiedawaiting approvalblockedPR opened

Every transition is an event, so a task can always be replayed.

Caching and efficiency

Most waste in an agent run is repetition: re-reading files, re-ranking, re-installing, re-running. Every layer here is keyed by a hash of its content, so identical work is never done twice.

  • ShippingContent-hash caches
  • ResearchRecipes
graph.indexhash(file content)

Saves: re-parsing unchanged files

context.prefixhash(rules + schemas)

Saves: re-sending stable context

retrievalhash(query, graph version)

Saves: re-ranking identical context

depshash(lockfile)

Saves: reinstalling packages

checkshash(tree + command + env)

Saves: re-running an identical check

recipestask signature

Saves: open-ended generation for known fixes

The number we optimizecost per verified task = (steps + checks + sandboxes + retries) / verified tasks

Code graph and ranked retrieval

Most agent mistakes start with the wrong context. ML.ai keeps a map of your codebase, every function, call, import and test, and hands each task only the slice it needs, inside a fixed budget.

To find that slice, three searches run side by side: by keyword, by meaning, and by how code connects. Their scores can’t be compared directly, so we merge the rankings instead, using Reciprocal Rank Fusion. After a change, we walk the graph backwards to find what it could break, so the most affected tests run first.

  • ShippingCode graph and ranked retrieval
  • In developmentImpact map
  1. 01
    ParseSyntax trees

    Per-language parsers turn files into symbols. Keyed by content hash.

  2. 02
    LinkTyped edges

    calls · imports · routes · tested_by · owned_by

  3. 03
    ClusterCommunities

    Hierarchical clustering groups related code into named modules.

  4. 04
    LabelBudgeted labels

    One representative per cluster gets a summary; exact names remain.

  5. 05
    ServeQuery + impact

    Ranked retrieval and reverse-edge impact for each task.

Incremental on every commit. Parsing is keyed by content hash, so unchanged files are skipped.

Research: how coding agents actually fail

Pass rates hide most of what goes wrong in real codebases. We study how agents fail, and each finding becomes part of the product.

P1

Measure the whole system

We test full setups first, then switch off retrieval, verification or repair one at a time to see what each is worth.

P2

Verified is the metric

We count the cost and time to reach a correct, tested result, not tokens per second.

P3

Label every number

Each figure is marked measured, reported or projected, and the three are never mixed.

  1. BlastBench

    In preparation

    How much of the codebase does an agent touch beyond what the fix needed?

    Every unneeded line costs review time and raises merge risk, and pass-rate benchmarks don't see it.

    Part 1
    One-LineBench: the correct fix is tiny.
    Part 2
    Zero-LineBench: the right answer is to change nothing.
    Becomes
    Scope gates, and files changed versus files allowed on every proof card.
  2. RetryBench

    Protocol designed

    After a failure, does the agent fix the cause, or repeat the mistake at higher cost?

    On long jobs, how an agent recovers matters more than whether it gets the first try right.

    Compares
    Six recovery strategies, grouped by the type of first failure.
    Becomes
    A failure taxonomy, a stop on repeated errors, and limited repair.
  3. StickyBench

    In preparation

    Same final task, different history: how much does old context change the answer?

    Long sessions pile up wrong guesses and abandoned plans, and they quietly bend later answers.

    Design
    One fixed task under six history conditions.
    Becomes
    Recovery packets instead of transcripts, and scoped attempts.

Changes beyond what the fix needed

Minimal fix, 1 file

Typical patch, 9 files

NeededUnneededFormat churn

How much of the codebase does an agent touch beyond what the fix needed?

Every unneeded line costs review time and raises merge risk, and pass-rate benchmarks don't see it.

Part 1
One-LineBench: the correct fix is tiny.
Part 2
Zero-LineBench: the right answer is to change nothing.
Becomes
Scope gates, and files changed versus files allowed on every proof card.

Changes beyond what the fix needed

Minimal fix, 1 file

Typical patch, 9 files

NeededUnneededFormat churn

Open problems

Six questions we are still working on, and the rule each one has to respect.

Ordering verification by information gain

Given a patch and its impact set, which subset of checks catches the most real regressions for the least compute? We learn per-repo check yield from history and run high-yield, low-cost checks first.

tier_2 always runs before a PR. Optimization only reorders, never skips required checks.

Reverse edges when types don't help

Static call graphs miss dynamic dispatch and reflection. We combine static edges with runtime traces from test runs to close the gap.

Metric: recall of tests that fail on a seeded regression, at a fixed test budget.

Migrations and fixes that shouldn't need generation

A recipe is a parameterized plan of codemods and checks. The agent only handles the residue a codemod cannot.

Kept only if it lowers cost per verified task with no rise in regressions.

What's the smallest state that fully resumes a task?

Too little and the resumed attempt repeats work; too much and stale context leaks back in. We compare packet variants by resume success and contamination.

Accepted, rejected and edited diffs as signal

Signals tune retrieval weights, check ordering and planning for one repository at a time, evaluated on held-out tasks.

Long-term, and never a substitute for tests

Can we predict which tests will break, to order checks and catch bad plans early? Predictions only reorder work, never replace a real check.

From finding to component

Each result on this page ends up as a part of the product.

Agents over-editContract scope, the scope gate, files allowed on the proof card
Agents loop on failureFailure taxonomy and the repeat-signature stop
History bends answersRecovery packets and scoped attempts
"Done" is a claimA verdict computed from evidence
Long jobs breakA durable state machine, idempotency keys and leases
Most cost is repetitionContent-hash caches and recipes

What's next

What ships today, what we are building, and what is still research.

Now

Shipping

In the product today

  • Infinite across CLI, IDE, GitHub and web
  • Code graph with RRF-ranked context
  • Isolated parallel jobs and routines
  • Core gates, permissions, MLAI.md and Skills
  • Tests run and PRs opened with summaries

Next

In development

Being built now

  • Task contracts and the verdict engine
  • Evidence bundles and proof cards
  • Impact map with affected-test ordering
  • Durable missions with recovery packets
  • One mlai.yml across every surface

Later

Research

In the lab, not a promise

  • Check ordering by learned yield
  • Recipes for known migrations
  • Per-repository learning
  • Effect prediction, only once it beats real tests

Now

Shipping

In the product today

  • Infinite across CLI, IDE, GitHub and web
  • Code graph with RRF-ranked context
  • Isolated parallel jobs and routines
  • Core gates, permissions, MLAI.md and Skills
  • Tests run and PRs opened with summaries

Agents write code
ML.aimakes it provable

You describe the outcome. ML.ai plans it, scopes it, does the work in isolation, checks it, records the evidence and hands you something you can merge with confidence, whether that takes four minutes or four days.