Works with the AI Agents you already use

    Citation Sentinel

    by milesoyang

    1

    Stops RAG answers from fabricating numbers, thresholds, or steps. Verifies [1][2] citations against sources, feeds failures back for retry, then refuses with a reason instead of guessing.

    Free

    Security scanned
    Citation Sentinel

    Citation Sentinel

    Example session with this skill installed

    Verify this RAG answer against its sources. Source: "熔断器在错误率超过 50% 时打开,滑动窗口为 10 秒。" Answer: "熔断阈值是 80%,窗口 10 秒 [1]。"

    • Read your context and instructions
    • Compiled the citation sentinel

    Summary

    Citation Guard rejected the answer. The model invented an 80% threshold that does not exist in the source (the real value is 50%). No number was allowed through.

    Verification verdict

    CheckResult
    Citation markers stripped[1] removed before analysis
    Number consistencyFAILED — fabricated 80, 80%
    Citation existencepassed ([1] is valid)
    Sentence supportnot reached (hard check already failed)

    Raw verifier output

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    "Only answer from the sources, never make things up" in a system prompt is a hope, not a guarantee. A model that ignores it faces no consequence — and in ops, finance, or legal work one invented threshold can cause real damage.

    Citation Guard turns that promise into a deterministic gate that runs after every generation. Nothing ships until it passes.

    What it does

    Given an answer and the full text of the cited sources, it runs four checks:

    1. Marker stripping — removes [1], [12] before any numeric analysis, so the "1" in a citation marker is never mistaken for a fabricated number. This alone eliminates the most common false positive.
    2. Number consistency (zero tolerance) — every number in the answer (including 50%, 3000ms) must appear in a cited source. 50 and 50% are treated as the same value. The single most dangerous failure — a wrong threshold — is caught every time.
    3. Citation existence — any [n] that doesn't resolve to a real citation card is rejected.
    4. Sentence support (soft threshold) — sentences whose content words barely overlap the sources are counted; reject only when they exceed a cap, so one weak sentence isn't fatal.

    Failed answers are not dropped silently. The exact failure reasons are fed back into the prompt, the model gets a corrected retry, and only after repeated failure does the skill refuse — with needs_human=true, confidence=0, and a reason string naming what was wrong (without presenting the fabricated value as a conclusion).

    A verify_citations kill switch lets you A/B guarded vs. raw generation, and every rejection is logged for a refusal-rate dashboard.

    Why it's different

    • Executable, not advisory — the "never hallucinate" rule becomes code, with a verdict object (ok, reasons, fabricated_numbers, missing_citations) rather than a boolean.
    • Portable — works with any LLM/agent, any language (mixed CJK/English tokenizer built in), no external dependencies.
    • Battle-tested edge cases — percent normalization, multi-source unions, full-text vs. truncated-snippet traps, and threshold recalibration as your corpus grows are all handled and documented.

    What's included

    • SKILL.md — concise instructions with trigger terms for reliable activation
    • references/verification-rules.md — thresholds, tokenization, edge cases, calibration procedure
    • references/retry-and-refusal.md — generation loop, refusal copy, observability, wiring checklist
    • scripts/verify_answer.py — standalone stdlib-only verifier, runnable immediately with built-in examples

    Works with Claude Code, Cursor, Copilot, Codex CLI, Gemini CLI and any agent that loads SKILL.md files.

    Requires full source text rather than snippets for accurate number matching. High-volume document overlap may require manual recalibration of the support thresholds.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    • Free with an Agensi account

    Software
    Python 3.10+

    Nothing to install in the agent itself — instructions run inside the agent. The optional verifier uses only the Python standard library.

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    skills/citation-guard/**

    File access is only to read the SKILL.md, references and optional verifier during setup. No user data, secrets, or external services accessed.

    Listed17 days ago

    What's inside

    Frequently Asked Questions

    No. The checks run in code with no external service, alongside whatever LLM your agent already uses.

    Yes. The tokenizer handles mixed CJK + English with bigrams. Thresholds are documented for recalibration to your corpus.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free