1AI Smells
37 AI code smells in LLM systems
Code smells for AI: signs that a prompt, agent, or pipeline will hurt later. It works, but it gets expensive, fragile, or unsafe.
- items
- 37
- Groups
- 7
Bloaters 6
Things that grew so large that nobody can understand or change them anymore.
- Smell
Prompt Bloat
The system prompt is past 3k tokens and every fixed bug became one more paragraph.
- Smell
Tool Sprawl
The agent has 40 similarly named tools and often picks the wrong one.
- Smell
Context Rot
A long session drags old history that confuses the model and makes every turn pricier.
- Smell
Routing System Prompt
One prompt tries to handle sales, support, and billing with IF the user asks X blocks.
- Smell
Few-Shot Hoarding
The prompt carries 30 fixed examples and nobody remembers why each one is there.
- Smell
Mega Agent
One agent researches, writes, reviews, and publishes with the same context and the same tools.
Control-flow abusers 6
Control flow hidden in the wrong place: inside the prompt or left to chance.
- Smell
Rule Stacking
The prompt piles up ALWAYS, NEVER, and IMPORTANT in caps, and the rules fight each other.
- Smell
Prompt as State Machine
The prompt describes steps (first ask for the ID, then the address) and the model skips or repeats them.
- Smell
Unbounded Loop
The agent can call tools forever; the only limit is the credit card.
- Smell
Agent Where a Chain Would Do
The path never changes, yet an autonomous agent decides the order on every run.
- Smell
Blind Retry
Every error triggers another attempt, including errors that will never succeed.
- Smell
Subagent Recursion
Subagents spawn subagents with no depth or cost limit.
Change preventers 5
Every tweak becomes scary because nobody knows what will break.
- Smell
Untested Prompt
The prompt changes in production with no test set to prove it did not get worse.
- Smell
Model-Pinned Prompt
Switching models or versions breaks everything because the prompt relies on the old model's quirks.
- Smell
Hardcoded Few-Shots
Examples live inside the code and changing one requires a deploy.
- Smell
Scattered Prompt Strings
Prompt fragments assembled with string concatenation across many files.
- Smell
Unversioned Prompt
Nobody knows which prompt version produced the answer the customer complained about.
Dispensables 5
Parts that cost tokens, time, and attention without earning their keep.
- Smell
Redundant Self-Critique
A review your answer step that doubles the cost and almost never changes anything.
- Smell
Unused Tools
Tools in the schema that have not been called in months but take up context on every request.
- Smell
LLM Doing Deterministic Work
The model calculates taxes, formats dates, or validates IDs, things a function does without error.
- Smell
RAG for Small Data
A vector search pipeline for 20 pages that fit entirely in the context.
- Smell
Decorative Multi-Agent
Five agents with job titles passing text to each other without splitting any real work.
Couplers 4
Steps glued together by fragile formats, so changing one breaks the next.
- Smell
Free-Text Handoff
One step hands loose text to the next, which has to guess the format.
- Smell
Shared Scratchpad
Several agents write to the same history and one pollutes the other's reasoning.
- Smell
Raw HTML Tool Output
The tool returns the whole page, menus and footer included, and the model gets lost.
- Smell
Provider Format Leak
One provider's message format has spread into the business code.
Security 5
Gaps that turn any piece of text into a real action.
- Smell
Ungated Side Effect
The agent sends email, pays, or deletes data with no confirmation at all.
- Smell
Instructions from Untrusted Data
Text from pages, emails, or documents enters the prompt with the same weight as instructions.
- Smell
Secret in Prompt
Keys, passwords, or internal data sit in the prompt and can be echoed back to the user.
- Smell
Overprivileged Tool
A read tool has write access, or a run_sql tool accepts any statement.
- Smell
Unvalidated Executed Output
Code, SQL, or commands generated by the model run directly, with no check or sandbox.
Operations 6
The system works in the demo and bleeds money or time in production.
- Smell
No Cost Budget
There is no spending limit per user, per task, or per day.
- Smell
No Tracing
When something goes wrong, nobody can see which calls, tools, and context led to the answer.
- Smell
Serial Latency Stack
Five independent calls run one after another and the user waits 20 seconds.
- Smell
Missing Cache
The same large context and the same questions are processed from scratch every time.
- Smell
Vibe-Check Eval
Quality is measured by trying five questions by hand before deploying.
- Smell
Single Provider Dependency
When the model API goes down or slows down, the whole product stops with it.