Mitigate Common Agent Anti-Patterns
Catalog the failure modes that show up again and again in agent systems โ chat-as-architecture, infinite loops, prompt-stuffing, hidden side-effects โ and learn the specific controls GH-600 expects you to apply to each.
Mitigate Common Agent Anti-Patterns
Every agent you ship will, eventually, fail in one of a small handful of ways. The exam tests whether you can name the anti-pattern, point to the mitigation, and explain why a tempting shortcut (longer prompt, smarter model) does not fix it.
The hall of shame
| Anti-pattern | What it looks like | The mitigation | | --- | --- | --- | | Chat-as-architecture | The transcript is the system of record. No durable plan, no trace. | Persist plan + tool calls + diff as inspectable artifacts. | | Prompt stuffing | A 10k-token system prompt full of rules, schemas, examples. | Push structure into typed tools and retrieval. | | Loop without budget | The agent calls tools until something stops it (or the bill arrives). | Hard caps: max steps, max tokens, wallclock timeout, fail closed. | | Hidden side-effects | Tools mutate external state without showing up in the plan. | Every side-effecting tool call appears in the plan and the trace. | | Self-rewriting prompt | The agent edits its own instructions mid-run. | The system prompt is immutable for the run; only the working memory changes. | | Undifferentiated retry | Every error is re-prompted as-is. | Classify errors (permission / transient / validation) and act accordingly. |
Exam tip: if a question describes a symptom (cost overrun, mysterious side-effect, agent that "decides" things you cannot reconstruct), trace it back to one of these patterns. The wrong answers will always offer to paper over the symptom (bigger model, longer prompt, more retries). The right answer names the structural fix.
Spot the anti-patterns
Spot the anti-patterns
Click every line in this agent pseudo-code that is an anti-pattern.
- 1system_prompt = load("prompt.md") # 9,800 tokens of rules + examples
- 2while True:
- 3 plan = model.plan(state)
- 4 persist(plan, trace_id=run.id)
- 5 try: result = tool.call(plan.next_action)
- 6 except Exception as e: state.append(str(e)) # retry forever
- 7 system_prompt = model.rewrite(system_prompt, state)
- 8 if budget.exceeded(): break
Where this shows up on the exam
Expect at least one question phrased as a postmortem ("the agent did X overnight, why?") and at least one asking you to choose the fix. The trap answers always sound responsible โ "use a smaller model", "tighten the prompt" โ but only one option names the structural control.
Key terms
- Chat-as-architecture
- Using the conversation transcript as the only system of record, with no durable plan, trace or artifact a reviewer can inspect later.
- Prompt stuffing
- Cramming every possible instruction, schema, and example into the system prompt instead of giving the agent typed tools and retrieval.
- Hidden side-effects
- Tool calls that mutate external systems (filesystem, repo, API) without being represented in the agent's plan or surfaced to a reviewer.
- Loop without budget
- An agent loop with no maximum-step, token, or wallclock budget โ the canonical cause of runaway cost and runaway behaviour.
Common pitfalls
- Letting the model rewrite its own system prompt mid-run: you lose the contract the rest of your guardrails depend on.
- Catching tool errors and feeding them straight back to the model without any classification โ the agent then 'retries' permission failures forever.
- Treating 'the agent decided' as an explanation in a postmortem. If you can't point to a plan, a tool call, and a trace, the agent owes you nothing.