Installation
Basic Usage
basic.py
ScanPipelineResult Object
Thescan() method returns a ScanPipelineResult:
result_example.py
Detection Object
Each detection contains:detection_example.py
Match Object
match_example.py
Configuration Options
config.py
Background Scanning
For latency-sensitive applications (FastAPI, real-time APIs), use background scan mode. The scan runs asynchronously on a worker thread — your code continues immediately with ~0ms overhead.background_mode.py
Execution Modes
Background mode is incompatible with
on_threat="block". If both are set, RAXE auto-corrects to sync mode with a warning.Decorator Pattern
Protect functions automatically:decorated.py
Custom Threat Handling
custom_handling.py
Context Manager
Ensures proper cleanup:context.py
Error Handling
error_handling.py
Filtering Detections
filtering.py
Multi-Tenant Scanning
For multi-customer deployments, passtenant_id and app_id to resolve tenant-specific policies:
multi_tenant.py
Override Policy Per-Request
policy_override.py
Thread Safety
TheRaxe client is thread-safe:
threaded.py
What’s Next
Async SDK
High-throughput scanning with async support
Agentic Scanning
Specialised scanning for AI agent workflows
