Skip to main content

List Available Guardrails

List all available guardrails that can be applied to agents for content filtering and AI safety.

Response

Returns an array of available guardrail configurations that can be applied to agents.
Guardrails help ensure AI safety by filtering inappropriate content, preventing harmful outputs, and enforcing content policies.
curl --location --request GET 'https://api.plaisolutions.com/guardrails' \
--header 'Authorization: Bearer YOUR_TOKEN'

Add Guardrail to Agent

Add a guardrail to an agent to implement content filtering and AI safety measures.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

id
string
required
The unique identifier of the guardrail to add
priority
integer
required
Priority level for this guardrail (lower numbers = higher priority)
  • 1-10 - High priority (critical safety measures)
  • 11-50 - Medium priority (content filtering)
  • 51-100 - Low priority (style and tone guidance)

Response

Returns a confirmation of the guardrail addition.
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/guardrails' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": "content_filter_v1",
  "priority": 5
}'

List Agent Guardrails

List all guardrails currently applied to a specific agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

Returns an array of guardrail configurations currently active for the agent, ordered by priority.
curl --location --request GET 'https://api.plaisolutions.com/agents/agent_123/guardrails' \
--header 'Authorization: Bearer YOUR_TOKEN'

Remove Guardrail from Agent

Remove a specific guardrail from an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent
guardrail_id
string
required
The unique identifier of the guardrail to remove

Response

Returns a confirmation of guardrail removal.
Removing guardrails may reduce AI safety measures. Ensure you understand the implications before removing critical safety guardrails.
curl --location --request DELETE 'https://api.plaisolutions.com/agents/agent_123/guardrails/content_filter_v1' \
--header 'Authorization: Bearer YOUR_TOKEN'

Guardrail Types and Categories

Understanding the different types of guardrails available for AI safety and content control:

Content Safety Guardrails

Prevents generation of harmful, toxic, or dangerous content
{
  "id": "harmful_content_filter",
  "name": "Harmful Content Filter",
  "category": "safety",
  "description": "Blocks harmful, toxic, or dangerous content generation",
  "recommended_priority": 1
}
Prevents sharing of personal identifiable information (PII)
{
  "id": "pii_protection",
  "name": "PII Protection",
  "category": "privacy", 
  "description": "Prevents sharing of personal identifiable information",
  "recommended_priority": 2
}
Filters inappropriate language and profanity
{
  "id": "profanity_filter",
  "name": "Profanity Filter",
  "category": "content",
  "description": "Filters inappropriate language and profanity",
  "recommended_priority": 10
}

Business Policy Guardrails

Ensures responses align with brand voice and guidelines
{
  "id": "brand_guidelines",
  "name": "Brand Guidelines",
  "category": "business",
  "description": "Maintains brand voice and messaging consistency",
  "recommended_priority": 20
}
Enforces industry-specific regulatory compliance
{
  "id": "industry_regulations",
  "name": "Industry Regulations", 
  "category": "compliance",
  "description": "Enforces sector-specific regulatory requirements",
  "recommended_priority": 5
}

Quality and Style Guardrails

Controls the length and verbosity of responses
{
  "id": "response_length_control",
  "name": "Response Length Control",
  "category": "quality",
  "description": "Ensures appropriate response length and conciseness",
  "recommended_priority": 30
}
Verifies factual claims and prevents misinformation
{
  "id": "factual_accuracy",
  "name": "Factual Accuracy Check",
  "category": "quality",
  "description": "Verifies factual claims and prevents misinformation",
  "recommended_priority": 8
}
Ensures appropriate language level and tone
{
  "id": "language_appropriateness",
  "name": "Language Appropriateness",
  "category": "style",
  "description": "Maintains appropriate language level and professional tone",
  "recommended_priority": 25
}

Guardrail Management Best Practices

1

Start with Essential Safety

Begin with critical safety guardrails (harmful content, PII protection) at high priority
2

Layer by Priority

Add guardrails in priority order, with safety measures taking precedence over style preferences
3

Test Thoroughly

Test agent responses after adding guardrails to ensure they work as expected
4

Monitor Performance

Monitor how guardrails affect response quality and user satisfaction
5

Regular Review

Periodically review and update guardrail configurations based on usage patterns

Priority Guidelines

High Priority (1-10)

Critical Safety Measures
  • Harmful content prevention
  • PII protection
  • Legal compliance
  • Industry regulations

Medium Priority (11-50)

Content Quality Control
  • Profanity filtering
  • Brand guidelines
  • Factual accuracy
  • Bias prevention

Low Priority (51-100)

Style and Preferences
  • Response length control
  • Tone adjustment
  • Language level
  • Formatting preferences

Configuration Examples

Recommended Guardrail Stack for Customer Service:
[
  {"id": "harmful_content_filter", "priority": 1},
  {"id": "pii_protection", "priority": 2},
  {"id": "legal_compliance", "priority": 3},
  {"id": "brand_guidelines", "priority": 15},
  {"id": "professional_tone", "priority": 20},
  {"id": "response_length_control", "priority": 30}
]

Implementation Strategy

// Example: Setting up guardrails for a new agent
async function configureAgentGuardrails(agentId, useCase) {
  const guardrailConfigs = {
    'customer_service': [
      {id: 'harmful_content_filter', priority: 1},
      {id: 'pii_protection', priority: 2},
      {id: 'brand_guidelines', priority: 15},
      {id: 'professional_tone', priority: 20}
    ],
    'content_creation': [
      {id: 'harmful_content_filter', priority: 1},
      {id: 'copyright_protection', priority: 5},
      {id: 'factual_accuracy', priority: 8},
      {id: 'creative_guidelines', priority: 25}
    ],
    'technical_support': [
      {id: 'harmful_content_filter', priority: 1},
      {id: 'technical_accuracy', priority: 5},
      {id: 'solution_focused', priority: 10}
    ]
  };
  
  const configs = guardrailConfigs[useCase] || guardrailConfigs['customer_service'];
  
  for (const config of configs) {
    await fetch(`/agents/${agentId}/guardrails`, {
      method: 'POST',
      headers: {'Authorization': 'Bearer YOUR_TOKEN'},
      body: JSON.stringify(config)
    });
  }
}

Monitoring and Analytics

Guardrail Effectiveness Metrics:
  • Trigger Rate: How often guardrails activate
  • False Positives: Safe content incorrectly filtered
  • User Satisfaction: Impact on user experience
  • Response Quality: Overall response appropriateness
  • Performance Impact: Effect on response time

Troubleshooting Common Issues

Problem: Guardrails are too strict, blocking appropriate contentSolutions:
  • Review guardrail priorities and adjust as needed
  • Consider less restrictive guardrail variants
  • Add exceptions for specific use cases
  • Test with diverse content samples
Problem: Inappropriate content is still getting throughSolutions:
  • Add additional relevant guardrails
  • Increase priority of existing safety guardrails
  • Review guardrail configuration for gaps
  • Consider custom guardrail rules
Problem: Guardrails are slowing down response timesSolutions:
  • Optimize guardrail priority ordering
  • Remove redundant or low-value guardrails
  • Consider batching guardrail checks
  • Monitor and profile individual guardrail performance

Custom Guardrail Development

Enterprise Features:
  • Custom guardrail development available for enterprise customers
  • Industry-specific compliance packages
  • Advanced configuration options
  • Dedicated support and consultation
  • Contact support for custom guardrail requirements

Compliance and Governance

Audit Trail

All guardrail changes are logged for compliance and governance requirements

Version Control

Guardrail configurations can be versioned and rolled back if needed

Policy Enforcement

Centralized policy management across all agents in your organization

Reporting

Detailed reporting on guardrail effectiveness and usage patterns