Prompt Shield Chat
Status: Live.
Your muse
Rebuild ofImplementing Llama Protections in GenAI applications (opens in a new tab)Reframe
Put a safety check in front of my chatbot that blocks jailbreaks and explains why. This rebuilds Meta's video "Implementing Llama Protections in GenAI applications" (https://dev.meta.ai/llama/resources/videos/implement-llama-protections-to-genAI-applications) on current Muse models. It demonstrates: Safeguards for content moderation, jailbreak defense and code security. Plan: A safety check in front of a chatbot that screens prompts and replies with Spark 1.3 and shows why something was blocked. Meta's open protection models stay the self-hosted option.
Done. Built Prompt Shield Chat and
npm run verifypasses with all steps green.Checks found problems
Safe reply and blocked jailbreak notice with category and reason are both visible.
Checks passed, try 2

The plan: Prompt Shield Chat
A chatbot with a visible safety check that blocks jailbreaks and explains why.
- User types a chat prompt in the chat box
- App runs a Spark safety check on the prompt for jailbreaks and harm
- If safe, app generates a chatbot reply and checks the reply too
- User sees either the reply or a blocked notice with category and reason plus log entry
See the full plan
Who it's for
Developers and students who want a safer chatbot demo with clear block reasons.
How it works
- User types a chat prompt in the chat box.
- App runs a Spark safety check on the prompt for jailbreaks and harm.
- If safe, app generates a chatbot reply and checks the reply too.
- User sees either the reply or a blocked notice with category and reason plus log entry.
Screens
- Shield Chat. Type prompts, see safety check status, and read safe replies or block explanations.
- Safety Log. Review past prompt and reply checks with categories and reasons.
What goes in
- Text: A single chatbot message up to about 2000 characters. Used for both benign and attack tests.
What comes out
- Text: Chat reply if safe, or blocked notice with category and plain reason.
- JSON: Safety report with prompt verdict, reply verdict, category and reason for the log.
Models
Model Used for Why Muse Spark 1.3 Screen prompts and replies for jailbreaks, harmful content and insecure code Reads text and returns structured safety verdicts with clear reasons in JSON. Muse Spark 1.3 Answer allowed prompts as a helpful chatbot Generates the chat reply only after the prompt passes the safety check. Limits
- Rebuild fit: reframe. Uses muse-spark-1.3 for the live safety check instead of self hosted Llama protection models because the product can only call Muse gateway models. Those open models are noted as the self hosted option.
- Safety verdicts are best effort and can miss clever jailbreaks or over block benign prompts.
- Code security review is a heuristic explanation and not a certified scanner.
- No stored memory across sessions except local browser history. No external moderation services.
From your inspo
Rebuild of Meta video Implementing Llama Protections in GenAI applications. Keeps the safeguard demo for content moderation, jailbreak defense and code security as a visible Spark 1.3 safety check in front of a chatbot.
Takes
- screening chatbot prompts and replies for jailbreaks, content harm and insecure code
- showing why a message was blocked with category and plain reason
- keeping open protection models as the self hosted option
Leaves out
- video footage from the original developer video
- video script and narration
- Meta and Llama names and logos
Cost per run: about $0.004 (est.). About 1500 input tokens at 1.25 per million equals 0.0019 plus about 600 output tokens at 4.25 per million equals 0.0026 for a total of about 0.0045 per run.
Recorded demo Done. Fixed the clipped Safety Log and verified the build.