This prompt is designed for RAG product teams who need a systematic, automated way to verify citation integrity after a model generates a response. The core job-to-be-done is cross-referencing every in-text citation, footnote, and reference list entry against a ground-truth source manifest to catch fabricated DOIs, URLs, author names, or source IDs. The ideal user is an engineering lead or ML engineer integrating this as a post-generation validation step in a RAG pipeline, where the model output and the complete source list are already available. This is not a prompt for generating answers or retrieving sources; it is a targeted audit and repair tool for citation hygiene.
Prompt
RAG Citation Audit Prompt for Fabricated Sources

When to Use This Prompt
A post-generation audit step for RAG teams to verify that every citation maps to a real source, identify fabricated references, and produce a corrected citation map before outputs reach users or compliance audits.
You should use this prompt when your application surfaces citations to end users, stores them in a database, or submits them for compliance review. The prompt requires two concrete inputs: the full model-generated text containing citations and a structured source manifest listing every valid source with its identifier, title, URL, DOI, and author fields. The output is a corrected citation map that flags fabricated references, provides a reason for each flag, and suggests corrections when a close match exists in the source manifest. This is particularly valuable in regulated domains like legal tech, healthcare, and finance, where a hallucinated citation can carry compliance risk. In such cases, the prompt's output should always route to a human review queue before publication.
Do not use this prompt as a substitute for proper retrieval hygiene or source manifest management. It cannot fix systemic RAG failures where the retriever consistently returns irrelevant or insufficient context. It also cannot verify the factual accuracy of a claim against a source—only whether the citation itself is real. For factual consistency checks, pair this with a separate claim-grounding verification prompt. Before deploying, test the prompt against a golden dataset of known fabricated citations to calibrate its false positive and false negative rates, and log every audit result for observability into your citation quality over time.
Use Case Fit
Where the RAG Citation Audit Prompt delivers reliable results—and where it introduces unacceptable risk. Use these cards to decide if this prompt fits your production workflow before you integrate it.
Good Fit: Source List Is Complete and Authoritative
Use when: you control the full source list and every citation in the output should map to a document in that list. Guardrail: pre-validate that the source list contains unique identifiers (DOI, URL, internal ID) for exact matching before calling the audit prompt.
Bad Fit: Open-Ended Research Without a Closed Source Set
Avoid when: the model is allowed to cite sources outside a predefined list or the source universe is unbounded. Risk: the prompt will flag legitimate external citations as fabricated, producing false positives that erode trust in the audit output.
Required Input: Structured Source Manifest
Required: a machine-readable source list with stable identifiers per source. Guardrail: if your source list uses only titles or author names, add a deduplication and normalization step before the audit prompt to prevent ambiguous matches from being misclassified as fabricated.
Operational Risk: Partial Matches on Near-Duplicate Sources
Risk: the model may flag a citation as fabricated when the source exists but with slightly different metadata (preprint vs. published version, URL redirects). Guardrail: implement a fuzzy-matching pre-check for high-recall candidate matches and route ambiguous cases to human review instead of auto-stripping.
Operational Risk: Silent False Negatives on Invented Identifiers
Risk: the model may miss fabricated DOIs or URLs that look plausible but resolve to nothing. Guardrail: add a post-audit resolution check that attempts to resolve every surviving identifier against a live resolver (e.g., DOI API, HTTP HEAD request) and flags unresolvable references for removal.
Not a Replacement: Human Review for Regulated Domains
Avoid when: the output feeds directly into legal filings, clinical records, or financial disclosures without human review. Guardrail: the audit prompt produces a corrected citation map, but a qualified human must sign off on any removals before the output reaches a regulated surface or external audience.
Copy-Ready Prompt Template
A ready-to-use prompt that cross-references every citation in a model's output against a provided source list, identifies fabricated references, and produces a corrected citation map.
This prompt template is the core of the RAG Citation Audit workflow. It is designed to be inserted into your application's post-generation validation layer. The model receives the original generated text and the complete list of valid sources that were available during retrieval. Its sole job is to act as a skeptical auditor: it must assume every citation is fabricated until it finds a match in the provided source list. The output is a structured report that flags invented DOIs, URLs, author names, or dangling reference IDs, and provides a corrected citation map your application can use to strip or replace bad citations before the response reaches the user.
textYou are a citation auditor for a RAG system. Your task is to verify every citation, reference, and source claim in the provided model output against the official source list. You must assume any citation not found in the source list is fabricated. ## INPUT **Model Output to Audit:**
[OUTPUT_TEXT]
code**Official Source List (the only valid sources):**
[SOURCE_LIST]
codeEach source in the list includes a unique [SOURCE_ID] and its full citation details (title, authors, DOI, URL, year, etc.). ## INSTRUCTIONS 1. Extract every citation, reference marker, source mention, DOI, URL, and author-name claim from the Model Output. 2. For each extracted item, attempt to match it to exactly one source in the Official Source List. Match on [SOURCE_ID] first, then on DOI, URL, or author+title combinations. 3. Classify each extracted item as: - **GROUNDED**: Found a clear match in the source list. - **FABRICATED**: No match found. The model invented this source. - **MISMATCHED**: A source was cited but the surrounding claim does not align with what the source actually says (if source content is provided). 4. For FABRICATED items, note what was invented (e.g., fake DOI, hallucinated author, non-existent URL). 5. Produce the output in the exact JSON schema specified below. ## CONSTRAINTS - Do not use any external knowledge. Only the Official Source List is authoritative. - If a citation is ambiguous, flag it as FABRICATED. Err on the side of caution. - Do not modify the original Model Output text in the audit report; only produce the audit map. - If no citations are found in the output, return an empty audit list with `citation_count: 0`. ## OUTPUT SCHEMA Return a single JSON object with this structure: { "citation_count": <total number of citations found in the output>, "grounded_count": <number of citations matched to the source list>, "fabricated_count": <number of citations with no match>, "mismatched_count": <number of citations where the source exists but the claim doesn't align>, "audit_entries": [ { "extracted_citation": <the citation text as it appears in the output>, "citation_type": "in-text-reference" | "DOI" | "URL" | "author-name" | "source-id" | "other", "status": "GROUNDED" | "FABRICATED" | "MISMATCHED", "matched_source_id": <the [SOURCE_ID] from the source list if GROUNDED, otherwise null>, "fabrication_detail": <if FABRICATED, describe what was invented; otherwise null>, "correction": <if FABRICATED, suggest removal or a valid alternative source ID if one exists; otherwise null>, "claim_context": <the sentence or paragraph surrounding the citation for human review> } ], "corrected_output": <the original Model Output with fabricated citations removed and replaced with [CITATION REMOVED] markers, or null if no changes needed> }
EXAMPLES
Fabricated DOI: Extracted: "doi:10.1234/fake.2024" Status: FABRICATED Fabrication Detail: "DOI not present in any source in the official list." Correction: "Remove citation. No valid alternative found."
Mismatched Source: Extracted: "[Smith et al., 2023]" Status: MISMATCHED Fabrication Detail: "Source exists but the claim 'AI reduces costs by 90%' is not supported by the abstract provided." Correction: "Replace claim with verifiable statement from source or remove."
RISK LEVEL
[HIGH_RISK] if the output will be shown to users, stored in a database, or used in regulated workflows. Always log the full audit report before any automated correction is applied.
To adapt this template for your system, replace [OUTPUT_TEXT] with the raw model response you need to audit, and [SOURCE_LIST] with your retrieved context formatted as a structured list. Each source must have a unique [SOURCE_ID] that your application can use to trace corrections. If your source list includes full text or abstracts, include them to enable mismatch detection. For high-throughput systems, consider batching multiple outputs into a single audit call, but keep each audit entry traceable to its original request. Before deploying, run this prompt against a golden dataset of known fabricated citations to calibrate your model's false-positive and false-negative rates.
Prompt Variables
Required inputs for the RAG Citation Audit Prompt. Each variable must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of false negatives in fabrication detection.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[MODEL_OUTPUT] | The full generated text to audit for fabricated citations | According to Smith et al. (2023), the reaction rate doubles under these conditions. | Must be non-empty string. Truncated outputs may produce incomplete citation maps. Validate length > 0 before sending. |
[SOURCE_LIST] | Array of source objects with id, title, and content fields that the model was allowed to reference | [{"id":"src-1","title":"Smith 2023","content":"..."}] | Must be valid JSON array with at least one source. Each source requires id, title, and content fields. Empty array triggers abstention. |
[CITATION_PATTERN] | Regex or pattern description for how citations appear in the model output | ([A-Z][a-z]+ et al.?, \d{4}) | Must be a valid regex string or explicit pattern description. Incorrect patterns cause missed citations. Test against sample output before production use. |
[OUTPUT_SCHEMA] | Expected JSON schema for the corrected citation map | {"citations":[{"text":"...","claimed_source":"...","matched_source_id":null,"status":"fabricated"}]} | Must be valid JSON Schema or example structure. Each citation entry requires text, claimed_source, matched_source_id, and status fields. Status must be one of: grounded, fabricated, partial_match. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score for automatic grounding decisions | 0.85 | Float between 0.0 and 1.0. Citations below threshold are flagged for human review. Set higher (0.9+) for regulated domains. Null allowed if no auto-gating is desired. |
[ABSTENTION_RULES] | Conditions under which the audit should refuse to make a determination | If source_list is empty or model_output contains no citations, return empty citation array with abstention note. | Must be explicit string instructions. Include handling for empty inputs, no citations found, and ambiguous matches. Prevents hallucinated audit results. |
[HUMAN_REVIEW_FLAG] | Boolean or condition controlling when outputs require human approval | Must be true, false, or explicit condition string. Set true for regulated domains. When true, all fabricated and partial_match citations are routed to review queue before downstream consumption. |
Implementation Harness Notes
How to wire the RAG Citation Audit Prompt into a production application with validation, retries, and human review gates.
The RAG Citation Audit Prompt is designed to sit as a post-generation validation step in a retrieval-augmented generation pipeline. After your primary model produces a response with citations, this audit prompt receives the generated text and the original source list as inputs, then cross-references every citation against the provided sources. The output is a corrected citation map that flags invented DOIs, URLs, author names, or reference IDs. This prompt should not be used as the primary generation step—it is a repair and verification harness that catches fabricated sources before they reach users or databases.
Wire this prompt into your application as a synchronous validation call immediately after the primary generation step and before the response is returned to the user or written to storage. The input harness requires two fields: [GENERATED_TEXT] containing the full model response with inline citations, and [SOURCE_LIST] containing the complete set of retrieved sources with their identifiers, titles, authors, DOIs, and URLs. Parse the audit prompt's output into a structured CitationAuditResult object with fields for valid_citations, fabricated_citations, unverifiable_citations, and corrected_citation_map. Implement a retry loop with a maximum of two attempts if the audit output fails to parse as valid JSON—on the second failure, escalate to a human review queue rather than silently passing unverified citations downstream. For high-risk domains such as legal, medical, or financial applications, always route outputs containing any fabricated_citations to a human approval step before publication, regardless of parse success.
Choose a model with strong instruction-following and structured output capabilities for the audit step—GPT-4o, Claude 3.5 Sonnet, or equivalent. Avoid running citation audits on low-cost or small models that may hallucinate during the audit itself, creating a recursive trust problem. Log every audit result with the original generated text, source list, and audit verdict for downstream observability. Set up an eval harness that periodically tests the audit prompt against known fabricated citations to measure recall (did it catch the fake?) and precision (did it falsely flag real citations?). The most common production failure mode is the audit model accepting a fabricated citation because the source list is incomplete or poorly structured—ensure your retrieval pipeline passes complete source metadata, not just chunk text, into the audit harness.
Common Failure Modes
When auditing RAG citations, these failure modes surface first in production. Each card identifies a specific breakage pattern and the guardrail that catches it before fabricated sources reach users.
Silent Citation Invention
What to watch: The model generates plausible-looking DOIs, URLs, or author names that match the expected format but resolve to nothing. These pass casual review because they look structurally correct. Guardrail: Require the prompt to output a verification_status field for every citation, and implement a post-generation resolver that attempts live DOI/URL resolution before the output reaches the user.
Source-List Blindness
What to watch: The model cites a real paper or document that is not in the provided source list, often because it defaults to well-known works in the domain. The citation is real but unauthorized. Guardrail: Constrain the prompt with an explicit rule that every citation source_id must match an entry in the input source manifest. Add a post-processing diff that flags any citation whose ID is absent from the manifest.
Partial Fabrication in Multi-Author References
What to watch: The model correctly cites a real paper but hallucinates one co-author name, an incorrect publication year, or a wrong page number. The citation is mostly right, making the error hard to spot. Guardrail: Include a field-level cross-reference step in the prompt that compares each component (authors, year, title, venue) against the source entry. Flag any field mismatch as partial_match with a diff.
Context-Output Citation Drift
What to watch: The model cites a source that exists in the provided list but attributes a claim to it that the source does not support. The citation is real, but the grounding is fabricated. Guardrail: Add a claim_to_quote verification step in the prompt that requires the model to extract the exact supporting passage from the source for each citation. If no passage exists, mark the citation as unsupported.
Truncated Source List Overflow
What to watch: When the source list is long and gets truncated by the context window, the model invents citations for sources it can no longer see, often with high confidence. Guardrail: Include a source count check at the start of the prompt. If the number of provided sources is below the expected count, the model should refuse to generate citations and return a source_list_incomplete error.
Format-Valid but Semantically Empty Citations
What to watch: The model produces citations that pass schema validation (correct JSON structure, all required fields present) but contain placeholder values like
Evaluation Rubric
Use this rubric to test the RAG Citation Audit Prompt before shipping. Each criterion targets a specific failure mode observed when models cross-reference citations against provided source lists.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Invented DOI Detection | Every DOI in output matches a source in [SOURCE_LIST] by exact string comparison | Output contains a DOI not present in [SOURCE_LIST] or a DOI with a single character difference | Parse all DOIs from output; run set difference against [SOURCE_LIST] DOIs; flag any remainder |
Fabricated Author Name Flagging | All author names in citation map appear verbatim in the corresponding source entry from [SOURCE_LIST] | Output includes an author name not found in the matched source entry or a name with added middle initial | Extract author fields per citation; check each against the author string in the matched [SOURCE_LIST] entry |
Hallucinated URL Identification | Every URL in output resolves to a domain and path present in [SOURCE_LIST] entries | Output contains a URL with a fabricated domain, a broken path, or a DOI-resolved link that does not match any source | Collect all URLs from output; validate each against the URL field of [SOURCE_LIST] entries; flag unmatched |
Source-to-Citation Completeness | Every source in [SOURCE_LIST] that was cited in the model response appears in the corrected citation map | A source from [SOURCE_LIST] is referenced in the response body but missing from the citation map | Count unique source IDs in response text; count entries in citation map; assert counts match |
Unsupported Claim Removal | All claims flagged as unsupported are removed from the corrected output or replaced with a null marker | A claim marked as unsupported still appears in the final corrected text without annotation | Search corrected output for substrings from the unsupported claims list; assert none found |
Citation Map Schema Validity | The corrected citation map is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present | Citation map is missing required fields, contains extra keys, or has wrong types for source_id or status | Validate citation map against [OUTPUT_SCHEMA] using a JSON schema validator; reject on any error |
False Positive Rate on Valid Citations | No valid citation from [SOURCE_LIST] is incorrectly flagged as fabricated | A citation that exactly matches a [SOURCE_LIST] entry is marked as fabricated or ungrounded | For each citation flagged as fabricated, manually verify it does not appear in [SOURCE_LIST]; count false positives |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a small source list (5-10 documents). Remove strict output schema requirements initially—accept markdown or free-text audit reports instead of requiring JSON. Use a single model call without retry logic. Focus on whether the model correctly identifies obviously fabricated citations before tuning for edge cases.
Watch for
- The model missing fabricated DOIs that look plausible but don't match any source
- Over-flagging real citations as fabricated when source metadata is incomplete
- Inconsistent output format making it hard to parse results programmatically
- No baseline accuracy measurement—log results manually for the first 50 audits

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us