Security
The AI Gateway provides powerful security features to protect your data and prevent abuse. Block sensitive information from being sent to AI providers, and stop malicious users from exploiting your applications.Sensitive Data Protection
The Risk
When using AI assistants or building AI-powered apps, sensitive data can accidentally be exposed:Automatic Detection
The gateway scans all requests for sensitive patterns:
- AWS Access Keys and Secret Keys
- GitHub Personal Access Tokens
- Database connection strings
- API keys (various providers)
- Private keys (RSA, SSH, etc.)
- Credit card numbers
- Social Security Numbers
- Email addresses
- Phone numbers
Blocking Sensitive Data
Configure the gateway to block requests containing sensitive data:Action Types
| Action | Behavior |
|---|---|
| block | Request is rejected, never sent to AI provider |
| warn | Request proceeds but alert is generated |
| redact | Sensitive data is replaced with [REDACTED] before sending |
| log | Request proceeds, logged for review |
Remediation
When sensitive data is detected:- Review the log - see exactly what was exposed
- Rotate credentials - change any exposed secrets immediately
- Update your code - ensure secrets aren’t in files that get sent to AI
- Enable blocking - prevent future exposure
Blocking Malicious Users
When building AI-powered applications, you need to protect against abuse.Common Abuse Patterns
Prompt Injection
Users trying to manipulate your AI to bypass restrictions
Cost Attacks
Users making excessive requests to run up your AI costs
Data Extraction
Attempts to extract training data or system prompts
Jailbreaking
Trying to make the AI produce harmful content
User Blocking
Block abusive users instantly:
- Request is immediately rejected
- No tokens are consumed
- Event is logged for audit
Unblocking Users
Viewing Blocked Users
Access the block list in your dashboard:- Navigate to AI Gateway > Security > Blocked Users
- View all blocked users with reasons and timestamps
- Manage blocks (extend, reduce, remove)
Rate Limiting
Prevent abuse with intelligent rate limiting:Rate Limit Strategies
| Strategy | Use Case |
|---|---|
| Per User | Limit individual user consumption |
| Per IP | Prevent anonymous abuse |
| Per API Key | Limit by integration |
| Global | Overall service protection |
Handling Rate Limits
When users hit limits:Content Filtering
Block requests based on content:Input Filtering
Output Filtering
Audit Logging
All security events are logged:
| Event Type | Details Logged |
|---|---|
| blocked_request | User, reason, request content |
| sensitive_data_detected | Pattern, location, severity |
| rate_limit_hit | User, limit type, current count |
| user_blocked | User, reason, admin who blocked |
| user_unblocked | User, reason, admin who unblocked |
Export Audit Logs
For compliance and review:Security Alerts
Get notified of security events:Alert Configuration
Alert Examples

Best Practices
Start with warn, then block
Start with warn, then block
Begin with ‘warn’ actions to understand what would be blocked, then switch to ‘block’ once tuned.
Review blocks regularly
Review blocks regularly
Check blocked requests weekly to ensure legitimate users aren’t being affected.
Set up alerts early
Set up alerts early
Configure security alerts before launch so you’re notified of issues immediately.
Use appropriate rate limits
Use appropriate rate limits
Set limits that allow normal use while preventing abuse. Adjust based on observed patterns.
Document your policies
Document your policies
Make sure users know your usage policies and what behavior will result in blocking.