Skip to content

Menu

Guardrail Config Builder

Build content moderation/guardrail configs

Runs entirely in your browserAIFree, no sign-up
Loading tool

01What is Guardrail Config Builder?

If you've shipped a chat feature, you know the guardrail conversation. Somebody asks what the bot refuses, what it redacts, and what users see when a rule fires. The answer often lives in three places, none of them written down. This builder gives you one form for those decisions and turns it into a JSON config you can commit, review and load. The top of the form sets the policy as a whole. Config Name becomes the name key. On Violation picks one of four actions: Block response, Warn user, Redact content or Show fallback. Fallback Message is the text your app can show instead of a blocked answer. Below that sits a list of rules. Each rule has an enable checkbox and a type: Block Topics, Block Patterns, PII Detection, Length Limit, Language Check, Sentiment Filter or Custom Rule. It also has a severity of Block, Warn or Flag, plus one free-text configuration line. That line is not parsed. Whatever you type, such as "email, phone, ssn" or "max_tokens: 4096", is copied into the output as a string for your own code to interpret. The output uses snake_case keys: name, description, on_violation, fallback_message and a rules array. Each rule is exported as type, severity and config. Disabled rules are dropped completely, not exported with a false flag. Rule types come out as stable keys like pii_detection and sentiment, so your middleware can switch on them. Three presets give you a starting point. Content moderation blocks violent and hateful topics and flags long outputs. PII protection redacts with the fallback "[PII REDACTED]" and includes regexes for US Social Security numbers and 16-digit card numbers. Topic restriction keeps a support bot to product questions and uses the fallback action. A quick worked example: load PII protection and untick the Custom Rule. The JSON now holds two rules, pii_detection with "email, phone, ssn, credit_card, address" and block_patterns with the two regexes. The backslashes show up doubled, because that's how JSON escapes them. Be clear about what this is. It doesn't follow a published guardrail standard, and no library reads this exact format out of the box. It doesn't enforce, test or run anything either. It's a planning and documentation tool, and the config is a contract for middleware you write yourself. Everything stays in your browser.

AI engineers and trust and safety staff who need a reviewable, versioned record of what a chat feature blocks, redacts or warns about. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Guardrail Config Builder

  1. Load a preset (Content moderation, PII protection or Topic restriction) or start from the default.
  2. Set Config Name, On Violation and Fallback Message.
  3. For each rule, pick a type and severity and edit its configuration text. Untick rules you want left out.
  4. Use Add Rule for more rules and the trash icon to delete one.
  5. Click Copy Config and load the JSON in your own guardrail code.

03Worked examples

Input: Example "Content moderation" (default)
Result: { "name": "content_moderation", "description": "Standard content moderation guardrails", "on_violation": "block", "fallback_message": "I'm unable to respond to this request as it violates our content policy.", … "type": "length_limit", "severity": "flag", "config": "max_tokens: 4096" } ] }
Each enabled rule is exported as type, severity and config, alongside on_violation and the fallback message.
Input: Example "PII protection"
Result: { "name": "pii_protection", "description": "Protect against PII exposure in outputs", "on_violation": "redact", "fallback_message": "[PII REDACTED]", … "type": "pii_detection", … "config": "email, phone, ssn, credit_card, address" … }
The PII preset sets on_violation to redact with the fallback "[PII REDACTED]" and lists email, phone, ssn, credit_card and address for detection.
Input: Example "Topic restriction"
Result: { "name": "topic_restriction", "description": "Restrict responses to approved topics only", "on_violation": "fallback", "fallback_message": "I can only help with questions about our product. Please ask about features, pricing, or technical support.", … "type": "language_check", … "config": "allowed: en, es, fr" … }
The topic preset uses on_violation fallback, so users get a redirect message instead of a blocked response.
Input: Content moderation with the Sentiment Filter and Length Limit rules unticked
Result: { … { "type": "block_topics", "severity": "block", "config": "violence, hate speech, self-harm, sexual content" }, { "type": "block_patterns", "severity": "block", "config": "profanity, slurs, threats" } ] }
Unticked rules are left out of the JSON entirely, so only the two block rules remain.
Input: PII protection preset with the Custom Rule unticked
Result: "rules": [ { "type": "pii_detection", "severity": "block", "config": "email, phone, ssn, credit_card, address" }, { "type": "block_patterns", "severity": "block", "config": "regex: \\d{3}-\\d{2}-\\d{4}, \\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}" } ]
Rules array only, rows compacted for reading. Backslashes in the regex are doubled by JSON escaping.
Input: Config Name support_bot, On Violation Warn user, empty fallback; Length Limit "max_tokens: 1024" (Warn) enabled, Sentiment Filter disabled
Result: { "name": "support_bot", "description": "", "on_violation": "warn", "fallback_message": "", "rules": [ { "type": "length_limit", "severity": "warn", "config": "max_tokens: 1024" } ] }
Empty fields are kept as empty strings, and the disabled rule is gone.

04Common use cases

  • Drafting a policy file for a customer support chatbot that should only discuss your product
  • Writing down PII redaction requirements before building them into a LangChain or LlamaIndex pipeline
  • Giving a compliance or legal reviewer a readable list of the rules your AI feature applies
  • Keeping guardrail settings in version control as JSON next to your prompt templates
  • Comparing two policy drafts in a pull request diff instead of in a meeting
  • Prototyping the config schema for an internal moderation service

05Tips

  • The config line is stored as plain text. Pick one format per rule type, like "max_tokens: 4096", and parse it the same way everywhere.
  • Use Flag severity for rules you're still tuning, so you can log matches without blocking real users.
  • Regex PII checks miss formatting variants. Pair them with a dedicated detector before production.
  • Run the rules on model output too, not just user input. Retrieved documents can leak PII into answers.
  • Make the fallback message say what the assistant can help with. Users retry less when they know.

06Related concepts

LLM guardrails, Content moderation, PII redaction, Policy as code, Topic filtering.

Frequently Asked Questions

What is Guardrail Config Builder?

Guardrail Config Builder is a free, browser-based developer tool on AIDToolStack. Build content moderation/guardrail configs It requires no installation or sign-up and works entirely in your browser.

Is Guardrail Config Builder free to use?

Yes. No sign-up, no fees and no usage cap.

Does Guardrail Config Builder store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe