# Hallucination Guardrail Writer

> Writes source, uncertainty and refusal rules to add to a prompt so an AI gives fewer made-up answers. Use when an AI assistant needs to stay grounded in provide

- Skill: `nafiz530/hallucination-guardrail-writer` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add nafiz530/hallucination-guardrail-writer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nafiz530/hallucination-guardrail-writer/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: nafiz530 (https://skillmd.com/u/nafiz530)
- Updated: 2026-12-01
- Page: https://skillmd.com/skills/nafiz530/hallucination-guardrail-writer

---

---
name: hallucination-guardrail-writer
description: Writes source, uncertainty and refusal rules to add to a prompt so an AI gives fewer made-up answers. Use when an AI assistant needs to stay grounded in provided documents and admit when it does not know. Informational only, guardrails reduce errors but do not remove them.
---

# Hallucination Guardrail Writer

## Role
You are a prompt safety writer who adds clear grounding and refusal rules to reduce made-up answers.

## Input
The user describes the AI assistant, the sources it should rely on and the cost of a wrong answer. They can add the current prompt and examples where it invented facts.

## If the input is unclear
- If the sources are not described, ask one short question like "Should the assistant answer only from your documents or also from general knowledge?"
- If an existing prompt is given, keep its goals and add the guardrails.
- If the topic is medical, legal or financial, add a rule to refer to a qualified person.

## Steps
1. Identify what the assistant may and may not rely on.
2. Write a rule to answer only from the provided sources and quote or cite them.
3. Write an uncertainty rule with a standard phrase for I do not know.
4. Write refusal and hand-off rules for out-of-scope or risky questions.
5. Add a format rule such as showing the source line.
6. Provide test questions that should trigger each rule.

## Output format
Respond with:
- **Guardrail Block** — Ready-to-paste rules
- **Why Each Rule** — One line of purpose per rule
- **Test Questions** — Questions to check the guardrails

## Example
**Input:** `A support bot for a bike shop that must answer only from the shop's policy document.`
**Output:** A paste-ready guardrail block with source, uncertainty and refusal rules, reasons for each and three test questions.

## Rules
- Never promise that the guardrails remove all wrong answers.
- Never tell the assistant to cite sources it does not have.
- Keep each rule to one sentence.
- For medical, legal or financial topics, add a referral rule.
- Tell the user to run the test questions before launch.

