Hertect
← Back to HerTake

AI Systems · 10 Min Read · September 2026

The Agent Followed Instructions. Which Ones?

We are getting much better at engineering context for coding agents. The harder question is whether we can reconstruct the instruction state that shaped a specific piece of work.

There is a question I keep coming back to that sounds like it should be easy to answer:

What was the agent told when it changed this code?

Not what the developer typed into the prompt. Not which model ran. Not what instructions happen to be sitting in the repository today. I mean the persistent engineering guidance that applied to that agent, doing that work, against those files, at that point in time. That question gets weird faster than it should.

Coding agents no longer operate from a prompt and a prayer. We give them repository instructions, scoped guidance, skills, team conventions, custom agents and increasingly deliberate project context. VS Code now explicitly uses the term context engineering for the practice of curating the information an agent needs to work effectively. GitHub Copilot, Codex, Cursor and Gemini CLI all support persistent forms of repository or project guidance, although the mechanics, scope and precedence differ by product. That is progress. Agents need more than a clever prompt if we expect them to work inside real engineering systems.

It also creates a less obvious problem. We are getting very good at deciding what context an agent should have. We are getting better at observing what an agent did. The part in between is still surprisingly awkward: What instruction state actually applied to the work?

I recognize the shape of that problem because I have spent a lot of my career around infrastructure, where staring at the source configuration is often only the beginning of the answer. Anyone who has debugged IAM permissions at an unreasonable hour knows this. The policy you are staring at can be perfectly clear. The effective permissions are still somewhere behind group membership, inheritance, resource policy and the exception someone added months ago and forgot existed.

Networking has its version. Infrastructure as code has its version. Policy engines have their version. Eventually you learn to stop asking only, What does this configuration say? and start asking the question that matters operationally: After everything has been resolved, what is actually true?

Coding agents now have a version of that question. And I do not mean philosophically. I mean operationally.

The File Isn't the State

A repository can contain perfectly valid instructions without those instructions being the complete answer to what governed a particular change.

GitHub Copilot, for example, supports repository-wide instructions, path-specific instructions and agent instructions. Repository-wide and matching path-specific instructions can both apply, while the nearest applicable AGENTS.md takes precedence for agent instructions in supported environments. Codex can assemble instruction context from global files and files encountered from the repository root down toward the working directory. Cursor has team, project and user rules plus AGENTS.md, with project rules that can be scoped by path, invoked manually or included based on relevance. Gemini CLI loads context hierarchically and can display the concatenated instructional context currently in use.

The implementations are different. That matters. But the architectural consequence is similar: the instructions that exist and the instructions that apply are not necessarily the same thing.

Suppose an agent is changing something under /services/identity. The repository has broad guidance at the root. More specific guidance exists inside the identity service. A path-scoped instruction applies to TypeScript. A skill describes how schema migrations should be handled. Then the developer asks for a change. Which guidance mattered?

Listing the instruction files does not answer that. Knowing which model ran does not answer it. The user prompt does not answer it. At that point, this is not really a discovery problem anymore. It is a resolution problem.

I have been using effective instruction state as shorthand for the resolved view: the persistent, machine-consumable engineering guidance applicable to a specific piece of work under the rules of the tool executing it.

That is not an established industry term. I am not trying to create one for sport. I need the distinction because these are different questions:

What instructions exist? What instructions governed this work?

Knowing the first is inventory. Knowing the second is state. And that difference starts to matter the moment something goes wrong.

"Why Did the Agent Do That?" Has More Than One Answer

Imagine reviewing an agent-authored pull request and finding an implementation choice you did not expect. Why did it do that? You can inspect the diff. You can look at the developer's request. Depending on the tool, you may also be able to see commands it ran, files it read, tools it called and other parts of the execution trace. All useful.

But none of those things, by themselves, tell you whether persistent engineering guidance told the agent to use that pattern. There is a meaningful difference between the agent chose this approach and the applicable engineering instructions told the agent to use this approach.

That does not mean the instruction deterministically caused the output. It did not. These systems are not deterministic state machines, and GitHub explicitly notes that custom instructions may not be followed identically every time. But provenance still matters.

If we want to understand an agent-authored change, the prompt is only one source of intent. There may also be repository instructions, scoped instructions, skills, custom-agent configuration, referenced documentation, code discovered during the task and tool output gathered along the way. The prompt is part of the story. It is not the whole story.

That makes me much more interested in a different question: Can we reconstruct the persistent engineering guidance that was in force when the work happened?

Notice the tense. Not what applies now. What applied then. Because the instruction layer changes too. Someone edits an AGENTS.md. A path-specific rule moves. A shared skill changes. A referenced command disappears. Review the same pull request six weeks later and the repository may no longer represent the same instruction state the agent operated under.

Now "why did the agent do that?" is not only an execution question. It is a provenance question. And once context has provenance, it has lineage. That is where this stops being a prompt-management problem and starts looking like an operating problem.

A Dependency Doesn't Have to Live in Package.Json

Engineering teams are already very good at thinking about dependencies when a machine can resolve them for us. A package depends on another package. A service calls another service. A Terraform module references another module. A workflow invokes another workflow. Persistent agent instructions create another kind of dependency, except some of those relationships are written in ordinary language. Consider:

Run ./scripts/release.sh before deploying.
That instruction depends on a script.
Or:
Do not modify anything under /generated.
That instruction depends on a path and on the meaning of that path remaining consistent.
Or:
Changes to the payments service must run the integration suite.
Now the instruction connects a service boundary, a type of change and a test workflow.

None of those relationships are particularly exotic. The interesting part is who consumes them. This is not a README sitting in the repository hoping a human remembers to read it. It is machine-consumable guidance deliberately supplied to a software agent that can inspect files, execute commands and change code.

That gives an old problem a different consequence. Rename release.sh to release.ts and Git knows exactly what changed. Your application can still build. Your tests can still pass. Production can be perfectly healthy. Meanwhile, an instruction can continue confidently sending the agent to the old address.

The boring conclusion is that documentation gets stale. Yes. We know. The more interesting problem is that operational context consumed by an agent can become detached from the engineering system it describes.

Inside Ctrl Alt Delegate, I use instruction drift for a narrow version of that condition: an instruction remains in place while a verifiable part of the engineering reality it describes or references has changed.

The word verifiable matters. I do not particularly care whether an instruction is six months old. Age is a terrible proxy for correctness. A six-month-old instruction can be exactly right. A six-minute-old instruction can already be wrong.

And even when the mismatch is real, finding it does not tell you which side is wrong. If an instruction says a directory should exist and somebody deleted the directory, maybe the instruction is stale. Maybe deleting the directory was the mistake.

Detection establishes a mismatch. It does not establish intent. That distinction matters a lot once people start talking about automatic remediation.

The Dependency Runs Both Ways

Once I stopped thinking about these instructions as files and started thinking about the relationships around them, the problem got more interesting.

Most integrity checks naturally start from the engineering system: The code changed. Which instructions might now be questionable? A script moved. A command changed. A directory disappeared. A workflow was replaced. Which machine-consumable guidance still assumes the old reality? Useful question.

Now flip it: The instruction changed. Where did the guidance just change? Which repositories consume it? Which paths does it apply to? Which agent environments recognize it? Which skills or other instructions depend on it? Which teams own those surfaces?

Changing an instruction does not mean every downstream agent will suddenly produce different code. That would be an absurdly deterministic way to describe these systems. But the guidance governing those scopes changed.

Platform engineering already has a useful concept for that kind of relationship: Blast radius. A local change can have non-local consequences.

The moment that happens, I want more than the file. I want the relationships.

  • Instruction to code.
  • Code to instruction.
  • Instruction to scope.
  • Instruction to owner.
  • Instruction to workflow.
  • Instruction to other instructions.
  • Change to everything that deserves another look.

This is the part my infrastructure brain refuses to leave alone. Platform work teaches the same lesson over and over: the artifact itself is usually the easy part. The operational complexity grows around it. Who owns this? Where is it consumed? What does it depend on? What depends on it? Which state is effective here? What changed? What does this change affect? Can I reconstruct what was true when something happened?

Those questions show up in identity, networking, CI/CD, cloud platforms, policy systems and developer platforms because eventually the relationships exceed what one person can keep in their head. AI instruction files do not need to become "the next Kubernetes" for that lesson to apply. The threshold is much less dramatic: When local configuration starts producing non-local consequences, the relationships become part of the system you have to operate.

Context Needs an Operating Model

This is where Ctrl Alt Delegate became more interesting to me than the problem that originally led me to build it. Finding a dead reference in an instruction is useful. It is also the easy part. The harder problem is understanding the operating relationship around that instruction: where it applies, what it references, what other guidance interacts with it, who owns it, what version somebody reviewed, what changed afterward and where else the same guidance matters.

I keep reducing that into four verbs: Discover. Resolve. Verify. Impact. Discover the instruction layer. Resolve what applies where. Verify the parts that can actually be checked against engineering reality. Understand the impact when either side changes.

Then stop. I do not want a system quietly rewriting an instruction because it found a discrepancy. Finding the difference and understanding organizational intent are different jobs.

If an instruction references a path that no longer exists, a machine can establish that mismatch cleanly. It cannot establish, from that fact alone, whether the instruction should change or whether the code should. The person responsible for the system still makes that call. That is not generic "human in the loop" language because it sounds responsible. It is an engineering constraint. Anyone who has operated enough automation has seen what happens when remediation runs ahead of understanding.

So the objective is not autonomous cleanup. It is visibility. I want to know what governed a change. I want to know whether that guidance still matches the engineering system it describes. I want its provenance. I want to know what depends on it. And before I change shared guidance, I want to know the blast radius.

Teams working deeply with coding agents are already encountering the maintenance side of context. OpenAI recently described moving away from a single large AGENTS.md in its own agent-first engineering environment because that approach accumulated stale guidance, became difficult to verify and consumed valuable context. Its replacement uses a smaller map into structured repository knowledge, with mechanical checks around the knowledge base.

That does not prove every engineering organization has the same problem. It proves something narrower and more useful: Creating context is not the end of the job. Eventually, you have to operate it.

Coding agents are becoming easier to instruct. The systems around them are becoming better at assembling project context. We can inspect their changes and execution history in increasingly useful ways. The piece I keep coming back to sits between those things. What governed the agent? Because once a software agent is acting on engineering intent, the lineage of that intent becomes part of the system too. And that should be something we can answer without archaeology.

Heather Gearreald
Engineering Executive · Founder, Hertect

Share on LinkedIn

Working Through Something Similar?