João RamiresInstruction manual

Cartridges · At work

SRE agent

Picks up production bugs as monitoring reports them, finds the cause, and opens a tested fix for an engineer to review, at a capped daily cost.

Where
Blue Onion
Status
Shipped
Year
2026
My part
Designed and built it

The problem

A production error waits for an engineer to notice it and trace it to a line of code. Most of that work is reading: the stack trace, the recent changes, the code and the data around the failure. An agent can do that reading, and draft the fix, before a person sits down.

What it does

Sentry reports an error, and a ticket opens in Linear. The agent starts on its own when a new ticket carries a Sentry link, when someone assigns it a ticket, or when a comment mentions it. It finds the cause, writes a test that reproduces the bug, writes the fix, and ends every ticket in one of two ways: a pull request with its reasoning, linked to the code it read, or a comment that explains what it found.

It fixes more than crashes. It can fix a slow query with an index or a rewrite, and a front-end bug with screenshots and a video as proof. Engineers review fixes instead of hunting for causes.1The agent proposes; it never merges. Review stays where accountability is.

SRE agent · the shape of one run● done
  1. askNew error from Sentry, ticket opened in Linear
  2. thinkRead the stack trace, the recent changes and the failing code
  3. └ toolQuery the database, read-only
  4. └ toolWrite a spec that reproduces the bug, then the fix
  5. checkA second AI pass reviews the fix
  6. checkGate: the new spec fails on master and passes on the branch
  7. answerOpened a pull request for an engineer to review
2 tool calls

A fix has to prove itself

Before a pull request opens, the fix passes three checks:

  • A second AI pass reviews it, and the agent answers each finding.
  • A gate runs the linter, the changed specs, a security scan and the front-end checks.
  • The spec that reproduces the bug must fail on master and pass on the branch. A fix that can’t show the bug can’t show that it fixed it.

Isolated, at a capped cost

Each run gets its own Cloud Run job, where Claude Code works without a person at the keyboard, through Vertex AI. A webhook accepts only signed, fresh requests and allows one run per ticket. The agent reads Sentry, Linear and the database with read-only access.

The model can’t push code. It runs as its own user, without the credentials that deliver a branch. A separate step delivers the branch, opens the pull request, and checks a second time that the agent kept out of the paths it may not touch.

A daily budget caps the spend, with a cap for each run and alerts on cost. The job image is built from master and pinned by digest, and deploys use keyless identity federation, so no long-lived key exists to leak. All of it is Terraform.

Merges by the agent

Every fix waits for an engineer's review.

Long-lived keys

Keyless identity federation; the image is pinned by digest.