Concern 98 · Working draft · editorial review in progress
Hallucinated code APIs
A hallucinated software interface is a function, package, or service endpoint that generated code assumes exists but cannot actually be used as described.
Understanding the concern
The code can look reasonable because names and syntax follow familiar patterns. A developer may waste time debugging a nonexistent function or be directed toward an untrusted package with a similar name.
This differs from an ordinary typo in a known interface. Documentation, dependency checks, and actual execution are needed. Research on package hallucinations shows why generated recommendations should not be installed or trusted solely because the code imports them.
An example
A recipe asks for a kitchen attachment that sounds standard but was never made for that appliance.
Illustrative unless identified as a documented case.
Words in plain English
- API
- A connection that lets one piece of software request information or actions from another.
- Hallucination
- An AI output that sounds plausible but is false or unsupported, such as an invented source.
- Interface
- The controls and displays people use to interact with software, such as buttons, menus, and chat windows.
Evidence and its limits
The study evaluates nonexistent package recommendations; wider interface errors are an explanatory extension that should be checked against documentation.
Spracklen and colleagues · USENIX Security 2025 · Research study
We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs ↗ (opens in a new tab)Measures nonexistent package suggestions in code generation; results depend on model and evaluation conditions.
Broader frameworks and background
These resources provide context. They do not establish every claim in this concern.
A question to discuss
Does this function or package exist in the version we are using, and is its source trustworthy?
Keep track of different views, what needs checking, and any next step in your own discussion notes.
Open discussion notes →Principles for the conversation
Before you finish · reflect together
Virtues and principles to consider
Virtues are qualities we practice in how we treat people and make choices. They are not scores for judging someone. Use these ideas to explore what a thoughtful response could look like.
Humility
Humility means recognizing the limits of our knowledge and being willing to learn from others. Expertise can be valuable without answering every question.
State where evidence is weak, invite criticism, and listen to people with different experience. Leave room to revise a decision when new information appears.
Ask together: What might we be missing, and who could help us see it?
Prudence
Prudence means using careful judgment before and during action. It balances worthwhile opportunities with the need to avoid harm that could have been anticipated.
Start with a limited trial, set stopping points, and prefer choices that can be undone when uncertainty is high. Review what happens rather than assuming the original plan remains sound.
Ask together: What is a careful next step, and when should we stop or change course?
Truthfulness
Truthfulness means making claims that match the evidence and being clear about what we do not know. It includes correcting mistakes rather than protecting a polished story.
Check sources, label guesses, and distinguish a trial result from a proven benefit. If AI helped produce a claim, someone still needs to take responsibility for checking it.
Ask together: What can we honestly say, and what still needs checking?
Editorial ratings
These are editorial judgments from the register, not measured probabilities or predictions about your situation.
About the register and scoring →More ways to explore
Search for more writing
For more specific or recent material, open a search below or ask for a web summary. AI-generated summaries can contain mistakes; open the original articles to check them.