agentskit.js

ValidatorAction

Auto-generated API reference for ValidatorAction.

Type Alias: ValidatorAction

ValidatorAction = "retry" | "block" | "fallback"

Defined in: validator-guard.ts:22

Validator guarantee β€” the "agent insurance" primitive. Wraps any regenerable agent output with a validator chain. If a validator fails, the guard either retries (with optional repair feedback), blocks (returns a deterministic fallback), or falls back to a pre-canned safe answer. Every decision is auditable.

Use cases:

  • JSON-shape contracts on tool inputs / structured outputs.
  • "Never emit PII" final-output gate.
  • "Answer must cite at least one source from the corpus" guarantee.
  • SOX / HIPAA / fair-housing safety rails.

The guard is provider- and adapter-agnostic β€” pass any () => Promise<string> regenerator. Designed to layer on top of @agentskit/eval validators (a deterministic eval is just a Validator whose check returns true/false).

Closes issue #210.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page