Guardrail Repository
FloTorch Guardrails Repository is a centralized collection of all your guardrails that you can reuse across different models and applications in your workspace.
Types of Guardrails
Section titled “Types of Guardrails”Custom Guardrails
Section titled “Custom Guardrails”Custom guardrails are created and managed entirely within FloTorch. These include:
- Keyword-based filters: Define specific words or phrases to block or filter
- Regex-based filters: Use regular expressions to detect patterns like personal information, financial data, etc.
Custom guardrails support all actions (Block, Redact, Replace, Log) and all severity levels (Low, Medium, High, Critical).
Provider Guardrails
Section titled “Provider Guardrails”Provider guardrails integrate with external AI service providers’ native guardrail capabilities:
- AWS Bedrock Guardrails: Leverage Amazon Bedrock’s built-in content safety and filtering features
- Future provider integrations: Support for additional providers coming soon
Provider guardrails may have limited action and severity options depending on the provider’s capabilities. For example, AWS Bedrock guardrails support Block, Redact, and Log actions, and Low, Medium, and High severity levels.
Creating a Guardrail
Section titled “Creating a Guardrail”Creating Custom Guardrails
Section titled “Creating Custom Guardrails”To create a custom guardrail:
- Navigate to the
Guardrailssection in the FloTorch Console - Click the
New Guardrailbutton in the top right corner - Choose from the available options:
- Create Custom Guardrail: Build your own from scratch
- Use Template: Start with a pre-built template (SSN Detection, Phone Number Detection)
- Provide the required information:
- Name: Unique identifier for your guardrail (alphanumeric with dashes only)
- Description: Explain what this guardrail does (optional)
- Type: Select Keyword or Regex
- Action: Choose Block, Redact, Replace, or Log
- Severity: Set Low, Medium, High, or Critical
- Status: Set Active or Inactive (optional, defaults to Active)
- Configuration: Provide type-specific settings:
- For Keyword: Enter one or more keywords to match
- For Regex: Enter one or more regex patterns to match
- For Replace action: Provide the replacement text
- Click
Createto save your guardrail
Creating Provider Guardrails
Section titled “Creating Provider Guardrails”To create a provider guardrail:
- Navigate to the
Guardrailssection in the FloTorch Console - Click the
New Guardrailbutton - Select
Add Provider Guardrail - Choose your provider (e.g., AWS Bedrock) from the dropdown
- Select the specific guardrail from the provider’s available options
- Choose the version of the guardrail
- Configure the action and severity for your use case (options will be limited based on provider capabilities)
- Provide a name (alphanumeric with dashes only) and description
- Optionally set the status to Active or Inactive
- Click
Createto save
Note: Before creating provider guardrails, you must first configure a Guardrails Provider in the Providers section. See the Guardrails Providers documentation for more information.
Configuring Guardrails for Models
Section titled “Configuring Guardrails for Models”Once created, guardrails can be applied to models at different hooks:
- Navigate to your model in the Model Registry
- Go to the model version you want to configure
- Select the
Guardrailstab - Choose the appropriate hook:
- Input: Filter incoming requests
- Output: Filter model responses
- Input-Output: Filter both requests and responses
- Click
Add Guardrailand select from your repository - Configure the order of execution (drag and drop to reorder)
- Optionally override the action and severity for this specific model
Guardrail Execution Order
Section titled “Guardrail Execution Order”When multiple guardrails are applied to the same hook, they execute in the order you specify. You can drag and drop guardrails to change their execution order. This is important because:
- Earlier guardrails can prevent later ones from running
- The order affects which action is taken if multiple guardrails match
- You can prioritize critical guardrails by placing them first
Updating a Guardrail
Section titled “Updating a Guardrail”To update a guardrail:
- Navigate to the
Guardrailssection - Find the guardrail you want to update
- Click the
Actionsdropdown button (three vertical dots) - Select
Editoption - Update the fields you want to modify:
- Custom Guardrails: You can update name, description, type-specific configuration (keywords/regex), action, severity, and status
- Provider Guardrails: You can update name, description, guardrail version, action, severity, and status
- Click
Updateto save changes
Important Notes:
- You cannot change the type of a guardrail (e.g., from Keyword to Regex) after creation
- For provider guardrails, you cannot change the underlying provider or guardrail type
- Changes to guardrails will automatically apply to all models using that guardrail, unless the model has overridden the specific action or severity
- For Replace action, you must provide replacement text in the configuration
Archiving and Unarchiving a Guardrail
Section titled “Archiving and Unarchiving a Guardrail”Archiving hides a guardrail from the active list but keeps it available for dependencies. You can restore it later.
Archive a guardrail
Section titled “Archive a guardrail”- In the left navigation, go to Guardrails.
- In the guardrails table, open the Actions (three dots) menu for the guardrail and select Archive.
- In the confirmation dialog, review the message: “Are you sure you want to archive this guardrail? You can restore it later if needed.”
- Click Archive. The guardrail is archived and removed from the active list. Existing dependencies continue to work.
- To view archived guardrails, open the top filters dropdown and select Archived.
Unarchive a guardrail
Section titled “Unarchive a guardrail”- In the guardrails table, use the top filters dropdown and select Archived.
- Open the Actions (three dots) menu for the guardrail and select Unarchive.
Deleting a Guardrail
Section titled “Deleting a Guardrail”Deleting a guardrail permanently removes the guardrail and all related dependencies. This action cannot be undone.
- In the left navigation, go to Guardrails.
- In the guardrails table, open the Actions (three dots) menu for the guardrail and select Delete.
- Review the dependency list in the deletion modal.
- Click Continue. A confirmation modal opens and asks you to type the guardrail name.
- Enter the guardrail name and click Permanently Delete. After confirmation, the guardrail and all listed dependencies wont be deleted but the deleted guardrail wont be available to them.
Best Practices
Section titled “Best Practices”- Start with templates: Use pre-built templates for common use cases like SSN or phone number detection
- Use descriptive names: Use alphanumeric characters and dashes to create clear, descriptive names
- Test thoroughly: Always test your guardrails in a development environment before deploying to production
- Monitor logs: Use the Log action to understand what content is being filtered before enabling blocking
- Order matters: Place critical guardrails (like blocking malicious content) before less critical ones
- Document your rules: Provide clear descriptions for your guardrails to help team members understand their purpose
- Regular review: Periodically review and update your guardrails based on new threats and requirements
- Use status wisely: Set guardrails to Inactive or Archive when you want to pause use without removing dependencies