Overview
RAXE integrates with Portkey AI Gateway to provide security scanning as a custom webhook guardrail. Portkey is an AI gateway that routes requests to 200+ LLMs with built-in observability, caching, and guardrails. RAXE offers two integration patterns:| Pattern | Use Case |
|---|---|
| Webhook Guardrail | RAXE as a Portkey custom guardrail (Portkey calls RAXE) |
| Client Wrapper | Scan locally before/after Portkey calls |
Installation
Option 1: Webhook Guardrail
Use RAXE as a custom webhook guardrail that Portkey calls for input/output validation.Create the Webhook Endpoint
Configure Portkey
Add RAXE as a webhook guardrail in your Portkey config:Blocking Mode
Enable blocking to returnverdict: false on threats:
Response Format
RAXE returns Portkey-compatible verdicts:Option 2: Client Wrapper
Scan requests locally before they go through Portkey:Blocking Mode
Direct Scan and Call
For more control, usescan_and_call:
Configuration
Error Handling
Statistics
Track scanning statistics:Flask Integration
Best Practices
Start with log-only mode
Start with log-only mode
Monitor threats before enabling blocking:
Use appropriate severity threshold
Use appropriate severity threshold
Choose blocking threshold based on risk tolerance:
Handle the 3-second timeout
Handle the 3-second timeout
Portkey webhook requests timeout after 3 seconds. RAXE’s
fail_open=True
(default) returns a pass verdict if scanning takes too long or errors:Combining with Portkey Features
RAXE works alongside Portkey’s other features:Supported Versions
| Package | Version |
|---|---|
| portkey-ai | >= 1.0.0 |
| raxe | >= 0.3.0 |
