Anti-Hallucination Prompts
GitAuto includes explicit instructions in the system message that tell the model: "NEVER claim a file exists unless you can see it," "Do NOT invent or hallucinate file names," and "Always verify by reading the file first." These prompts reduce the frequency of hallucinated imports and file references.
Why This Exists
The model confidently imports from files that don't exist, references functions with wrong signatures, and assumes project structures based on common patterns rather than the actual repository. Without explicit anti-hallucination instructions, the model writes imports like import { utils } from './utils' for a utils file it has never seen and that may not exist. These phantom imports cause immediate build failures that waste agent iterations to debug.
Why Models Hallucinate File Paths and Imports
Models predict file paths based on naming conventions they've seen in training data. If a project puts utilities in src/lib/utils, but the model's training data more commonly shows src/utils or lib/helpers, it will confidently generate the wrong import path. The model has no file system access to verify paths exist - it's purely guessing based on patterns. Code generation benchmarks provide self-contained problems where all imports are known, so models are never evaluated on navigating real repositories with complex directory structures and have no training signal for import path accuracy in unfamiliar codebases.
How It Works
The anti-hallucination instructions are embedded in the system message that starts every agent session. They are phrased as direct prohibitions: "NEVER," "Do NOT," "ALWAYS verify." Strong wording is intentional because softer instructions like "try to verify files" are ignored under pressure when the model is trying to complete a task quickly. The instructions reduce but do not fully eliminate hallucinations - the model still occasionally invents imports, which is why other safeguards like verification exist.
Related Features
- Web Search - lets the model search for current information about libraries and APIs
- URL Fetching - lets the model read full page content from search results
- Full File Reads - gives the model actual file contents to reference instead of guessing
Need Help?
Have questions or suggestions? We're here to help you get the most out of GitAuto.
Contact us with your questions or feedback!