Here is an illustrative incident. A team edits one paragraph in the system prompt of an extraction agent to get a friendlier tone. Nobody touches the JSON Schema, the model string, or the validators.
Latency does not move, and the provider returns HTTP 200 on every call. Over the next few days, though, more responses fail the agent's enum check on a status field that had been stable for months. Blocked requests trickle into logs one at a time, and none looks alarming alone.
That slow creep is LLM schema drift: model output moves away from the contract your application expects, without a loud outage. It is a common form of prompt change regression, and it also follows vendor model upgrades and orchestration edits.
This pillar covers how drift shows up in validation data, what ValGuard measures today, and how to triage an alert before anyone reaches for a re-ask. Operator reference: schema drift documentation.
Why schema drift hides from normal monitoring
Production dashboards usually watch availability, latency, and spend. Drift registers on none of them. What changes is whether the answer satisfies your contract.
Drift is gradual, because a prompt edit nudges label choice rather than breaking every response. It is spread across many requests, so no single log line tells the story. Offline evals help, but they sample a fixed dataset. You need a per-agent comparison of live validation outcomes over time, with enough volume to separate a real shift from noise.
What ValGuard measures
The Schema drift view lives under Monitor in the dashboard at /dashboard/schema-drift. It is available on Growth plans and above. It compares two fixed windows: the last 7 days and the 7 days before that.
For each agent, the comparison counts requests and failures in both windows. A request counts as a failure when it was blocked or when its output did not parse as valid JSON. Rules set to warn, and rules running in shadow mode, do not block, so they do not move this rate.
An alert fires only when all of these hold:
- The recent window has at least 20 requests for the agent.
- The prior window has at least one request, so there is a baseline to compare against.
- The failure rate rose by at least 10 percentage points between the windows.
Each alert is classified as one of two kinds, and the classification depends on a fingerprint.
| Alert kind | Condition | What it usually means |
|---|---|---|
| Fingerprint shift | Fail rate crossed the threshold and the dominant fingerprint differs between windows | The contract itself changed while failures rose |
| Fail-rate jump | Fail rate crossed the threshold and the fingerprint is unchanged or absent | Same contract, worse outputs: prompt, model, or upstream behavior moved |
What the fingerprint actually is
Fingerprints are hashes, not stored payloads. In the current proxy, the fingerprint is a short SHA-256 digest of the JSON Schema configured on the agent's json_schema_validate rule. It is written to each request row as output_schema_fingerprint. A partial index added in migration 000132 keeps the per-agent lookup cheap.
Two consequences follow from that design. A fingerprint shift tells you the schema in force changed between windows, which points at a policy edit or a schema version rollout. An agent with no json_schema_validate rule has an empty fingerprint, so any alert it raises will be a fail-rate jump.
The fingerprint does not hash prompt text or model output. ValGuard does not diff your prompts. Correlating an alert with a prompt edit is still a human step, which is why the triage below starts with a change log.
A worked example
Using illustrative numbers, suppose an agent had 4 failures in 200 requests in the prior window, a 2 percent fail rate. In the recent window it had 18 failures in 120 requests, which is 15 percent. The rise is 13 points, the recent window clears the 20-request floor, and an alert fires.
If the schema was not edited, it is a fail-rate jump, like the opening incident. Each alert shows both fail rates and request counts, and links to the agent's validators editor.
Sequence anomalies on published playbooks
Multi-step orchestration adds a second kind of drift: order. On published playbooks only, the same view compares each run's observed step order from the last 7 days against the playbook's step list.
A run is flagged when one of three things happens:
- A step key appears that is not in the published playbook.
- Two different steps share the same sequence number.
- A step runs before an earlier template step.
Each flag names the playbook and gives a short reason. Skipping forward along a branch is not flagged, but a graph that intentionally loops back will be, so treat results as review prompts. The check does not inspect field values or block runs.
The desired model: detect, explain, then repair deterministically
Good drift handling follows the order ValGuard applies to every request: validation, deterministic repair, fallback, retry, and re-ask last.
Detection should be explainable. "Quality dropped" is not actionable. An alert naming the agent, both fail rates, both request counts, and whether the schema hash moved gives on-call a starting point. Each blocked request underneath still carries the rule id, verdict, reason, and metadata of the validator that fired.
Fixes should be tested before they ship. Each candidate should run against real samples without a model call, soak in shadow mode, then move to enforce. None of this changes the OpenAI-compatible API your application calls, including streaming.
Practical triage for a drift alert
Work through these steps in order. Each is deterministic and cheaper than a re-ask.
- Confirm the volume. Check both request counts on the alert. A recent window just above 20 requests is a weaker signal than one with thousands.
- Check the change log. List what changed in the 14-day span: prompt versions, model strings, validator saves, and playbook publishes. ValGuard does not record deploy markers for you, so keep this in your runbook.
- Classify the alert. A fingerprint shift points at a schema edit first. A fail-rate jump points at prompt, model, or upstream behavior. A sequence anomaly points at orchestration wiring.
- Inspect failing requests. Open request logs for the agent and find the rule ids that block most often. One dominant rule, such as an enum or required-field check, usually identifies the regression.
- Simulate a fix. Use Simulate in the validators editor to replay a sample or a redacted quarantine snapshot against unsaved rules. It diffs the outcome with the saved policy and makes no model call. See the policy simulator and the test policy before production tutorial.
- Shadow, then enforce. Run the candidate in shadow mode to see how often it would block on live traffic. Promote it once the shadow results match what you expect.
- Save with a note. Record why the policy changed. Policy history keeps the last 20 saved snapshots with added, removed, and changed rules.
If failures are mostly parse errors, read how to automatically repair invalid LLM responses before rewriting the prompt.
Separating parse failures from rule failures
The drift view combines blocked requests and invalid JSON into one rate. The proxy's payload_shape telemetry helps split them. It exports a Prometheus counter, valguard_payload_shape_total, labeled by json_valid. It also writes structured log lines for failing responses with a parse error type, such as a trailing comma or truncation. No response content is stored.
| Observation | Likely next step |
|---|---|
Drift alert and rising json_valid=false | Syntax problem: check repair settings and triage with repair-incident-triage |
Drift alert with flat json_valid=false | Rule problem: find the dominant blocking rule and simulate a fix |
| Fingerprint shift | Review the recent schema edit in policy history before touching the prompt |
| Sequence anomaly only | Fix step order before tuning JSON rules |
Playbooks for drift triage
ValGuard ships drift playbooks as two-step triage and handoff checklists. A log-pattern extraction agent structures the incident context, then a human-handoff agent packages it for a reviewer. They do not compare fingerprints, enforce sequence rules, block handoffs, or change policy.
- schema-drift-after-prompt-edit is the primary playbook here: read the drift window, hand the proposed validator change to a reviewer.
- vendor-model-upgrade-drift covers alerts that follow an upstream model change.
- drift-to-simulator-fix packages drift metrics with a candidate validator change.
- sequence-anomaly-regulated-flow and orchestration-step-field-anomaly structure review of flagged multi-step runs.
Close the loop with policy-change-ticket, and catch regressions earlier with pre-deploy-validator-gate.
What this is not
- Not semantic drift detection. A fluent but wrong answer that passes every rule raises no alert.
- Not prompt storage or prompt diffing. Fingerprints are hashes of the configured schema.
- Not release tracking. There are no automatic deploy markers.
- Not enforcement. Alerts and sequence anomalies are read-only signals.
- Not a Free-tier feature. Schema drift follows Growth+ analytics gating.
Start this week
Open the Schema drift view and pick the agent with the largest fail-rate rise. Check your change log for the 14-day span and find the dominant blocking rule. Simulate one candidate fix against a quarantine sample, and record whether the answer is a schema change, a repair setting, or a prompt rollback. When drift lines up with rising spend, see how to detect unexpected LLM cost spikes.
Book a technical walkthrough with our team → Start free in shadow mode — no credit card →