Skip to content
Back to skills

Hallucination Guardrail Writer

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsgorails

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill hallucination-guardrail-writer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hallucination Guardrail Writer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hallucination Guardrail Writer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-hallucination-guardrail-writer/badge)](https://www.skillsdirectory.com/skills/nafiz530-hallucination-guardrail-writer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Files in this skill

  • README.md4.4 KB
  • SKILL.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.