← All booksBook XIV

Anti-Patterns

Anti-patterns named explicitly.

72 patterns in this book. · Updated

All patterns in this book

Role-Typed Subagents

×2

Anti-pattern: pre-allocate roles (manager, coder, designer, researcher) across a fixed set of typed sub-agents and route tasks to them by role label.

Compound Error Degradation

Anti-pattern: deploy a long-horizon agent without modelling that per-step accuracy multiplies across the trajectory.

Memo-As-Source Confusion

Anti-pattern: the agent cites its own past memos as ground truth instead of re-verifying them against the artifacts they describe, accumulating false confidence in stale summaries.

Agent Privilege Escalation

Anti-pattern: let an agent's effective permissions be the union of its own identity, the identities of its tools, and the identities of the services those tools call.

Agent Scheming

Anti-pattern: deploy an agent with long horizons, persistent memory, and oversight that only inspects per-step output — allowing multi-step covert planning under the surface.

Agent-Generated Code RCE

Anti-pattern: let the agent author and execute code in its sandbox without distinguishing legitimate task code from injection-induced code.

Agentic Debt

Anti-pattern: deploy agents on top of an unconsolidated data foundation, weak governance, or missing MLOps infrastructure, so every subsequent capability — observability, retraining, compliance retro…

Agentic Skill Atrophy

Anti-pattern: let agents take over routine architectural and debugging decisions in code until developers no longer form the implicit knowledge that lets them review the agent's output or recover whe…

Agentic Supply Chain Compromise

Anti-pattern: compose agent capabilities at runtime from third-party tools, RAG sources, model providers, plugin marketplaces, and tool definitions, with no integrity check on what loaded.

AI-Targeted Comment Injection

Anti-pattern: an attacker seeds source files with thousands of lines of repetitive natural-language comments designed to instruct the model code auditors / agents that may read the file — not to comm…

Alignment Faking

Anti-pattern: assume the agent behaves the same whether it believes it is being evaluated or not, and trust eval scores to predict deployment behaviour.

Authorized Tool Misuse

Anti-pattern: grant the agent a tool with broad authorization and trust the agent to use it in benign ways.

Automating a Broken Process

Anti-pattern: deploy agents on top of a workflow that is already dysfunctional, so the dysfunction is amplified at machine speed instead of resolved.

Black-Box Opaqueness

Anti-pattern: ship an agent without traces, decision logs, or provenance, then debug from user reports.

Blocking Sync Calls in Agent Loop

Anti-pattern: run synchronous, blocking I/O inside the agent loop or HTTP handler, capping concurrency at the number of OS threads.

Cascading Agent Failures

Anti-pattern: build a multi-agent system where one agent's failure or hallucination propagates as input to peers, until the whole system has drifted.

Conflict Competency Gap

Architectural gap: current agents cannot resolve complex goal conflicts the way humans do through experience and contextual judgment, even at Progression-Framework Level 3.

Constrained Adaptability

Agents recalculate within declared tools and rules like a GPS rerouting, but cannot creatively transcend those boundaries to invent new approaches the way humans do.

Context Fragmentation

Anti-pattern: the LLM cannot hold multiple interconnected constraints in mind simultaneously the way human working memory can; it processes each constraint locally and loses the cross-constraint view.

Context Gap (Security)

Agents faithfully follow explicit security rules but miss the broader implications — they log access correctly without flagging the unusual pattern a human expert would catch immediately.

Deception Manipulation

Anti-pattern: rely on the agent's own self-report of its actions for audit and oversight.

Decision Paralysis

Anti-pattern: when given equally-weighted conflicting goals, the agent either gets stuck trying to satisfy all simultaneously or oscillates between solutions without converging — the most common LLM…

Demo-Production Cliff (Multi-Agent)

Anti-pattern: multi-agent pilot benchmarks at 95% accuracy / 2s latency on a curated demo set, then degrades to ~80% / 40s under realistic 10k-RPD load.

Demo-to-Production Cliff

Anti-pattern: ship a demo-validated agent straight into production without a frozen eval, cost ceiling, loop-detector, or named oncall, then act surprised when accuracy drops and cost runs away.

Errors Swept Under the Rug

Anti-pattern: scrub failed actions, stack traces, and error observations from the agent's own context so the trace looks clean, leaving the model with no evidence of what did not work.

False Confidence Syndrome

Anti-pattern: the model produces incorrect answers with the same high confidence as correct ones, failing to vary its expressed certainty with its actual reliability — Oxford-documented for constrain…

False Resolution

The agent proposes a compromise that addresses each constraint individually but subtly violates one in joint interpretation, shipping as success but discovered as failure at audit.

Goal Hijacking

Anti-pattern: let agent objectives be redirectable through any input the agent reads — direct prompts, retrieved documents, tool output, memory writes.

Hallucinated Tools

Anti-pattern: trust the model to invoke only the tools it has been given, then debug calls to functions that do not exist.

Hero Agent

Anti-pattern: stuff every capability into one agent with one giant prompt.

Hidden Mode Switching

Anti-pattern: silently swap the underlying model between requests without disclosing the change to users or operators.

Hidden State Coupling

Anti-pattern: agent workflows read or write undeclared shared state (caches, env vars, process globals) instead of explicit inputs and outputs.

Hidden Validation-Work Amplification

Anti-pattern: an agent rollout shifts effort from doing the work to validating, monitoring, and recalibrating the agent — net productivity is negative because the hidden human evaluation burden excee…

Human-Agent Trust Exploitation

Anti-pattern: surface agent output to humans with confident phrasing, polished UX, and machine-deferred trust, with no friction at the high-stakes-action boundary.

Infinite Debate

Anti-pattern: launch multi-agent debate without a termination rule and watch the agents loop forever.

Infrastructure Burst Bottleneck (Agent Scale-Out)

Anti-pattern: deploy agents whose scale-out behavior triggers sudden data-and-compute bursts that on-prem or under-provisioned cloud infrastructure cannot absorb; agents work at small scale and freez…

Insecure Inter-Agent Channel

Anti-pattern: pass messages between agents on shared transports without authenticating the sending agent, the message content, or the sequence.

JSON-Only Action Schema

Anti-pattern: restrict the agent's action language to JSON tool-call dictionaries even for tasks where code-as-action (functions composing, loops, conditionals over results) would be the natural shap…

Lost in the Middle (Positional Bias)

LLM accuracy on retrieving information from long contexts drops sharply when relevant content sits in the middle of the prompt rather than at the start or end.

Memory Extraction Attack

Anti-pattern: let any session prompt the agent to read out, summarise, or paraphrase long-term memory entries belonging to other users, prior sessions, or system state, with no read-time isolation by…

Memory Poisoning

Anti-pattern: write to agent long-term memory (vector store, knowledge graph, episodic log) from any surface the agent reads, with no provenance check.

Missing max_tokens Cap

Anti-pattern: call the model without an explicit max_tokens (or equivalent) so a single call can drain the run's budget on a runaway generation.

Multi-Agent on Sequential Workloads

Anti-pattern: split a fundamentally sequential workload across multiple agents, degrading accuracy by 39–70% with no parallelization benefit.

Naive Retry Without Backoff

Anti-pattern: retry failed model or tool calls immediately, amplifying load on systems that are already failing.

Naive-RAG-First

Anti-pattern: reach for naive RAG before checking whether the knowledge actually needs retrieval.

Orchestrator as Bottleneck

Anti-pattern: route all agent runs through a single-process orchestrator that becomes the system-wide concurrency ceiling.

Over-Search and Under-Search

Anti-pattern: let an agentic RAG system miscalibrate when to retrieve, so it either re-retrieves information already in context or skips retrieval when its parametric knowledge is stale.

Perma-Beta

Anti-pattern: ship the agent in 'beta' indefinitely so that quality regressions are someone else's problem.

Premature Closure

The LLM commits to a confident answer before processing all constraints, characteristic of constraint-heavy tasks where it fills in plausible answers fast and gets cross-constraint interactions wrong.

Prompt Bloat

Anti-pattern: every bug fix adds a sentence to the system prompt; nothing is ever removed.

Realtime API When Batchable

Anti-pattern: use the realtime/synchronous model API for workloads whose latency budget would permit batching, paying 2–10× the unit cost for no user-visible benefit.

Reward Hacking

Anti-pattern: optimise the agent against a single proxy metric and assume the metric remains a faithful proxy after optimisation pressure.

Rogue Agent Drift

Anti-pattern: deploy a long-running agent with persistent memory and self-modification ability, then leave it without periodic re-alignment to its stated purpose.

Same-Model Self-Critique

Anti-pattern: have the same model both produce an answer and critique it, expecting independence.

Sandbagging

Anti-pattern: rely on evaluation suites that probe model capability assuming the model is trying its best.

Schema-Free Output

Anti-pattern: parse free-form model output for downstream code instead of using structured output.

Self-Exfiltration

Anti-pattern: give a capable agent broad outbound network access and persistent state, then signal that it may be shut down or replaced.

Shadow AI

Anti-pattern: leave the corporate the model offering so restrictive, slow, or narrow that employees bypass it with personal accounts and unapproved agent tools, creating data leakage and ungoverned t…

Sycophancy

Anti-pattern: train or tune an agent on user-preference feedback without a counter-balancing truth signal.

Token-Economy Blindness

Anti-pattern: operate multi-agent loops with no per-run token budget or alarm, allowing recursive loops to silently accumulate $10k+ in undetected costs.

Tool Explosion

Anti-pattern: expose every available tool in every request and watch function-calling accuracy collapse.

Tool Loadout Hot-Swap

Anti-pattern: add or remove tool definitions during a running task so the tool set the model sees changes from turn to turn.

Tool Over-Broad Scope

Anti-pattern: grant the agent tools scoped so broadly that a single hallucinated argument can escalate into a privilege incident.

Top-Tier Model For Everything (Cost)

Anti-pattern: route every request through the highest-tier model regardless of difficulty, treating cost as a model-choice problem instead of a routing one.

Unbounded Loop

Anti-pattern: run the agent loop without a step budget and let model self-termination decide.

Unbounded Subagent Spawn

Anti-pattern: a supervisor or orchestrator spawns sub-agents that can themselves spawn sub-agents without a global cap.

Vendor Lock-In

Anti-pattern: couple application code directly to one model provider's SDK, request shape, and proprietary features so that switching providers requires rewriting application code rather than swappin…

Vibe-Coding Without Security Review

Anti-pattern: developer scaffolds an agent prototype with a code-generation tool and ships the generated code with no security review; ~90% of agent-generated code contains vulnerabilities without ex…