Copilot explains an API method that turns out not to exist. What is this called?
Why C is the answer
A hallucination
GitHub defines a hallucination as output that sounds plausible but is incorrect or fabricated. It is why human review matters.
In detail
- A hallucination is a confident output that is not true.
- Check APIs against official docs.
- Verify APIs that you do not recognize.
Use case
An illustrative scenario, not a real incident.
Copilot describes a method called fetchAllSafe, and it reads well. The library has no such method. Checking the official docs catches it before it costs an afternoon.
See it in different ways
flowchart LR A["Copilot suggestion"] --> B["Read and understand it"] B --> C["Test it"] C --> D["Check security and licensing"] D --> E["Merge"]
stateDiagram-v2 [*] --> Suggested Suggested --> Reviewed: check correctness, security and fit Reviewed --> Accepted: passes review Reviewed --> Rejected: fails review Accepted --> [*] Rejected --> [*]
stateDiagram-v2 state "Copilot answers" as s0 state "Check the docs" as s1 state "Use it" as s2 state "Discard it" as s3 [*] --> s0 s0 --> s1 s1 --> s2: it exists s1 --> s3: it does not exist s2 --> [*] s3 --> [*]
Key point: A hallucination sounds right and is not.
Why the other options are wrong
- A. A duplicate suggestion taken from a public repository
- A duplicate would match real code.
- B. A content filter match that replaced the real method name
- A filter blocks content. It does not invent methods.
- D. A context overflow caused by too many files being open
- Too much context does not explain an invented method.

