TealGuard v1.4 — TypeScript API
TealGuard v1.4 adds two major capabilities: configurable multi-stage defense depth and post-execution response scanning.Constructor
TealGuardConfig
depth
Controls how many defense stages execute per request.Default
"fast" — equivalent to v1.3 behavior. No breaking changes.
guardrails
Configures bi-directional scanning — pre-execution (input) and post-execution (output).Pre-Execution Only (v1.3 Compatible)
Post-Execution Only
Bi-Directional
Per-Direction Mode Override
evaluate()
GovernanceDecision (v1.4)
Example
evaluateResponse()
Example
Short-Circuit Behavior
When a stage produces a DENY decision, subsequent stages are skipped:Integration with observe()
When usingobserve() with a TealGuard instance:
Backward Compatibility
v1.4 is fully backward compatible with v1.3 configurations:depth field defaults to "fast" and no post-execution scan runs unless explicitly configured.
