Product
Platform Agentic Code Scanner Unified Runner Tomosu Agents Indexes Solutions
Get Started
Scan your repo VS Code plugin Tomosu MCP GitHub App CodeRabbit FAQ
Resources
Case Studies Governance Impact TCO Calculator Download / Free Trial
Company
About Blog Production Reliability series Production Debugging guides AI Observability News Contact Request Demo →
How Tomosu Agents Work

From pre-merge to production, one reliability loop.

Tomosu runs a small set of agents across the places where reliability is won or lost: the editor, the pull request, the running system and the post-incident review. They read the same evidence an experienced engineer would, score it on one scale, propose the fix, and feed what production teaches back into the next check. This page walks through that loop end to end.

01 · Pre-merge

Find and fix before it ships

Files are scored as they are written and every pull request is scored before review. Findings arrive with a proposed fix and a projected PRI change.

Reads the diff, repo structure, dependency manifests, infrastructure configProduces findings, fixes, a PRI delta, a merge verdict
02 · Merge gate

Hold the line on the score

A change that would lower the PRI below your policy does not merge quietly. The check explains which dimension moved and what would restore it.

Reads the PR, the current PRI, your merge policyProduces a pass or a block, with the reason on the PR
03 · Production

Detect, resolve, escalate

Runtime signals are matched to known reliability patterns and to your own incident history. Routine incidents are resolved automatically with an evidence trail; the rest are escalated with context attached.

Reads metrics, logs, traces, deploy events, ticketsProduces a resolution or an escalation, plus the change that caused it
04 · Learn

Turn incidents into guardrails

Each escalation becomes a new check upstream, in the editor and on the PR, so the same class of failure is caught before it reaches production again.

Reads resolved incidents, accepted fixes, recurrence dataProduces new rules, a stricter PRI where you actually fail
Stage 1 · Pre-merge

What the agents do before a change merges

Pre-merge is where most reliability debt is created and where it is cheapest to remove. The agents work in the two places developers already are: the editor and the pull request.

Pull request #482 · checks
tomosu-aibotreliability review
PRI 81 → 74 if merged as-is · merge held
  • Dependency healthno new transitive risk
  • Observability readinessmetrics and trace present
  • Fault toleranceunbounded retries · fix proposed
Accepting the proposed fix restores the score to 81 and releases the hold.
  • 1
    Read the change in contextThe agent reads the diff together with the surrounding code, the dependency manifests and any infrastructure-as-code in the repository, so a missing timeout is judged against the service that will actually make the call.
  • 2
    Match against reliability patternsFindings come from a library of known failure patterns: error handling, retries and backoff, timeouts, resource leaks, concurrency, configuration drift, dependency risk, observability gaps, and the shortcuts AI assistants tend to take. Patterns learned from your own incidents are checked first.
  • 3
    Score and rankEvery finding carries a severity and a dimension of the PRI it affects. The agent ranks them by how much each one moves the score, so the list starts with what matters.
  • 4
    Propose the fixWhere a fix is safe to express in code, the agent proposes it inline. In the editor you accept it with one action; on a pull request it is posted as a suggestion before a reviewer opens the diff.
  • 5
    Post the verdictThe pull request check shows the PRI as it is and as it would be if the change merged as-is. If the projected score crosses your policy line, the merge is held and the reason is written on the PR. Nothing leaves GitHub.
Tomosu recommendations

What a recommendation contains

Every finding the agents raise is delivered as a recommendation: a self-contained unit you can judge, accept or decline without opening another tool. The same recommendation shows up in the editor, on the pull request, on the dashboard and in Claude through the MCP server.

HighFault tolerance · FI+4 PRI if accepted

Add a timeout and a retry budget to the payment webhook call

Why it matters. The call on line 41 of payment_client.py has no timeout. Under provider latency it holds a worker per request until the pool is exhausted. The same pattern caused incident #92 on this service in March.

- resp = httpx.post(url, json=payload)
+ resp = httpx.post(url, json=payload, timeout=2.5)
+ # retried by the caller: max 3 attempts, exponential backoff
Evidenceincident #92 · p99 trace 14:02 UTC · pool saturation on deploy #2311
Accept fixDecline with reasonSnooze until next release
  • 1
    A finding with a severity and a dimensionWhat is wrong, how serious it is, and which PRI sub-index it affects. Severity is weighted by blast radius, so a missing timeout on a payment path ranks above the same gap on a batch job.
  • 2
    The evidenceThe lines involved, the related incidents or signals from the Production Context Graph, and the pattern the finding matched. You can see why the agent raised it before deciding.
  • 3
    A proposed fixWhere a safe fix exists it is attached as a diff. Where the remedy is a design decision, the recommendation describes the options instead of guessing.
  • 4
    The projected PRI changeWhat the score would do if the recommendation were accepted, and if it were ignored and merged. This is what ranks the list.
  • 5
    An action and a recordAccept applies the fix and re-scores immediately. Decline asks for a reason and stops the same finding from being raised again on that code. Either way the decision is logged with who made it and when.
Code hardeningTimeouts, retries, circuit breakers

Error handling, backoff, resource limits, concurrency guards and the shortcuts AI assistants tend to leave behind.

Dependencies and infrastructurePins, upgrades, limits, redundancy

Vulnerable or abandoned packages, infrastructure-as-code that removes redundancy or alerts, missing pod disruption budgets and the like.

Observability and agentsMetrics, traces, budgets, guards

Missing metrics or traces on critical paths, and for agentic code: step budgets, tool-result checks and prompt-injection containment.

PRI scoring

One score, seven dimensions

The Production Reliability Index (PRI) is a 0 to 100 score for a repository or a service. It is built from seven sub-indexes that each measure one aspect of reliability, so a single number is still explainable: you can always see which dimension moved and why.

FIFragility Index

How likely this code is to break, based on structural signals and real production behavior.

DIDrift Index

The gap between what development expected and what production delivered.

GCGovernance Compliance

Severity-weighted adherence to your coding, security and observability standards.

RSRuntime Signals

Live production health: error rate, latency and resource anomalies, aggregated per service.

CVCode Volatility

Churn and hotspot density. Files that keep re-triggering the same issues are penalized.

DVDeployment Velocity

Frequency and safety of releases. Small, confident batches are rewarded.

EEIEscalation Index

The interrupt tax on engineering: repeat ticket rate, tier-level time to resolve, senior on-call load.

ARAgent Reliability

Added to the roll-up only for codebases that run AI agents. Explained further down this page.

Example breakdown · checkout-api
Seven sub-indexes on one scale, rolled up into the PRI. Values are illustrative.
0 25 50 75 100 FI Fragility62FI Fragility: 62 DI Drift70DI Drift: 70 GC Governance74GC Governance: 74 RS Runtime Signals58RS Runtime Signals: 58 CV Code Volatility66CV Code Volatility: 66 DV Deployment Velocity71DV Deployment Velocity: 71 EEI Escalation64EEI Escalation: 64 AR Agent Reliabilityno agents detected · left out of the roll-up PRI roll-up66PRI roll-up: 66, Good
Sub-indexPRI roll-upNo data, excluded
Example PRI breakdown for checkout-api
Sub-indexScore
FI Fragility62
DI Drift70
GC Governance74
RS Runtime Signals58
CV Code Volatility66
DV Deployment Velocity71
EEI Escalation64
AR Agent Reliabilityno data
PRI roll-up66

How the number is read

Each sub-index is scored on the same 0 to 100 scale from the evidence available for it, then rolled up into the PRI. The weighting is calibrated per organization to reflect its architecture, maturity and risk tolerance, so two teams with the same findings can reasonably land on different scores. The trend over time matters more than any single reading.

Fragile0 – 39
Improving40 – 59
Good60 – 74
Reliable75 – 100

What moves it

Accepting a proposed fix raises the dimension it belongs to. Merging a regression lowers it. Runtime signals, resolved incidents and escalations feed the production-side dimensions as they happen. A dimension with no real signal yet, for example Runtime Signals before any telemetry is connected, is left out of the roll-up rather than guessed, so a first scan is honest about what it can and cannot see.

What a first scan usually says

Most repositories start in the Fragile band, typically between 26 and 34, because timeouts, retry budgets, resource limits and observability are rarely complete. Accepting the recommendations from that first scan usually brings the same repository to 65 to 74 before anything new is merged. From there the score moves with every change and every production signal.

Continuous PRI scoring

The score is never a one-time report

A reliability score is only useful if it is current. Tomosu re-scores at every point where reality changes, so the number on the dashboard is the number for the code that is running now.

On saveIn the editorThe file you are editing is scored as you write. Findings appear inline; accepting one updates the file score immediately.
On pull requestBefore reviewThe whole change is scored against the current repository score. The PR shows the projected PRI if merged.
On mergeRepository scoreThe accepted change becomes the new baseline. Trendlines on the dashboard move with it.
On deploy and in runtimeProduction dimensionsDeploy events, metrics, logs, traces and tickets update Runtime Signals, Drift, Deployment Velocity and the Escalation Index as they arrive.
On resolutionLearning loopA resolved incident records whether a fix held. Recurrences lower the score; a guardrail that prevents recurrence raises it.

Every recalculation keeps its inputs, so any score on the dashboard can be traced back to the findings, signals and changes that produced it.

Building the Production Context Graph

How code gets connected to runtime evidence

A finding is only actionable when you know what it touches. The Production Context Graph is the model the agents build and maintain so that a line of code, the service it runs in, the dependency it calls and the incident it caused are one connected picture.

  • Nodes
    What is in the graphServices and their files, dependencies and versions, infrastructure resources from your IaC, deploys, runtime signals, incidents and tickets, pull requests, and for agentic systems the agents and the tools they call.
  • Edges
    How they relateCalls, depends on, deployed by, runs on, observed in, changed by, caused and resolved by. Edges carry the evidence that created them, for example the deploy that preceded a latency change.
  • Sources
    Where it comes fromThe repository scan builds the code, dependency and infrastructure part. CI and deploy events, observability platforms such as Datadog, New Relic and Sentry, and ticketing tools such as Jira, PagerDuty and ServiceNow add the runtime part. Connections are read-only.
  • Upkeep
    How it stays currentEvery merge, deploy and incident updates the graph. Nothing is modelled once and left to drift; the graph is rebuilt from evidence as the evidence changes.
Agent Reliability

Reliability for the agents your software runs

More systems now contain AI agents of their own: tool-calling loops, retrieval pipelines, multi-agent workflows. They fail in ways classic services do not. When a scan detects an agentic codebase, Tomosu adds an Agent Reliability sub-index to the PRI and the agents review these failure classes alongside the rest.

For codebases without agents the sub-index simply has no data and is left out of the roll-up.

  • 01
    Tool contracts and selectionAre tool calls validated, are results checked, and does the agent pick the right tool for the task? Errors in tool protocols and tool results are the most common agent failures in production.
  • 02
    Planning and terminationDoes every loop have a step budget and a stop condition? An agent that cannot finish is an outage with a bill attached.
  • 03
    Context managementHow prompts, memory and retrieved context are assembled and bounded, so the agent reasons over what it should and nothing it should not.
  • 04
    Cost and execution budgetsPer-task limits on tokens, time and tool calls, and what happens when they are hit.
  • 05
    Instruction integrity and prompt injectionWhether untrusted content can redirect the agent, and whether that exposure is contained.
  • 06
    Remote tool trust and coordinationTrust boundaries for MCP and remote tools, and hand-offs between agents in multi-agent systems, including who may approve what.
  • 07
    Tracing and repairWhether agent runs are traceable end to end and whether failures can be repaired automatically with an evidence trail, the same standard the rest of the PRI applies to services.
Stage 3 · Production

Detect, resolve and escalate with evidence

In production the agents watch the signals your observability stack already collects, match them to the graph and to known reliability patterns, and act according to a tiered policy you control.

L1 · RoutineResolved automatically

Known patterns with a known safe remedy, for example a saturated connection pool after a deploy. The agent applies the remedy through a canary, verifies the signal recovers and records what it did.

L2 · Judgement with evidenceResolved, then reported

The pattern is recognized but the remedy touches code or configuration. The agent prepares the change, applies it within policy, and leaves the evidence trail for review. The senior engineer is informed, not paged.

L3 · NovelEscalated to a person

No matching pattern or a remedy outside policy. The agent escalates with the causing change, the affected path in the graph and the signals attached, so the engineer starts from the answer rather than the alert.

Every resolution and escalation updates the Escalation Index and feeds the learning loop below.

Stage 4 · Learn

Every escalation becomes a guardrail

Generic rule sets check for failures someone else had. Tomosu gets stricter where you actually fail.

From incident to rule

When an incident is resolved, the agent records the pattern that caused it and the fix that held. That pattern becomes a check in the editor and on every pull request across the repositories that share the pattern, with the original incident linked as the reason.

Measured by recurrence

A guardrail is only worth keeping if the failure stops recurring. Recurrence is tracked per rule, and the PRI reflects it: repositories protected by rules that hold trend up; a rule that does not prevent recurrence is surfaced for review.

Why the loop matters

Over weeks the first-scan picture changes. Fixes accepted pre-merge stop the common failures, production resolutions handle the rest, and the learned guardrails mean the same class of problem is not paid for twice.

What stays in your control

Agents act within the policy you set

Read-only by default

Repository and observability connections start read-only. Writing a fix, holding a merge or applying a runtime remedy is enabled per repository and per tier, by you.

Humans approve what matters

Fixes are proposals until accepted. Merge gates are your policy. Escalations go to a person with the evidence attached. Nothing bypasses review that you have not explicitly automated.

Every decision is logged

Findings, scores, fixes, resolutions and escalations keep their inputs, so any verdict can be audited later. Your code is never used to train models.

See it on your own code

Start with a first scan.

Read-only, no credit card, a PRI score and the ranked gaps in under five minutes. Add the editor, the pull request check and the runtime connection when you want the whole loop.