Agent-Legible Systems
Build the running system so that its signals can be traced to a specific cause, letting an agent diagnose and confirm fixes on its own.
Problem
An agent can only close a loop on what it can measure. Most systems emit coarse signals, such as total memory, average latency and error counts, that say something is wrong but not where. Telemetry is usually added by hand after an outage. Hidden behavior inside dependencies and runtime effects such as garbage collection add noise that blurs cause and effect. Given these signals, an agent guesses, ships a plausible fix, and can’t tell whether it helped.
- Fine-grained telemetry has a cost in storage and effort.
- Libraries hold state and memory the team didn’t write and can’t see.
- Runtime noise can swamp the effect of a single change.
- Changing the stack or dependencies is expensive later.
Solution
Design for attribution. Each operation reports what it did in terms that point at causes: for example, every database query reports its name plus rows scanned versus rows returned, and each cache reports what it holds and why. Give agents access to this telemetry, often through an observability connector. When an agent hits a question the signals can’t answer, it adds the missing telemetry as part of the fix. Prefer components whose behavior is easy to measure: few dependencies, vendored code for the few you need so it can be instrumented, and runtimes where memory and latency changes can be traced to a specific cause. Use the rerun after each fix to confirm or drop it.
Diagram
Coarse signals only say something is wrong. Attributed signals tell the agent where, so each fix can be confirmed or dropped.
When to use
Use it when
- Agents diagnose or tune running systems
- Performance or memory problems are hard to pin down
- You plan an agent hardening or feedback loop
- New services where stack and dependencies are still open
Avoid it when
- Simple systems where coarse metrics already explain failures
- Mature systems where rewriting the stack costs more than it saves; add attribution where it's cheap instead
- When telemetry would capture personal data without controls
Trade-offs
Gains
- Agents find causes, not just symptoms
- Wrong fixes are spotted and dropped quickly
- Telemetry grows where gaps were found, not after outages
Costs
- Telemetry volume and storage
- Stack choices may limit hiring or libraries
- Vendored code needs upkeep
Worked example
Linkwatch's link-preview service uses about 2 GB of memory per busy page, and nobody knows why.
- First guessThe agent shrinks the team’s page cache. The rerun shows no change: the memory was in a cache inside an image library.
- Add telemetryThe agent vendors the library and adds memory reporting for its internal structures and for each request type.
- Cause foundEvery preview request copies the page’s full link list into 3 structures. The agent changes them to share one copy.
- ConfirmedThe rerun shows peak memory falling to about 200 MB. The new telemetry stays, so the next regression is visible at once.
Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
| Coarse signals | Agent ships fix after fix with no measurable effect | Report per-operation numbers that point at causes |
| Black-box dependencies | Memory or latency hides inside a library | Minimize dependencies; vendor and instrument the ones you keep |
| Noise swamps signal | Runs vary more than the effect of any fix | Control runtime noise; repeat runs; compare like for like |
| Telemetry leaks data | Logs capture user content | Record shapes and counts, not payloads; apply data controls |