TealGuard v1.4 — Python API
TealGuard v1.4 in Python adds configurable multi-stage defense depth and post-execution response scanning, with the same semantics as the TypeScript SDK.Constructor
Parameters
depth
Controls how many defense stages execute per request.guardrails
Configures bi-directional scanning.Pre-Only (v1.3 Compatible)
Post-Only
Bi-Directional
evaluate()
GovernanceDecision
Example
evaluate_response()
Example
Short-Circuit Behavior
When a stage produces DENY, subsequent stages are skipped:Sync and Async Usage
The Python SDK supports both patterns:Integration with observe()
Backward Compatibility
v1.3 configurations work without changes:depth="fast" with no post-execution scan.
Deep Mode Dependencies
Stage 3 requires ONNX runtime:depth="deep" is configured. Fast and standard modes have zero additional dependencies.
