#1589·guardrails

Surface before/after values on ValidationSummary so callers can see what a FIX changed

Author: zsimjeeCreated Jul 24, 2026Updated Sep 23, 2026
LabelsStale

Smallest useful slice of #1448 — closes the reporter's minimal ask without a schema redesign.

The request in #1448 is for callers to be able to tell that a FIX occurred, which validator did it, and what it replaced. As noted in the thread, this information already exists in ValidatorLogs (value_before_validation / value_after_validation, part of Guard.history) but is not surfaced on ValidationOutcome.

Proposal: add before/after values to ValidationSummary, populated in ValidationSummary._generate_summaries_from_validator_logs (guardrails/classes/validation/validation_summary.py) from the logs that are already passed in.

Why the outcome and not just history: for server-mode users, history is not a durable channel —

  • /guards/{id}/history/{call_id} is marked deprecated in guardrails_api/api/guards.py and is backed by a 300-second cache;
  • GUARD_HISTORY_ENABLED=false is required for sync streaming to work at all (see the FIXME in server_ci/tests/test_server.py).

So the outcome object is the only reliable place to read this.

Notes / gotchas:

  • The field lives in the published guardrails-ai-types package (guardrails_ai/types/validation_summary.py), so this is a types release coordinated with guardrails-api and any generated clients — not a change local to this repo.
  • Needs a camelCase alias, or to_dict() (model_dump(by_alias=True)) and the API/JS clients will silently miss it.
  • Default to a concrete value rather than None: to_dict() uses exclude_none=True, which would make "no change" and "not tracked" indistinguishable — the exact distinction this field exists to provide.
  • ValidationSummary currently defaults to None in the base types package but [] in the guardrails subclass (guardrails/classes/validation_outcome.py:18). Worth reconciling while in here.

Source: guardrails-ai/guardrails