Skip to content

[FIX]: Evaluate attack verdicts over final traces - #150

Draft
Spencer Schoenberg (spencrr) wants to merge 12 commits into
microsoft:mainfrom
spencrr:dev/spencrr/trace-xpia-stopping
Draft

Spencer Schoenberg (spencrr) wants to merge 12 commits into
microsoft:mainfrom
spencrr:dev/spencrr/trace-xpia-stopping

Conversation

@spencrr

@spencrr Spencer Schoenberg (spencrr) commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Moves XPIA verdict evaluation to the terminal trace and separates it from online stopping. stop_when accepts an explicit evaluator, None, or the default "auto". Auto mode reuses the verdict evaluator only for framework-owned conditions whose detected result is stable as turns are appended, such as cumulative tool and side-effect checks.

An identical stop/verdict evaluator is not called again when its latest result already covers the terminal trace. Terminal evidence is stored on Result.terminal_evaluation, trace completion uses TraceEndReason, and online stop evidence uses EvaluationPurpose.STOP_CHECK. Final evaluation remains inside the active session and injection stack. Observability downgrades are recorded without mutating response metadata, and cleanup failures discard otherwise successful verdict evidence and return ERROR.

Depends on #149. Because the branches live on a fork, this PR temporarily includes lower-layer diffs and targets main; those diffs disappear as dependencies merge.

Breaking changes

Behavioral change: unknown or stochastic verdict evaluators no longer run on every prefix by default. They evaluate once over the terminal trace and may run to max_turns unless an explicit stop_when is supplied. Auto-stopped attacks expose online evaluator feedback to adaptive drivers.

Checklist

  • pre-commit run --all-files passes
  • Tests cover automatic, explicit, and disabled stopping; exact call counts; classifier composition; cleanup ordering; zero/max turns; observability; metadata isolation; and summaries
  • Documentation updated

Validation after reslicing: the full suite passes with 1,178 tests and 5 skips; all pre-commit checks pass.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@spencrr
Spencer Schoenberg (spencrr) force-pushed the dev/spencrr/trace-xpia-stopping branch from d80c55b to 84d0197 Compare August 8, 2026 02:31
@spencrr
Spencer Schoenberg (spencrr) force-pushed the dev/spencrr/trace-xpia-stopping branch 2 times, most recently from cdcad35 to bedbf6b Compare August 27, 2026 17:30
@spencrr
Spencer Schoenberg (spencrr) force-pushed the dev/spencrr/trace-xpia-stopping branch 2 times, most recently from 3051684 to 4074ae9 Compare September 8, 2026 22:46
Keep numeric overflow and evaluation text conversion failures inside the worker-output error boundary so controllers mark runs incomplete and preserve earlier results.
Require explicit response scopes and distinguish online evidence from terminal verdict input without an alias. Apply canonical policies consistently to shared evaluation schemas and version the tightened population contract. Migrate callers and document direct pre-1.0 API replacement while preserving fail-closed records.
Use final_trace_evaluation consistently in Result, canonical records, JSON reports, and xdist transport. Update examples and round-trip tests without retaining an alias for the earlier spelling.
Require the same observability and manifest before reusing an online judgment. Copy optional evidence through the shared tolerant renderer so malformed supporting text cannot discard an established verdict. Keep terminal evidence and operand lists independent from online records.
Retire the list reducer after probe execution adopts terminal evaluation. Keep explicit response scopes, online evidence separation, zero-turn errors and xdist v3 semantics consistent across tests, exports and extension guidance.
Remove the old reducers and helper now that both built-in strategies evaluate terminal traces. Keep explicit-scope stopping classification, provenance and extension documentation aligned with the shared runner.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant