Skip to main content

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()

Evaluates a request through the multi-stage pipeline.

GovernanceDecision (v1.4)

Example


evaluateResponse()

Evaluates an LLM response through the post-execution pipeline. New in v1.4.

Example


Short-Circuit Behavior

When a stage produces a DENY decision, subsequent stages are skipped:
This is automatic — you don’t need to configure it. The pipeline always short-circuits on DENY regardless of configured depth.

Integration with observe()

When using observe() with a TealGuard instance:

Backward Compatibility

v1.4 is fully backward compatible with v1.3 configurations:
The depth field defaults to "fast" and no post-execution scan runs unless explicitly configured.