Skip to content

How we work · 6 min read

How we use AI agents to fix production bugs.

Agents sort the tickets and propose the fix, and a senior engineer still decides what reaches production.

By Pedro CiordiaPublished

A housekeeper in a dim service corridor taps through a grid on a tablet, next to shelves of folded towels and a linen cart, as a colleague walks away

In short

Polargate runs client maintenance with AI agents inside a human-controlled pipeline. A ticket lands in a multi-tenant ServiceDesk, an agent triages it for about 0.05 USD, a second agent proposes a fix as a diff inside a GitHub Actions run, and a senior engineer reviews it, merges it and deploys it. The first end-to-end fix cost 0.31 USD in model spend. No agent replies to a client or deploys.

Most agencies in our market sell AI as a deliverable: a chatbot, an assistant, an automation. Very few say whether AI touches their own delivery. At Polargate it does, in a specific and fairly boring way. This page describes the system we run and its numbers, including the parts that do not work.

What happens when a ticket arrives

Polargate runs client maintenance through a multi-tenant ServiceDesk, in production since 17 July 2026. A client sends an email or opens a ticket in their portal. From there:

  • The email arrives through our support domain, with DKIM and DMARC checks and signed reply tokens, so a reply from the client's mailbox attaches to the right ticket and to nothing else.
  • A triage agent classifies it: what kind of change it is, which repository it touches, how risky it looks, how many hours it should consume. This step runs on a large model and costs about 0.05 USD per ticket.
  • If the ticket is a candidate for automation, a fix job is dispatched as a GitHub Actions run inside that client's repository. The worker is one canonical workflow kept in our own repo, and each client repo carries a fifteen-line stub that calls it. The agent works through the Claude Code CLI with a hard cap of 80 turns.
  • The job posts a diff back through a callback, and stops. It waits.
  • A senior engineer reviews that diff in Mission Control, our internal console: approve, ask for a replan, adjust the hour or risk estimate, draft a reply to the client, or cancel the whole thing.
  • The change is merged and deployed by a human, behind the usual gates: typecheck, tests, build, and a look at the real page on desktop and on a 375 pixel phone.

Hours consumed post against the client's contract, which has two pools, maintenance and urgent, with any surplus rolling into proactive improvements instead of evaporating. The client sees their plan, their consumption and their invoices in the portal. They never see our internal knowledge base: that access rule is enforced in the database, not in a policy document.

One ticket, two executors

Every ticket can be closed in two ways: the automated lane, which spends API credit, or manually by a senior engineer working in Claude Code, which spends none because it runs inside an existing subscription. Same queue, same ticket, two executors. In practice, small bounded changes go through the automated lane, and anything that needs judgement about the client's business goes manual.

Parallel audits, and a sceptic for every finding

Build work uses a different loop. Once a change is written, we fan out audit agents by dimension: correctness, architecture and reuse, interface and platform guidelines, accessibility, responsive behaviour, performance, and security including row-level policies. Then every raw finding is handed to a separate agent whose only job is to refute it.

That refutation pass is not decoration. Numbers from our own runs:

  • An Android push crash investigation: 14 agents, 20 raw findings, 8 verified, and none survived contact with the code. The real cause was elsewhere.
  • A golf club site, two rounds before merge: 37 raw findings and 4 confirmed, then 26 raw and 3 confirmed.
  • A hotel website in August 2026: 55 agents across 6 areas, 48 findings, 48 confirmed, 0 refuted, all fixed.
  • An internal operations platform: a 74-agent audit produced 59 confirmed findings, fixed through an 11-agent fan-out.
  • An offline-first mobile app needed 11 audit rounds, with findings going 42, 28, 9, 15, 11, 4.

Two lessons come out of that table. Raw agent output has a high false positive rate, so the refutation step is what makes it usable at all. And the confirmation rate swings wildly, from 48 out of 48 on one codebase to 4 out of 37 on another. A run that confirms nearly everything usually means nobody had audited that code before.

The stop rule is two consecutive clean passes with zero blockers. "Verified" means build, typecheck and tests green plus the interface opened in a browser, because green gates lie: a tsconfig whose root matched no files gave one project a passing typecheck for months, and two deploys shipped green past a lint step that never returned a failing exit code.

The knowledge base underneath

Agents are only as good as their context. Polargate keeps a per-entity knowledge base in Postgres: text chunks with embeddings and an HNSW index, scoped by entity and project, with a shared global library folded into every search and a wall between client, internal and personal knowledge. Our own tools reach it through an MCP server exposing more than 100 tools: knowledge read and write, tickets, hour balances, invoices, contacts, releases, the fix queue.

In practice this means the triage agent already knows the client's stack, the decisions taken, and what broke last time. It also means the usual failure mode is knowledge, not model: when a proposed fix comes back wrong, it is almost always because a fact was missing from the knowledge base.

What a fix costs

  • Triage: about 0.05 USD per ticket.
  • The first real end-to-end fix shipped through this pipeline, on a client portal in July 2026, cost 0.31 USD in model spend.
  • Worker infrastructure: nothing. GitHub Actions minutes in repositories we already pay for. We considered a dedicated worker host and rejected it as oversized for one or two tasks a week.
  • A daily spend cap sits in the database. When it is reached, the lane stops.

So model spend per fix is a matter of cents. That is the headline, and also the least interesting number, because the cost that matters is senior review time, and it does not go to zero. Somebody who understands what breaks the client's business still has to read the diff. What the agent removes is the drafting: reading the codebase, reproducing the issue, writing a first version, drafting the reply. That is what makes senior quality viable on a monthly retainer, where the same work without agents would cost more or go to juniors.

What the agents are not allowed to do

These limits are welded into the database, not written into a prompt:

  • Never reply to a client on their own. Every client-facing message is reviewed and sent by a person.
  • Never deploy. No agent holds production credentials.
  • Never exceed the daily spend cap.
  • Never run destructive migrations or touch authentication, roles or secrets.

The general boundary: reversible decisions belong to the agent, irreversible ones stop and ask. A human reviews and merges every change. That rule is what allows the system to be pointed at a client's production repository at all.

If you are thinking of building this

  • Start with the desk, not the agent. Automation with no ticket system and no hour accounting has nothing to attach to.
  • Build the refuter before you trust the auditor.
  • Put the caps in data, not in prompts. A prompt is a suggestion, a database constraint is not.
  • Measure your false greens. A verification gate that cannot fail is worse than no gate.
  • Budget the human review properly. It is now the expensive part, and it is the part clients are actually paying for.

Polargate works this way on Care retainers, and new engagements start with a fixed-price Discovery Sprint.

Your case

Tell us about your project.

On a short call we tell you how this applies to your project, and you get a written quote afterwards.

For example: 251 KB hero image weight, down from 1.3 MB. Estepona Golf

FAQ

Questions about this article.

Does a human review every change your AI agents make to my site?
Yes, every one. At Polargate an agent stops after producing a diff and waits: a senior engineer reads it, approves or rejects it, and merges and deploys it by hand behind typecheck, tests, build and a look at the live page. No agent holds production credentials and none can reply to a client on its own. Those limits live in the database, not in a prompt.
How much does it cost to fix a bug with an AI agent?
In model spend, cents. Triage costs Polargate about 0.05 USD per ticket, and the first complete fix shipped through the pipeline, on a client portal in July 2026, cost 0.31 USD. The worker runs on GitHub Actions minutes already paid for. The real cost is the senior review that follows, which does not disappear and is what clients are paying for.
Can an AI agent deploy code to my production site by itself?
Not at Polargate. The fix agent finishes by posting a diff back for review and then stops. Merging and deploying are manual steps, run by a person after typecheck, tests and build pass and after the page has been opened on desktop and on a phone. A daily spend cap also sits in the database and halts the automated lane when it is reached.
Are AI agents reliable enough to review code?
On their own, no. In Polargate's own audit runs, raw agent findings show a high false positive rate: one crash investigation produced 20 raw findings, 8 verified, and none survived contact with the code. That is why every finding goes to a second agent whose only job is to refute it, and why only confirmed findings are ever fixed.
What does agentic delivery change about a maintenance retainer?
It changes what the money buys. Because drafting a fix costs cents, more of a Polargate Care retainer goes into senior review, proactive improvements and the surplus hours pool instead of routine labour. It does not remove the human from the loop, and it does not make the work instant.

For example: 62 user accounts migrated with their IDs preserved. Concert Music Festival

Keep reading

More from the studio.

If a piece raises a question about your own project, we answer it on a short call.

  • Two people at a desk go over printed sheets of figures, she points at a line while he works a calculator on his phone, beside a laptop with tables and charts

    Costs

    What decides the price of a website in Spain

    What decides the price of a website in Spain in 2026: the four market tiers, what sits inside each one, what makes a quote climb, and the eight questions to ask before you sign.

For example: 98 KB mobile hero image, down from about 288 KB. Hotel Marien

Get started

Tell us what you want to build.

Websites, apps, custom systems and AI for companies that need them in production in weeks. Fill in the form or book a 30 minute call: a senior engineer answers within 48 business hours with a first take on scope, timeline and price.

What do you need?
Budget
When

At least ten characters.

Answer in writing within 48 business hours. No newsletter, no automatic sequence.

Rather answer the full brief?

First step

Discovery Sprint

Two weeks to close scope, architecture and price before anything is built.

No price list. You get a private quote, in writing, after a short call.

Then, to build, always at a fixed price

Not ready yet?

AI-native digital studio for mid-market companies

POLARGATE, S.L. · CIF B24895005
Calle Electrónica 6, 28027 Madrid, Spain