Yeda AI Tips · #120

Español

End Every Prompt With a Do-NOT Section

The most powerful part of your prompt is the part that says no. You asked for one endpoint; the agent "helpfully" refactored three others, swapped a dependency, and touched the schema. Nothing you wrote was wrong — you just never drew the boundary. A three-line Do-Not section at the end of the prompt is the cheapest fix in prompt engineering.

Why AI over-builds

Coding agents optimize for a complete-looking result, not a minimal one. Given "add a rate limiter," the model has to guess the blast radius: should it also update the middleware chain? Add a config flag? Pull in a library? When the prompt is silent, the model fills the silence — GitHub's own prompt-engineering guidance says to state requirements explicitly and avoid ambiguity precisely because the model resolves ambiguity on its own. Anthropic's Claude Code guide makes the same point from the other side: the more precise your instructions, the fewer corrections you'll need, and a good spec "states what is out of scope."

Over-building isn't a model bug you can wait out. It's under-specification, and it's yours to fix — in about 15 words.

The Do-Not section

End the prompt with explicit negative constraints, one per line:

Add a rate limiter to POST /api/orders.
Return 429 with a Retry-After header when the limit is hit.

Do NOT:
- modify any existing endpoint
- change the database schema
- add new dependencies (use what's already in package.json)
- touch files outside src/middleware/

Putting it last matters less than making it explicit and checkable: each line is something you can verify in the diff. "Nothing outside the task's scope changed" becomes a review criterion instead of a hope.

Which boundaries to set

BoundaryExample lineCatches
Files"Only touch src/middleware/"Drive-by refactors
Dependencies"No new packages"Surprise lockfile churn
Interfaces"Do not change any public API or endpoint"Breaking consumers
Data"Do not modify the schema or migrations"Irreversible changes
Tests"Do not delete or skip existing tests"Green-by-deletion
Process"Do not commit; leave changes staged"Unwanted side effects

Three to five lines is the sweet spot. A 20-line Do-Not wall gets skimmed — the same failure mode as a bloated CLAUDE.md, where important rules get lost in the noise.

Power-user moves

Resources

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog · Leer en español