AI coding assistants write with confidence, but that confidence often points at a library version from two years ago dressed up as this morning's best practice.
The root cause is training data gravity. A model learns a library from whatever got written about it most, and the most-discussed version of any API is rarely the newest one. A deprecated method with thousands of Stack Overflow answers outweighs a current method with six paragraphs of release notes, so the assistant reaches for the former by default. The code compiles, tests pass, the PR merges, and nothing looks wrong until a dependency bump or security patch removes the old import path entirely.
The Details:
- Unlike a pasted answer from an old forum thread, AI output carries no timestamp and no comment thread arguing about whether it still works. The same stale pattern can land in dozens of files in one afternoon, each instance looking equally fresh and equally authoritative, which is why the staleness spreads invisibly instead of raising flags.
- The fix is not a new tool, it is feeding the model the version truth it cannot infer on its own: keep the lockfile in the conversation, paste the actual documentation page for the method being used, and state the version constraint out loud at the start of a task, such as noting that v1 patterns are deprecated.
- Code review has to change focus. Checking whether AI output runs is now the easy part since it almost always does. The harder question is whether the pattern is current or merely the most written-about choice, and those two answers no longer reliably match once AI sits in the pipeline.
- A quarterly dependency audit, paired with failing builds on deprecation warnings, turns silent drift into a loud signal before a security patch forces the issue during a production incident.
Bottom Line: Every line of AI-generated code casts a vote for which version of a dependency is real, and unless a human sets that version on purpose, the training data will set it by default.