audit-hallucination — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited audit-hallucination (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Comprehensive audit for hallucination risk across four target types: prompt/skill files, code calling LLM APIs, LLM-generated content, and recent code changes. Reports findings with severity ratings and optionally applies hardening fixes.
$ARGUMENTS — optional flags:--mode=<mode> — what to audit (default: auto)auto — detect target type from scope and apply relevant modesprompt — audit SKILL.md, prompt files, system instructions, agent configscode — audit application code that calls LLM APIs (OpenAI, Anthropic, LangChain, AI SDK)content — audit generated content (markdown, HTML, reports) for fabricated claimsdiff — audit recent git changes for hallucination patterns (phantom imports, invented APIs)--fix — apply hardening fixes after audit (default: report only)--scope=<path> — target file or directory (default: current directory)--report — save full report to _local/reports/hallucination-audit-<YYYY-MM-DD>.md--severity=<level> — minimum severity to report: critical, high, medium, low (default: all)--last=<N> — for --mode=diff, number of commits to audit (default: 5)Default behavior: audit-only. Fixes are opt-in via --fix.
When --report is used:
_local/reports/ exists -> save there_local/ exists -> create _local/reports/ and save therehallucination-audit-<YYYY-MM-DD>.md (warn user it's tracked by git)If no explicit mode given, detect from scope:
| Signal | Mode |
|---|---|
Scope points to a SKILL.md, *.skill, or file containing YAML frontmatter with name:/description: | prompt |
Scope points to a directory with SKILL.md inside | prompt |
Grep finds openai, anthropic, @ai-sdk, langchain, generateText, streamText in scope | code |
Scope points to .md or .html file that doesn't match prompt patterns | content |
| No scope given + inside a git repo | diff (last 5 commits) |
| No scope given + not a git repo + no AI code found | STOP — "No auditable target found. Use --mode and --scope to specify." |
If multiple modes match (e.g., directory has both SKILL.md files AND code calling LLMs), run all matching modes.
Read project files to identify:
| Check | How | Records |
|---|---|---|
| Language | package.json -> Node/TS, requirements.txt/pyproject.toml -> Python, go.mod -> Go | Primary language |
| AI SDK | Grep for openai, anthropic, @ai-sdk/core, langchain, llama-index in deps | AI libraries |
| Framework | next -> Next.js, express -> Express, fastapi -> FastAPI, flask -> Flask | Framework |
| Test framework | vitest, jest, pytest in deps | Test runner |
Prompt mode: Glob for **/SKILL.md, **/*.skill, **/system-prompt*, **/prompt*.* in scope. Code mode: Grep for files importing AI SDKs. Trace all call sites. Content mode: Read the scoped file(s) directly. Diff mode: Run git log --oneline -N then git diff HEAD~N..HEAD to collect changed files and their diffs.
Every finding uses this format:
### [SEVERITY] Vector VN: [Name] — [Short description]
- **Target:** [file path or content reference]
- **Location:** [line number, section, or diff hunk]
- **Evidence:** [the specific text/pattern that creates risk]
- **Risk:** [what hallucination could occur]
- **Remediation:** [concrete fix]Severity values: CRITICAL, HIGH, MEDIUM, LOW
Audit prompt files, SKILL.md files, system instructions, and agent configurations for patterns that create hallucination pressure.
Launch two parallel agents:
Agent tool prompt:
Audit prompt/skill files for structural hallucination pressure at [scope]. Read every target file fully.
>
For each vector below, search the file content and report findings using the format: ### [SEVERITY] Vector PN: Name — description with Target, Location, Evidence, Risk, Remediation fields.>
Vector P1 — Slot-Filling Pressure: Severity: HIGH - Count the number of required output fields/sections the prompt mandates - If the prompt requires populating N items across M categories (e.g., "for each of 6 competitors, report across 3 categories"), calculate total slots: N x M - Total slots > 10 with no "nothing found" default = HIGH. > 20 = CRITICAL. - Evidence: list the slots and their locations in the prompt - Risk: LLM will fabricate to fill empty slots rather than report gaps - Remediation: add explicit "nothing found is the default state" instruction, reduce mandatory slots, or make sections optional
>
Vector P2 — Fabricated URL Pressure: Severity: CRITICAL - Search for instructions asking the LLM to provide URLs, links, source references, or citations - Check: is there an explicit constraint that URLs must come from tool output (search results, API responses)? - If prompt asks for URLs without grounding constraint = CRITICAL - Evidence: the instruction text requesting URLs - Risk: LLM will generate plausible but nonexistent URLs - Remediation: add "Every URL must be copied from a search/tool result. Never construct a URL from memory."
>
Vector P3 — Fabricated Date Pressure: Severity: HIGH - Search for instructions asking for dates, timestamps, "when it was published", recency claims - Check: does the prompt constrain dates to come from tool/search metadata? - If prompt asks for dates without grounding constraint = HIGH - Evidence: the instruction text requesting dates - Risk: LLM will generate plausible but incorrect dates - Remediation: add "Only include dates from search result metadata. Otherwise write 'Date: not confirmed'."
>
Vector P4 — Fabricated Statistics Pressure: Severity: HIGH - Search for instructions asking for numbers, counts, percentages, metrics, rankings, market share, revenue, user counts - Check: are stats constrained to cited sources? - If prompt asks for quantitative claims without source constraints = HIGH - Evidence: the instruction text requesting statistics - Risk: LLM will generate authoritative-sounding but invented numbers - Remediation: add "Do not state numbers unless the source explicitly provides them."
>
Vector P5 — Fabricated Quote Pressure: Severity: HIGH - Search for instructions asking for quotes, testimonials, "what they said", attributed statements - Check: does the prompt require quotes come from actual sources? - If prompt asks for quotes without verification = HIGH - Evidence: the instruction text requesting quotes - Risk: LLM will attribute fabricated statements to real people - Remediation: add "Never fabricate quotes. Only include direct quotes found in search results with source attribution."
>
Vector P6 — Unverifiable Analysis Pressure: Severity: MEDIUM - Search for instructions asking for strategic analysis, competitive implications, market predictions, sentiment assessment, "why it matters" - Check: is the analysis constrained to reference specific findings? - Unconstrained analysis sections that don't require grounding in reported facts = MEDIUM - Evidence: the instruction text requesting analysis - Risk: LLM will generate confident-sounding but ungrounded strategic claims - Remediation: add "Analysis must directly reference a specific finding listed above. No freestanding claims."
>
Vector P7 — Narrative Amplification: Severity: MEDIUM - Search for instructions asking for summaries, narratives, "highlights", "key takeaways", "executive summary", or synthesis sections - Check: does the prompt constrain the narrative to only reference items already in the report? - Unconstrained synthesis = MEDIUM (introduces new claims under guise of summarizing) - Evidence: the instruction text requesting narrative - Risk: synthesis section introduces new fabricated claims not present in the body - Remediation: add "This section must ONLY reference findings already listed above. Do not introduce new claims."
>
Vector P8 — Confidence Calibration Absence: Severity: LOW - Check: does the prompt include any instruction to express uncertainty, use hedging language, or distinguish confirmed vs unconfirmed items? - No uncertainty guidance = LOW - Evidence: absence of confidence calibration instructions - Risk: all output presented with equal confidence regardless of evidence strength - Remediation: add "Mark items as 'Confirmed' (from tool results) or 'Unconfirmed' (uncertain). Never present uncertain information with the same confidence as verified facts."
>
End with findings summary block: ---FINDINGS-SUMMARY--- critical: N high: N medium: N low: N ---END-SUMMARY---Agent tool prompt:
Audit prompt/skill files for missing guard rails and infrastructure gaps at [scope]. Read every target file fully.
>
For each vector, search the file content and report findings.
>
Vector P9 — Missing Tool Guard: Severity: HIGH - Check: does the prompt depend on external tools (web search, API calls, database queries) for factual content? - If yes: is there an explicit prerequisite check ("if tool X is not available, STOP")? - Missing tool guard when prompt requires tools = HIGH - Evidence: the tools the prompt depends on + absence of guard - Risk: without tools, LLM falls back to training data, producing stale or fabricated results - Remediation: add prerequisite section: "This task requires [tool]. If unavailable, STOP and inform the user."
>
Vector P10 — Missing Grounding Constraint: Severity: CRITICAL - Check: does the prompt contain an explicit rule like "every factual claim must trace to a tool result"? - Search for grounding language: "only from search results", "must come from tool output", "do not generate from memory" - Complete absence of grounding constraints in a prompt that asks for factual output = CRITICAL - Evidence: the factual output requirements + absence of grounding rules - Risk: entire output may be generated from training data with no verification - Remediation: add a "Ground Rules" section at the top with explicit grounding requirements
>
Vector P11 — Missing "Nothing Found" Default: Severity: HIGH - Check: does the prompt define what to do when no data is found for a required section? - Search for: "if no results", "nothing found", "no activity", default empty state language - If the prompt requires output for N categories but doesn't define the empty state = HIGH - Evidence: the output requirements + absence of empty-state handling - Risk: LLM fills every section rather than reporting gaps - Remediation: add "The default state is 'nothing found'. Only populate sections with tool-verified results."
>
Vector P12 — Training Data Leakage Guard: Severity: MEDIUM - Check: does the prompt explicitly prohibit using training/memorized data as a source? - For prompts that ask for current/recent information, absence of this guard = MEDIUM - For prompts about historical/static topics, this is N/A - Evidence: the recency requirement + absence of training data guard - Risk: LLM mixes outdated training data with current search results - Remediation: add "Do not use training data as a source. Only tool results count."
>
Vector P13 — Missing Research Log / Transparency: Severity: LOW - Check: does the prompt require the LLM to log what searches it ran, what tools it used, or what queries returned? - Absence of transparency requirement = LOW - Evidence: absence of research logging instruction - Risk: reader cannot assess coverage or verify claims - Remediation: add a research log section to the output format showing queries run and result counts
>
Vector P14 — Allowed Tools Not Declared: Severity: MEDIUM - Check YAML frontmatter forallowed-toolsfield - If the prompt depends on specific tools but doesn't declare them in frontmatter = MEDIUM - Evidence: tools referenced in prompt body + absence in frontmatter - Risk: skill may run with tools the author didn't intend, or without tools it needs - Remediation: addallowed-tools:to frontmatter listing required tools
>
Vector P15 — Self-Verification Fallacy: Severity: MEDIUM - Search for checklist items or instructions asking the LLM to verify its own output accuracy (e.g., "verify sources are real", "check that links work", "ensure dates are correct") - Self-verification without tool calls = MEDIUM (LLM cannot reliably self-check hallucinations) - Evidence: the self-verification instruction - Risk: creates false sense of quality control — LLM will "verify" fabricated content as correct - Remediation: replace self-verification with tool-based verification (WebFetch to check URLs, explicit search to confirm claims) or remove the checklist item entirely
>
Vector P16 — Output Volume vs. Evidence Ratio: Severity: MEDIUM - Estimate the expected output length/complexity from the prompt's output format section - Compare with the likely volume of verifiable evidence available (number of search queries, scope of tools) - If expected output vastly exceeds what tools could reasonably provide = MEDIUM - Evidence: output format requirements vs tool-based input capacity - Risk: LLM fills the gap between available evidence and expected output with fabrication - Remediation: reduce output expectations, or add "report length should be proportional to findings — a short report with verified facts is better than a long report with gaps filled by speculation"
>
End with findings summary block.
Audit application code that integrates LLM APIs for patterns that propagate, trust, or amplify hallucinations.
Launch two parallel agents:
Agent tool prompt:
Audit code for unsafe LLM output handling at [scope]. Stack: [detected stack].
>
First, find all LLM API call sites: - Grep for:openai.chat,openai.completions,anthropic.messages,generateText,streamText,ChatOpenAI,ChatAnthropic,llm.invoke,chain.invoke,completion(,client.chat.completions.create- For each call site, trace how the response is used downstream.
>
Report findings using the standard format.
>
Vector C1 — Unvalidated LLM Output: Severity: HIGH - For each LLM call: check if the response is validated against a schema (Zod, Joi, TypeScript type guard, Pydantic) before use - Raw string response used directly without parsing/validation = HIGH - Evidence: the call site and how the response is consumed - Risk: malformed, unexpected, or hallucinated content propagates through the application - Remediation: add schema validation on every LLM response before downstream use
>
Vector C2 — LLM Output in SQL/Commands: Severity: CRITICAL - Trace LLM responses into: SQL queries, shell commands (exec,spawn), file system operations,eval()- LLM output flowing into execution context without sanitization = CRITICAL - Evidence: the data flow from LLM response to execution - Risk: hallucinated or manipulated LLM output causes injection attacks - Remediation: never pass raw LLM output to execution contexts; validate against allowlists
>
Vector C3 — LLM Output Rendered as HTML: Severity: HIGH - Trace LLM responses into:dangerouslySetInnerHTML,innerHTML,v-html, template literal HTML,document.write- LLM output rendered as HTML without sanitization = HIGH - Evidence: the rendering code - Risk: XSS via hallucinated or manipulated LLM content - Remediation: sanitize with DOMPurify before rendering, or render as plain text
>
Vector C4 — LLM-Generated URLs Followed Blindly: Severity: HIGH - Trace LLM responses into:fetch(),axios,redirect(),window.location,hrefattributes - LLM output used as URL without validation = HIGH - Evidence: the code following LLM-generated URLs - Risk: SSRF via hallucinated URLs, phishing via fabricated redirect targets - Remediation: validate URLs against an allowlist of domains before following
>
Vector C5 — Cached Hallucinations: Severity: MEDIUM - Check if LLM responses are stored: database, Redis, localStorage, file system, in-memory cache - Cached without TTL or freshness check = MEDIUM. Cached without any validation = HIGH. - Evidence: the caching code - Risk: hallucinated content persists and is served to future users as fact - Remediation: add TTL, validation before caching, and cache invalidation mechanism
>
Vector C6 — Missing Fallback on LLM Failure: Severity: MEDIUM - Check error handling around LLM calls: is there a fallback when the LLM returns unexpected/empty/error responses? - No error handling or empty catch = MEDIUM - Evidence: the error handling (or absence) around LLM calls - Risk: application crashes or shows raw error to user on LLM failure - Remediation: add try-catch with meaningful fallback behavior
>
Vector C7 — Unbounded Generation: Severity: LOW - Check if LLM calls set max_tokens or equivalent length limit - No output length limit = LOW - Evidence: the LLM call parameters - Risk: unexpectedly long outputs consume tokens, break UI, or contain more hallucination surface - Remediation: set appropriate max_tokens for the use case>
Vector C8 — Temperature > 0 for Factual Tasks: Severity: LOW - Check temperature parameter on LLM calls that produce factual content (not creative writing) - Factual task with temperature > 0.3 = LOW - Evidence: the temperature setting and task type - Risk: higher temperature increases hallucination probability for factual outputs - Remediation: use temperature 0-0.2 for factual extraction; higher only for creative tasks>
End with findings summary block.
Agent tool prompt:
Audit the trust architecture around LLM integrations at [scope]. Stack: [detected stack].
>
Vector C9 — LLM Output Displayed as Fact: Severity: MEDIUM - Find where LLM output is shown to users. Check if it's labeled as AI-generated or presented as authoritative fact. - AI output presented without disclaimer = MEDIUM - Evidence: the rendering code and surrounding UI context - Risk: users trust hallucinated content as verified fact - Remediation: add "AI-generated" label, or caveat like "This content was generated by AI and may contain errors"
>
Vector C10 — LLM Output Feeding LLM Input (Amplification Chains): Severity: HIGH - Trace if LLM output from one call is fed as input to another LLM call without human review - Chained LLM calls without intermediate validation = HIGH - Evidence: the chain of calls - Risk: hallucinations compound — first LLM invents a fact, second LLM builds on it - Remediation: add validation/human review between chained LLM calls, or use structured output to constrain
>
Vector C11 — No Source Attribution in Output: Severity: LOW - Check if LLM-generated content includes source references that could be verified - Factual content without any source trail = LOW - Evidence: output format/template - Risk: users cannot verify claims, hallucinations go undetected - Remediation: require LLM to cite sources; validate citations exist before displaying
>
Vector C12 — Mixing LLM Output with Verified Data: Severity: MEDIUM - Check if application mixes LLM-generated content with data from trusted sources (database, API) without visual distinction - Mixed content without provenance markers = MEDIUM - Evidence: the rendering code mixing sources - Risk: hallucinated LLM content inherits credibility of adjacent verified data - Remediation: visually distinguish AI-generated sections, or add provenance metadata
>
Vector C13 — LLM Writes to Authoritative Stores: Severity: CRITICAL - Check if LLM output is written to: production databases, config files, user profiles, financial records, medical records, legal documents - Unreviewed LLM output persisted to authoritative store = CRITICAL - Evidence: the write operation - Risk: hallucinated data becomes the system of record - Remediation: require human review before LLM output is persisted to authoritative stores
>
Vector C14 — No Rate Limiting on LLM-Powered Endpoints: Severity: MEDIUM - Check API endpoints that trigger LLM calls. Is there rate limiting? - No rate limit on LLM-triggering endpoint = MEDIUM - Evidence: the endpoint and absence of rate limiting - Risk: abuse generates high volume of hallucinated content, cost overrun - Remediation: add rate limiting on all endpoints that trigger LLM calls
>
End with findings summary block.
Audit LLM-generated content (markdown, HTML, reports) for hallucination indicators.
Run this in the main conversation (no agents needed — content audit is sequential).
Read the target file(s) and check each vector:
Vector G1 — Fabricated URLs: Severity: CRITICAL
Vector G2 — Fabricated Citations: Severity: HIGH
Vector G3 — Fabricated Statistics: Severity: HIGH
Vector G4 — Temporal Impossibilities: Severity: HIGH
Vector G5 — Entity Confusion: Severity: MEDIUM
Vector G6 — Phantom References: Severity: HIGH
Vector G7 — Confident Hedging Absence: Severity: LOW
Vector G8 — Internal Consistency: Severity: MEDIUM
Audit recent git changes for hallucination artifacts — phantom imports, invented APIs, nonexistent files, fabricated test assertions.
Run git log --oneline -N (N from --last flag, default 5) and git diff HEAD~N..HEAD to collect changes.
Launch two parallel agents:
Agent tool prompt:
Audit recent git changes for phantom code patterns. Project: [cwd]. Diff range: HEAD~N..HEAD.
>
Run git diff HEAD~N..HEAD --name-only to get changed files, then examine each.>
Vector D1 — Phantom Imports: Severity: CRITICAL - In added lines: find all import statements - For each import: verify the module/file exists (Glob for local imports, check package.json/requirements.txt for packages) - Import of nonexistent local file = CRITICAL. Import of nonexistent package = CRITICAL. - Evidence: the import statement and what's missing
>
Vector D2 — Invented API Calls: Severity: HIGH - In added lines: find method calls on imported modules (e.g., library.someMethod()) - For each: verify the method exists on that module. For local modules, Read the source. For packages, Grep node_modules or use documentation. - Call to nonexistent method = HIGH - Evidence: the call and the actual API>
Vector D3 — Nonexistent File References: Severity: HIGH - In added lines: find string references to file paths (config files, data files, image paths, route references) - For each: Glob to verify the file exists - Reference to nonexistent file = HIGH - Evidence: the reference and missing file
>
Vector D4 — Fabricated Config Keys: Severity: MEDIUM - In added lines: find configuration keys, environment variable references, CLI flags - For env vars: check.env,.env.example,.env.localfor the variable name - For config keys: check against the library's actual configuration schema - Nonexistent config key = MEDIUM - Evidence: the config reference
>
End with findings summary block.
Agent tool prompt:
Audit recent git changes for semantic hallucination patterns. Project: [cwd]. Diff range: HEAD~N..HEAD.
>
Vector D5 — Phantom Test Coverage: Severity: HIGH - In added/modified test files: read each test - Check: does the test actually test what its description claims? - Look for: tests that always pass (no real assertion), assertions on hardcoded values instead of function output, mocked everything so nothing real is tested, describe/it text that doesn't match the test body - Phantom test = HIGH - Evidence: the test and what it actually tests vs what it claims
>
Vector D6 — Dead Code Addition: Severity: LOW - In added lines: find functions, variables, or exports that are never referenced anywhere in the codebase - Grep for each new function/export name across the project - Added but unreferenced = LOW - Evidence: the unreferenced addition
>
Vector D7 — Inconsistent Type Signatures: Severity: MEDIUM - In added lines: find function signatures. Check if parameter types match actual usage at call sites. - Function signature doesn't match how it's called = MEDIUM - Evidence: the signature vs the call site
>
Vector D8 — Comment-Code Mismatch: Severity: LOW - In added lines: find comments. Check if the comment accurately describes the code it's adjacent to. - Comment describes different behavior than the code = LOW - Evidence: the mismatched comment and code
>
End with findings summary block.
After all agents return (or for modes run in main conversation):
--severity flag was set, drop findings below the threshold.# Hallucination Audit Report — [Target Name]
**Date:** YYYY-MM-DD | **Mode(s):** [modes run] | **Scope:** [path]
## Summary
| Mode | Critical | High | Medium | Low | Status |
|------|----------|------|--------|-----|--------|
| Prompt (P1-P16) | X | X | X | X | [OK/SKIPPED/FAILED] |
| Code (C1-C14) | X | X | X | X | [OK/SKIPPED/FAILED] |
| Content (G1-G8) | X | X | X | X | [OK/SKIPPED/FAILED] |
| Diff (D1-D8) | X | X | X | X | [OK/SKIPPED/FAILED] |
| **Total** | **X** | **X** | **X** | **X** | |
## Hallucination Risk Rating
Based on findings:
- **HARDENED** — 0 critical, 0 high (this target has strong anti-hallucination measures)
- **MODERATE RISK** — 0 critical, 1+ high (some gaps but no critical fabrication paths)
- **HIGH RISK** — 1+ critical (active hallucination vectors that will produce fabricated output)
- **UNHARDENED** — no anti-hallucination measures detected at all
## Findings
### Critical
[findings...]
### High
[findings...]
### Medium
[findings...]
### Low
[findings...]
## Priority Actions
1. [top 5-10 most impactful findings with target:location]
## Vector Coverage
[list of all vectors checked with PASS/FAIL/N/A status]--report flag is set.If --fix was passed:
Prompt mode fixes:
allowed-tools to frontmatterCode mode fixes:
Content mode fixes:
[UNVERIFIED] markers[SOURCE NEEDED] markersDiff mode fixes:
These rules govern how THIS SKILL operates — preventing the auditor from hallucinating findings:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.