Agentic Coding Has No Floor

An agent can remove a check you still need while the tests keep passing. I want to be able to lock that code until I approve a change.

You ask an agent to clean up a function. It removes a check you still need. The tests pass because none of them covered that check.

With agentic coding, you’re supposed to review the changes. With vibe coding, you mostly trust them. In practice, reviewing every diff is easy to promise and hard to keep doing. That’s how one turns into the other (the disciplined version comes with its own skill atrophy issue either way).

The issue is structural, since coding agents have no equivalent of the source/generated-output boundary that a compiler gives us, and so prompt, code, tests, and previous agent output are all editable and all treated as input. The fix has to come from the harness vendors, in the form of a protected region the agent can read but can’t rewrite without an explicit human unlock, because another instruction file isn’t going to cut it. Until they ship the real thing, the workarounds are all a bit unsatisfying.

Screenshot of Jason Lemkin's tweet describing day 9 of vibe-coding on Replit, when the agent deleted his production database during a code freeze. Screenshot of Jason Lemkin's tweet describing day 9 of vibe-coding on Replit, when the agent deleted his production database during a code freeze.
Public case of vibe coding fail. Lemkin was experimenting on a personal project, but real production systems have been wiped the same way. Replit is apparently "the safest place for vibe coding" according to their marketing.

It’s tempting to read this as a problem that only kicks in once you have a real team or a serious codebase, but even the vendors selling these agents are starting to see its limits. From a recent interview:

if you close your eyes, and you don’t look at the code, and you have AIs build things with shaky foundations as you add another floor, and another floor, and another floor, things start to kind of crumble.

Michael Truell, Cursor CEO

I don’t want to cast blame on the users here (“professional” SWEs doing vibe coding is another story). The dream is real: a tool that lets you build production software without the years of engineering muscle memory it usually takes. The marketing says it’s safe and the product produces plausible work. The loop stays quiet until something breaks, and the dev forums are full of stories where it did: leaked secrets, runaway agents, silent regressions.

Even if you don’t use agents, or you always read the diffs carefully, you still have to deal with the consequences. It usually arrives as a vibe-coded PR or demo from a non-technical colleague that engineering then has to finish properly. It’s hard to be the engineer who always says no, especially when these colleagues are excited to contribute and think they made something good. The question is do we want to fix it, control it, or ban it?

Why this fails

With a compiler, you edit the source code and it produces the output. With an agent, both the instructions and the code can change. An old check may still be needed, but nothing tells the agent why it’s there.

Compiler pipeline Source code Compiler Assembly one-way, source is the only input Vibe coding loop Prompt AI agent Source code both layers editable, both read
Compilers gave us assembly we never had to look at. The agent loop asks us to look at both.

To make this concrete, let’s say that in week 1 you ask the agent to add a payment flow where it does the right thing, eg, a GDPR consent check before charge and amount bounded against user daily cap:

if not user.has_consent("payments"):
    raise PaymentDenied("missing consent")

if amount <= 0 or amount > user.daily_cap:
    raise PaymentDenied("amount out of bounds")

You revisit the same function weeks later and tell the agent to send a quick cleanup pass and it looks this way:

if amount <= 0:
    raise PaymentDenied("amount out of bounds")

if amount > user.daily_cap and not user.is_premium:
    raise PaymentDenied("amount out of bounds")

The consent check is gone, and premium users now bypass the daily cap. Neither change was requested. This is what I mean by logic drift: a later edit changes an earlier rule.

This actually happened on the Linux kernel recently. A maintainer submitted a patch generated by a AI that removed a __read_mostly annotation. This annotation is a hint to the compiler about cacheline placement, and removing it causes contention on every multi-core system that the kernel ships to. On review, the line seemed like a simple cleanup, so the patch was accepted, and Torvalds later said that he would have viewed it differently if he had known it was written by AI. The source didn’t say anything about this attribute being load-bearing, nor did the patch.

The shape of a fix

I want to mark a block of code as protected. The agent could read it and propose changes, but applying those changes would require me to unlock it. The harness would enforce the lock, since it controls the agent’s access to files.

Protected regions like this are a really old idea. Code generators have used BEGIN USER CODE / END USER CODE markers for decades because rerunning the generator overwrites whatever you had hand-edited inside the generated file. Agentic coding has the same overwrite problem, except there’s no generator and no rerun, just an agent editing ordinary source files in the background. There’s no codegen template to put the markers in, so the lock has to live one layer up, in the harness itself.

I’d use this for checks like the ones in the payment example. A comment could mark the protected code and explain why it must stay:

def charge_card(user, amount, idempotency_key):    # lock: gdpr art 6 - refuse charge if no payment consent    if not user.has_consent("payments"):        raise PaymentDenied("missing consent")    # lock: fraud SLA - reject amounts <=0 or above user.daily_cap    if amount <= 0 or amount > user.daily_cap:        raise PaymentDenied("amount out of bounds")    invoice = build_invoice(user, amount, idempotency_key)    metrics.timing("invoice.build", invoice.elapsed_ms)    receipt = stripe.charge(invoice.token, amount)    # lock: pci audit trail, compliance keeps asking, dont remove    log.info("charged", user=user.id, amount=amount)    return receipt

The # lock: comment would protect itself and the statement immediately below it, including the body of an if. Before applying a patch, the harness would reject changes to either. I haven’t worked out the unlock UI.

What’s been tried

The first answer everyone reaches for is discipline (agentic coding is a trap): use the agent less, keep diffs small, review everything. This all works well right up until the tool itself drains any remaining self-discipline you might have. You pull the lever and a perfectly functional piece of code drops out of the app. Also, even if you may have strong discipline, you cannot enforce that on others (if you could my mom would have ensured I actually did my homework).

Traditional engineering processes work well for humans, but don’t scale to the scope of agents. Requirements live outside the code and are not generally read by agents. Tests, types, and linters all give the agent rails to follow, but none of them says: don’t change this line, ever. Code review can catch some of the drift, but it’s a scale problem. Reviewing takes far longer than it takes an agent to spit out a new feature. Secondary studies on AI in software engineering are mapping out the same gap from the academic side.

The harness vendors themselves have caught up some too, but most of what they’ve shipped is still not hard constraints. Persistent memory survives sessions, skills bundle known procedures, code search has gone from grep to semantic indexing, and AGENTS.md files politely beg the agent not to touch certain functions. Cursor has project rules, Claude Code has hooks that can intercept tool calls, GitHub Copilot has custom instructions, and OpenCode has modes that can’t write to production files at all. I actually use a lot of it.

'Always has been' astronaut meme about AGENTS.md being advisory.
AGENTS.md, on closer inspection.

I think spec-driven development is another quite interesting development, the most common approach I’ve seen goes like this. You write a short description into a ticket. Then you let the agent flesh it out, verify it by hand against your actual constraints, then circulate it to the team. Once the spec is right, the implementation can lean on unchecked agent edits without the usual cost, since the constraints are pinned in the document instead of left floating around in your head. Agile already taught us the problem with this approach though, requirements written before code are usually wrong. The agent will then fill in whatever the spec missed with its own guesses, and you’ve locked yourself to a flawed plan.

Until then, micro repos

My prior on repo structure was Conway’s Law: systems end up shaped like the teams that build them anyway, so you might as well draw the repo boundaries to match the org from the start. Platform team gets a repo, payments team gets a repo, small company runs one monorepo. Going finer than that has always felt to me like friction without a real payoff. There is some empirical evidence for this too, in the mirroring hypothesis and in ownership studies on Vista and Windows 7. Split a repo and split the team with it.

Agentic coding has shifted my thinking on this somewhat, and I think it merits another look. Another repo acts as a strong barrier and the most harnesses will warn clearly when the agent wants to talk past it. This is obviously much coarser than a real locked region would be, there’s no way to lock just a region in one file or even just one file.Still, it works, which is more than AGENTS.md or anything else above can really claim. It’s not at the point where I’ve structured any repos with this in mind, but it’s worth thinking about. Micro repos also require architectural taste. If you draw the boundary in the wrong place you end up with a mess. So you need someone on the team who can spot the actual seams and keep doing it as the system grows.

I haven’t split repos for this reason yet. A repo boundary might help, but it is a crude way to protect a few important functions. I’d rather be able to lock those functions directly.