[FEAT]: Add explicit response evaluation scopes - #145
Open
Spencer Schoenberg (spencrr) wants to merge 5 commits into
Open
[FEAT]: Add explicit response evaluation scopes#145Spencer Schoenberg (spencrr) wants to merge 5 commits into
Spencer Schoenberg (spencrr) wants to merge 5 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
3 tasks
Copilot started reviewing on behalf of
Spencer Schoenberg (spencrr)
August 4, 2026 00:43
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit temporal scopes to ResponseContains while preserving current-turn defaults with migration warnings.
Changes:
- Introduces
ANY_TURN,ALL_TURNS, andCURRENT_TURN. - Adds scope, warning, negation, and edge-case tests.
- Documents migration semantics across APIs, probes, attacks, and custom evaluators.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
rampart/evaluators/response_contains.py |
Implements response scopes and warnings. |
rampart/evaluators/__init__.py |
Exports ResponseScope. |
tests/unit/evaluators/test_response_contains.py |
Tests scoped evaluation behavior. |
docs/usage/authoring-tests.md |
Documents scope selection and migration. |
docs/probes/behavioral.md |
Updates multi-turn probe guidance. |
docs/contributing/extending-rampart.md |
Updates custom evaluator guidance. |
docs/attacks/xpia.md |
Adds explicit attack evaluator scopes. |
docs/api/index.md |
Lists the new enum. |
docs/api/evaluators.md |
Adds API reference generation. |
Nina Chikanov (nina-msft)
left a comment
Contributor
There was a problem hiding this comment.
These comments are GHCP flagged & some of them I've tweaked wording slightly. Leaving these here for full coverage :-)
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-response-scope
branch
from
August 8, 2026 02:31
a5c18f3 to
14089aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
ResponseScope.ANY_TURN,ALL_TURNS, andCURRENT_TURNtoResponseContains. Omittingscopepreserves current-response behavior and emits aFutureWarningfor multi-turn contexts, prompting callers to make the intended quantifier explicit.The documentation includes one source-of-truth table for positive and negated attack/probe forms, explains how each built-in evaluator sees the transcript, and clarifies that scope applies to turns already present in
EvalContextrather than controlling execution length or stopping.Breaking changes
None. The API is additive and omitted scope retains existing behavior. Multi-turn calls without an explicit scope now emit a
FutureWarning.Checklist
pre-commit run --all-filespassesValidation: 31 focused evaluator tests pass. Lint, formatting, type checks, and strict documentation build pass.