AI Agent Workflows
Your Agent Harness Needs a Behavior Map
A practical workflow for maintaining agent harnesses: map behaviors to prompts, state, tools, policy, source files, and tests before asking a coding agent to edit the loop.
Short Answer
Harness Handbook points at a practical bottleneck in agent engineering: the behavior you want to change is scattered across prompts, state managers, tool calls, policy code, and tests. Build a behavior map before editing the harness.
Short answer
The hardest part of changing an agent harness is often not the model.
It is finding where the behavior actually lives.
The paper Harness Handbook: Making Evolving Agent Harnesses Readable, Navigable, and Editable names a practical maintenance problem: agent behavior is distributed across prompt builders, state managers, tool schemas, execution loops, memory updates, policy checks, retries, and tests.
So a request like “make the agent ask before editing production config” rarely maps to one file. It maps to a behavior.
That behavior needs a map before it needs a patch.
The mistake
Most coding-agent workflows start too low:
Here is the repo. Change how the agent handles risky actions.
That sounds reasonable, but harness code is not ordinary feature code. The behavior may be assembled at runtime. A prompt fragment names the rule. A state object carries the risk label. A tool wrapper hides the permission boundary. A controller loop retries after refusal. A test only checks the happy path.
If the coding agent edits the first plausible file, the harness can get worse while the diff looks tidy.
The better first artifact is a behavior map:
behavior: asks before production writes
prompt: where the rule is stated
state: where impact class is stored
tool: which calls can mutate production
policy: where act / ask / abstain is decided
loop: retry and escalation behavior
tests: verifier cases that prove the rule
The practical rule
- Start from an observable behavior, not a filename.
- Trace the behavior across prompt, state, tools, policy, loop, and tests.
- Ask the coding agent to edit only verified source locations.
- Refresh the map whenever the harness changes.
A workflow to steal
Use this before editing any agent harness that has tools, memory, or permissions:
Behavior-map edit loop
localize behavior before changing code
- 01Name behavior
- 02Inventory surfaces
- 03Link source spans
- 04Plan narrow edit
- 05Patch harness
- 06Run behavior check
The prompt is small:
Before editing this agent harness, build a behavior map.
For the requested behavior, return:
1. observable behavior in one sentence
2. prompt fragments involved
3. state fields read or written
4. tools and permissions involved
5. controller or policy branches involved
6. tests, evals, logs, or traces that prove the behavior
7. exact source files and symbols to edit
8. files that look related but should not be touched
Then propose the smallest edit against verified locations only.
That last line matters. The map is not documentation theater. It is a scope control device.
Weak vs. safer
Harness maintenance
Weak
- Search for a keyword and edit the first plausible file.
- Give the agent the whole repo and hope it finds the policy.
- Review the diff only.
- Let generated docs drift forever.
Safer
- Name the runtime behavior and trace every surface behind it.
- Give the agent verified source spans plus nearby context.
- Review the behavior map, the diff, and the verifier output together.
- Regenerate the map before major harness edits or in CI.
Where it fails
A behavior map can lie by going stale. That is the main risk.
Treat it like generated operational documentation, not timeless architecture prose. Every mapped claim should cite current source files, symbols, or tests. If the map cannot point to evidence, it is a guess.
This is also not a reason to put every harness rule in prose. Code should still enforce permissions, schemas, sandboxes, logs, and irreversible action gates. The behavior map sits above that. It helps humans and agents find the right enforcement points.
There is also an evidence boundary worth keeping explicit. The paper evaluates behavior localization and edit-plan quality on modification requests from two open-source harnesses. The public repository’s helper is plan-only: it emits a localization plan, not an executed patch. So the result supports better navigation and planning. It does not prove that a generated handbook makes every final code change correct.
Our six-surface map — prompt, state, tools, loop, policy, and tests — is a practical extension of that behavior-centric idea. The source evidence still has to come from the current repository, and the final change still has to survive tests and behavior-level evals.
Behavior maps for agents
Do
- ✓ Map one behavior at a time.
- ✓ Link each claim to source, tests, logs, or traces.
- ✓ Use the map to limit edit scope before patching.
- ✓ Refresh it when prompts, tools, state, or policies change.
Don't
- × Treat a generated handbook as automatically true.
- × Let the coding agent edit unrelated harness surfaces.
- × Review only the diff when behavior spans multiple files.
- × Use more context as a substitute for localization.
The useful lesson is simple: evolving agents need readable harnesses.
Not because documentation is virtuous.
Because behavior you cannot locate is behavior you cannot safely change.
Sources
FAQ
What is a behavior map for an agent harness?
It is a small index that links one observable agent behavior to the prompts, state, tool calls, policy branches, source files, and tests that create it.
Why not just give the whole repo to a coding agent?
More context can still miss the actual behavior boundary. A behavior map starts from what the agent does, then follows that behavior to the exact implementation surface.
Where should a team start?
Pick one brittle harness behavior, map the prompt, state, tool, policy, and verifier paths behind it, then ask the coding agent to edit only verified locations.
Need AI-first architecture support?
Send me a short note about your project or technical bottleneck.
Get in touch