Raxe
The main synchronous client for threat detection.Constructor
Example:
scan()
Scan a single prompt for threats.
Returns:
ScanPipelineResult
Raises:
ValidationError: If text is empty or invalidRaxeBlockedError: Ifblock_on_threat=Trueand threat detected
scan_fast()
Fast scan using L1 rules only (< 1ms).scan(text, l2_enabled=False, mode="fast").
scan_thorough()
Thorough scan with all layers (< 10ms).scan(text, mode="accurate").
protect
Decorator for automatic function protection.suppressed()
Context manager for scoped suppressions.Context Manager
Use as context manager for proper resource cleanup:AsyncRaxe
Async client for high-throughput scenarios.Constructor
scan()
Async scan of a single prompt.scan_batch()
Async batch scanning with concurrency control.
Example:
Cache Management
close()
Explicitly close the client and flush telemetry.Context Manager
Recommended usage:Properties
BothRaxe and AsyncRaxe expose these properties:
Example:
Thread Safety
Raxeis thread-safe for concurrent scansAsyncRaxeis safe for concurrent async tasks- Both clients maintain internal state safely
