Alle berichten

Why Agnes doesn't fix your code for you

Huub, founder of Agnes ·

Agnes reads a frontend repository every day, finds what makes it harder to maintain or less safe, and turns that into a score from 0 to 100. For every rule it also knows how many points its findings cost. So the question comes up quickly: if Agnes knows what's wrong, and AI agents can write the fix, why doesn't Agnes just open a pull request every night and push the score up by itself?

We decided not to build that. Not because we're sceptical of AI in a developer's workflow: Agnes is built for agents, and I use them every day. We think the work an agent does should pass through a person before it lands, and a tool that fixes code unattended skips exactly that step.

We're building for agents, not against them

Agnes has an MCP server, so Claude Code, Cursor, VS Code and other agents can read a project's report, its findings and its dependencies. It ships an agent skill, agnes-improve-score, that walks an agent through raising a score: find the project, read the report, rank the fixes by the points they'd add, look at the findings in the code, and fix them.

For many teams this is already how the work happens. Someone opens their editor, asks the agent what to fix first, and gets a plan that took seconds instead of an afternoon of reading lint output. That's a real improvement, and we want more of it.

What we don't want is for that same work to happen while nobody is looking.

What an automatic fix would need

To fix your code itself, Agnes would need write access to every repository it analyses. Today it doesn't have it. On GitHub, Agnes asks for two permissions: read-only access to the repository's contents and its metadata. On Bitbucket it asks for read access to repositories, never write or admin. On GitLab it asks for read-only API access, which lets it read your projects and their code but change nothing. On Azure DevOps it asks for read access to code, nothing more. The analysis runs in a sandbox without network access, and the code is deleted after every run.

That's a deliberate limit. A service that holds write access to hundreds of codebases is an attractive target, and a mistake in it doesn't stay in one repository. Read-only access means the worst Agnes can do is report something wrong. We'd like to keep it that way.

A score is easy to raise for the wrong reasons

The quickest way to raise almost any code quality score is to stop measuring: switch a rule off, add an ignore comment, delete the test that fails. An automated fixer that is judged by the number will drift towards those moves, because they always work.

That's why the agent skill says, in so many words: fix the cause, and never switch off a rule, add an ignore comment or delete a check to make a finding disappear. A person reviewing the change will spot those moves at once. A pipeline that merges on a green score won't.

There is also context the analysis doesn't have. Some findings come with medium or low confidence and turn out to be false positives. A storage bucket can be open to the internet on purpose, because it serves a static site. A file can be vendored and never meant to be edited. The team knows these things, and Agnes lets them say so: an eslint-disable comment that names the rule, for instance, marks a bucket that is open on purpose. Deciding when that's the right answer is a judgement, and it belongs to someone who knows why the code is there.

Review is where a team learns

A fix nobody reads teaches nobody. If an agent quietly removes the same kind of unsafe innerHTML every week, the score stays high and the team keeps writing new ones. When the fix comes through a pull request somebody reviews, the pattern gets noticed, discussed and, with luck, not written again.

Review also keeps ownership where it belongs. The people who maintain a codebase should be able to say why every line in it is there, including the lines an agent wrote. “Agnes changed it overnight” isn't an answer anyone wants to give during an incident.

Where the human sits

So the workflow we support has a stop built in. When an agent uses Agnes to raise a score:

  1. It reads the report through tools that can only read. The MCP server's tools are marked read-only, and an agent signing in with OAuth gets one scope: reading reports.
  2. It ranks the fixes by the points each would add, and opens the files to confirm the findings in the code.
  3. It writes a plan, ordered by gain per effort, with the rule, the files and how it will fix each one. Then it stops and waits for approval.
  4. After approval, it makes the changes in small steps and runs the project's own linter, type checker and tests after each one.
  5. The commit says the work came from Agnes findings and ends with an Agnes-Rules: trailer listing the rules, so a reviewer knows what they're looking at and why.
  6. The change goes through your normal pull request, review and CI. Once it's merged, Agnes analyses the branch again, and the score shows whether it worked.

The agent does the reading, the ranking and most of the typing. A person decides what gets done and what gets merged.

We hold ourselves to the same rule

Agnes's own dependencies are kept up to date by an AI agent. Every night it checks for updates and opens pull requests: small updates grouped together, each major version in a pull request of its own, security fixes separately and marked urgent. CI runs on every one of them.

None of them merges itself. A person reads each pull request and merges it or closes it, and closing one without merging means “not this version”. A deploy doesn't happen on merge either: someone presses the Deploy button, and the database is backed up before anything changes. It's a little slower than letting the agent ship, and it has already caught updates we didn't want yet.

Not never, but never unreviewed

AI agents are becoming the default way a lot of code gets written, and that's fine. Agnes is meant to make them better at it, by telling them what matters most in your repository. But faster writing makes review more important, not less. The more code an agent produces, the more it matters that someone with context reads it before it ships.

If Agnes ever opens pull requests itself, they'll be drafts that wait for a person, with the plan in the description, never a commit straight to your branch.

If you want to try the reviewed version: connect a repository, add the Agnes MCP server to your agent, and ask it what to fix first. It'll come back with a plan, and wait for you.