# Constraint Decay

Constraint decay is the pattern where an LLM coding agent scores well on a loosely specified task and then loses roughly 30 assertion-pass-rate points as production structural constraints — architecture, databases, ORMs, framework conventions — pile on. The name was coined by Francesco Dente, Dario Satriani, and Paolo Papotti in a 2026 arXiv paper measuring it directly; see [[constraint-decay-backend-agents]] for the study.

The distinction the term draws is between two kinds of requirements. Functional requirements say what the code should do (this endpoint returns these records). Structural requirements say how it must be built (use this ORM, this repository pattern, this database, this framework's conventions). Agents handle the first kind well when left free to pick their own structure. Force them onto a specific stack and the assertion pass rate falls, sometimes near zero for the weakest configurations. Satisfying both kinds at once is the unsolved part.

Two regularities travel with it. Convention-heavy frameworks (FastAPI, Django) are harder than minimal ones (Flask), because more of the "right" answer lives in conventions the agent has to honor rather than invent. And the failures concentrate in the data layer — incorrect query composition and ORM runtime violations are the leading category, not, say, routing or serialization bugs. That fits the broader observation elsewhere that database work is where agents drift furthest from what a project actually requires.

Constraint decay is a concrete, measured instance of the older claim in [[no-silver-bullet-llms]] that LLM output degrades as you move away from the well-documented median. Alex Ellis's field report in [[local-ai-is-not-opus]] describes the same shape from the operator's chair: local models can read and explain a codebase but fail at long-horizon, convention-bound work. The practical response is the one argued in [[reviewing-ai-code]]: the structural constraints are exactly what a reviewer has to check, because the agent's own confidence is uncorrelated with whether it honored them.
