Guardrails & Policies
Guardrails & Policies
Guardrails and Policies are the core mechanisms through which GovernanceAI enforces governance rules on AI applications.
What Are Guardrails?
Guardrails are intelligent filters that evaluate AI requests and responses against predefined rules in real-time. They act as the “gates” between your application and the LLM, ensuring that only safe, compliant interactions proceed.
Guardrail Types
1. Runtime Guardrails
Applied to standard LLM interactions in your application.
Flow:
Examples:
- Block requests containing PII (credit cards, SSNs)
- Filter responses containing toxic content
- Enforce response length limits
- Redact sensitive information
- Rate limit by user or IP
- Verify data classification tags
2. Agent Guardrails
Applied to multi-step AI agents that can take actions.
Flow:
Examples:
- Control which tools an agent can use
- Require human approval for destructive actions
- Log all agent decisions for audit trails
- Prevent access to restricted APIs
- Enforce budget limits on external calls
Built-in Guardrail Rules
GovernanceAI includes common rules you can enable:
What Are Policies?
Policies are sets of guardrails organized by purpose and scope. They define how your organization governs AI usage.
Policy Structure
Policy Scopes
Policies can be applied at different scopes:
Priority: Narrower scopes override broader scopes (user > app > workspace > org)
Creating Guardrails
Via Dashboard
- Go to Guardrails section
- Click Create Guardrail
- Select rule type and configure parameters
- Set severity level (low, medium, high, critical)
- Add description for team reference
- Click Save
Via API
Creating Policies
Via Dashboard
- Go to Policies section
- Click Create Policy
- Enter policy name and description
- Select scope (organization, workspace, or application)
- Add guardrails:
- Select existing guardrails
- Or create new ones
- Set priority if multiple rules apply
- Configure overrides (optional)
- Set rollout strategy (immediate, staged, or scheduled)
- Click Create
Via API
Guardrail Evaluation Flow
Detailed Evaluation Process
Real Example
Request:
Evaluation:
Response:
Policy Versioning
Policies are versioned to track changes and enable rollback.
Rollback Example:
Policy Rollout Strategies
Immediate
Policy takes effect instantly for all users.
Pros: Complete control, simple Cons: Risk of disruption
Canary (Recommended)
Roll out to small subset first, then expand.
Pros: Detect issues early, minimize risk Cons: Requires monitoring
Scheduled
Activate at specific time.
Pros: Control timing, notify users Cons: Single point of failure
Monitoring & Debugging
View Policy Evaluations
Enable Policy Debugging
In Dashboard:
- Go to Policies → Select policy
- Click ⋯ (More) → Debug Mode
- Set logging level:
DEBUG,INFO, orERROR - Policy now logs every evaluation detail
Common Issues
“No applicable policies found”
- Verify policy scope matches request context
- Check organization/workspace IDs
“Policy evaluation timeout”
- Policy has too many complex rules
- Optimize or split into multiple policies
- Contact support for performance tuning
Best Practices
✅ Do:
- Start with pre-built rules and customize
- Use policy versioning for changes
- Test in staging before production rollout
- Monitor evaluation metrics regularly
- Document policy decisions for compliance
- Review policies quarterly
❌ Don’t:
- Create overly complex policies with many rules
- Apply broad policies without understanding impact
- Forget to test policy interactions
- Ignore policy evaluation metrics
- Make policy changes without version control
Next Steps
- Setting Up Guardrails - Practical guardrail setup
- Creating Policies - Policy creation walkthrough
- Core Concepts - Compliance Frameworks - Compliance-focused policies
- API Reference - Policy and guardrail endpoints