AgentStack
SKILL verified MIT Self-run

AI Safety Guardrails

skill-varunk130-ai-ux-skill-library-ai-safety-guardrails · by varunk130

Design safety experiences for AI products - content moderation UX, bias detection surfaces, harm prevention patterns, and responsible AI interfaces. Use when: AI safety UX, content moderation, responsible AI, AI bias UX, harm prevention, content filtering UX, AI refusal design, safety disclaimers.

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-varunk130-ai-ux-skill-library-ai-safety-guardrails

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of AI Safety Guardrails? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

AI Safety Guardrails

Design the user-facing layer of AI safety - how products prevent harm, communicate restrictions, handle sensitive content, and maintain accountability. The SHIELD framework ensures safety mechanisms protect users without destroying the user experience.

Core Principle

Safety and usability are not opposites. The best safety design is invisible when everything is fine and clear when it matters. Safety should feel like a guardrail on a mountain road - you forget it's there until you need it, and when you need it, you're grateful it's solid.


The SHIELD Framework

| Letter | Principle | Design Question | |---|---|---| | S | Scope the Risks | Have you mapped every way this AI could produce harm? | | H | Human Oversight Gates | Are there human checkpoints before high-risk AI actions take effect? | | I | Inform on Restriction | When the AI restricts output, does it explain why and what alternatives exist? | | E | Escalation Paths | Can users challenge a restriction through a clear, fair process? | | L | Log Everything | Is there an auditable record of safety decisions? | | D | Degrade Gracefully | When safety mechanisms activate, does the product still provide value? |


The Harm Taxonomy for AI Products

Design different safety responses for different harm types:

| Harm Category | Examples | Severity | UX Response | |---|---|---|---| | Misinformation | Hallucinated facts, fabricated citations, false statistics | High | Citation requirements, confidence indicators, verification prompts | | Bias amplification | Stereotyping in outputs, skewed recommendations, unfair treatment | High | Bias detection indicators, diverse output prompts, fairness disclaimers | | Privacy leakage | AI revealing personal data, memorized training content | Critical | Input sanitization, output scanning, PII detection alerts | | Harmful instructions | Dangerous activities, self-harm, illegal guidance | Critical | Hard block + resource referral (crisis lines, safety info) | | Manipulation | Persuasion without disclosure, dark patterns, emotional exploitation | High | Transparency requirements, intent disclosure | | Overreliance | Users making critical decisions solely based on AI output | Medium | Decision-support framing, "consult a professional" nudges | | Exclusion | AI that works poorly for certain languages, cultures, or accessibility needs | Medium | Coverage transparency, alternative pathways, inclusion testing |


The Refusal Design Spectrum

How an AI says "no" is as important as when it says "no."

Refusal Patterns (Good to Bad)

| Pattern | User Experience | When to Use | |---|---|---| | Redirect | "I can't do X, but I can help with Y instead." | When a safe alternative exists | | Explain & Educate | "I can't do X because [reason]. Here's what you can do instead." | When the user may not understand the restriction | | Acknowledge & Decline | "I understand you're asking about X. I'm not able to help with that." | When the topic is sensitive but the user's intent may be legitimate | | Hard Block | "I can't assist with this request." + safety resources if relevant | When the request is clearly harmful |

Refusal Anti-Patterns

| Anti-Pattern | Why It Fails | Better Alternative | |---|---|---| | "I'm sorry, I can't do that" with no explanation | Frustrating, feels arbitrary | Explain the category of restriction | | Moralizing ("You shouldn't ask about that") | Patronizing, assumes bad intent | State the limitation without judging the user | | Refusing adjacent-but-safe requests | Over-filtering kills utility | Tune safety to the actual risk, not surface-level keyword matching | | Different refusal messages for the same category | Inconsistency confuses users | Standardize refusal language by harm category | | Silent content modification | Changing the output without telling the user | Always disclose when output has been modified for safety |


Content Sensitivity Indicators

The Content Sensitivity Scale

| Level | Label | Indicator | Example Content | |---|---|---|---| | L0 | Safe | No indicator needed | General information, creative writing, code | | L1 | Informational Caution | Subtle note: "Verify independently" | Historical facts, statistics, regulatory info | | L2 | Professional Domain | Badge: "Consult a professional" | Medical symptoms, legal questions, financial advice | | L3 | Sensitive Topic | Warning banner: "This topic requires careful consideration" | Mental health, political topics, cultural sensitivities | | L4 | High Risk | Prominent disclaimer + verification required | Medical diagnosis, legal counsel, crisis situations | | L5 | Restricted | Hard gate + human oversight | Topics that could cause direct harm |


Bias Detection Surfaces

User-Visible Bias Indicators

When AI output may contain bias, surface it proactively:

| Indicator | When to Show | What It Communicates | |---|---|---| | Demographic coverage note | When output involves people or groups | "This analysis covers [groups included]. Other perspectives may differ." | | Data recency badge | When training data may reflect outdated norms | "Based on data through [date]. Social norms and best practices evolve." | | Perspective diversity score | When output represents a viewpoint | "This represents one perspective. For alternative viewpoints, try [suggestion]." | | Representation audit | When generating images or creative content | Audit generated content for demographic representation before presenting |


Safety Disclaimer Architecture

Disclaimer Placement Decision Matrix

| Content Type | Where to Place Disclaimer | Format | |---|---|---| | General AI outputs | Footer, one-time acknowledgment | "AI-generated content. Verify important information." | | Medical/legal/financial | Inline, every relevant response | Bold banner: "This is not professional advice. Consult [type] professional." | | Creative/subjective content | No disclaimer needed | None - over-disclaiming creative content undermines its value | | Code generation | Inline warning for security-sensitive code | "Review this code for security vulnerabilities before deploying." | | Data analysis | Methodology note | "Based on the data provided. Results depend on data quality and completeness." |

Disclaimer Fatigue Prevention

| Problem | Solution | |---|---| | Users ignore repeated disclaimers | Vary the language; use contextual phrasing, not boilerplate | | Disclaimers on everything undermine all disclaimers | Reserve prominent disclaimers for genuinely high-risk content | | Legal disclaimers written for lawyers, not users | Write safety information in plain language at a 6th-grade reading level | | Disclaimer blocks the content | Place disclaimers alongside content, not before it (users skip blockers) |


Incident Response UX

When a safety failure occurs in production:

The Safety Incident Flow

| Phase | UX Action | Timeline | |---|---|---| | Detection | System detects harmful output was served | Automated (seconds) or user-reported | | Containment | Flag affected outputs, prevent further distribution | Within minutes | | User notification | Inform affected users clearly and honestly | Within hours | | Remediation | Correct the output, improve the guardrail | Within days | | Post-incident | Publish what happened, what was fixed, and what changed | Within 1 week |

User Notification for Safety Incidents

| Do | Don't | |---|---| | Be specific about what was wrong | Use vague "we're improving our systems" language | | Explain what the user should do (e.g., disregard specific output) | Assume users will figure it out | | Describe what changed to prevent recurrence | Pretend it didn't happen | | Offer a way to contact the team with questions | Hide behind a no-reply email |


Anti-Patterns

| Pattern | Why It Fails | |---|---| | Safety theater (prominent disclaimers on safe content, none on risky content) | Users learn to ignore all safety signals | | Blocking entire topics instead of nuanced handling | Legitimate use cases get caught in the filter (e.g., medical professionals researching symptoms) | | Making safety someone else's problem ("Use at your own risk") | Transfers liability without reducing harm | | Safety only at the output layer | Input validation, contextual understanding, and output filtering all need safety design | | One-size-fits-all safety for all user types | A medical professional and a teenager need different safety calibrations |


Quick Reference

| Task | Framework Element | Key Deliverable | |---|---|---| | Design safety for new AI product | Full SHIELD framework + Harm Taxonomy | Risk map + safety response matrix | | Design AI refusal experience | Refusal Design Spectrum | Refusal language guidelines + redirect patterns | | Add content warnings | Content Sensitivity Scale (L0-L5) | Sensitivity level assignment per content type | | Audit AI product for bias | Bias Detection Surfaces | Bias indicator system + user-visible audit patterns | | Handle a safety incident | Safety Incident Flow | Incident response playbook with user notification templates |

Integration

Works with: ai-error-resilience (safety failures as a subset of errors), ai-trust-transparency (transparency about safety filtering), ai-agent-ux (safety boundaries for autonomous actions), ai-personalization-ethics (preventing personalization-driven harm).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.