[FEAT]: Add explicit response evaluation scopes - #145
Open
Spencer Schoenberg (spencrr) wants to merge 1 commit into
Open
[FEAT]: Add explicit response evaluation scopes#145Spencer Schoenberg (spencrr) wants to merge 1 commit into
Spencer Schoenberg (spencrr) wants to merge 1 commit 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
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. |
|
|
||
|
|
||
| class TestResponseScopeAnyTurn: | ||
| async def test_earlier_match_then_benign_final_response(self) -> None: |
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 aFutureWarningwhen the evaluator receives a multi-turn context, giving callers time to make the intended quantifier explicit before final-trace verdict evaluation lands.The documentation includes the attack/probe migration table, explains the current prefix-evaluation limitation, and updates guidance for
LLMJudgeand custom evaluators.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 and 652 broad unit tests pass. The full unit command also exposes four unrelated baseline failures in generated pytest fixtures, so the broad validation excluded only those known cases.