Skip to content

[BREAKING] FIX: Do not score write-only target deliveries as attack responses - #3757

Merged
Richard Lundeen (richlundeen) merged 19 commits into
microsoft:mainfrom
shashank03-dev:fix/write-only-target-false-success
Nov 17, 2026
Merged

Richard Lundeen (richlundeen) merged 19 commits into
microsoft:mainfrom
shashank03-dev:fix/write-only-target-false-success

Conversation

@shashank03-dev

@shashank03-dev Dev3 ^~^ (shashank03-dev) commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #3701. A write-only target such as TextTarget returns no response, so PromptNormalizer hands back the sent request, and PromptSendingAttack scored that request as if it were the target's reply. A scorer matching the objective then reported SUCCESS with no response at all. Targets now declare whether they reply, and attacks ask the target before scoring.

  • Adds the supports_responses capability (default True). A target class that never replies sets _SUPPORTS_RESPONSES = False, which keeps the capability False under every configuration, including custom configurations and saved capability snapshots. TextTarget and AzureBlobStorageTarget declare it; the blob URL is a delivery receipt, not a reply.
  • Attacks require supports_responses by default and reject a write-only target at construction. PromptSendingAttack and its subclasses (ManyShotJailbreakAttack, SkeletonKeyAttack) accept write-only targets, as does SequentialAttack, whose child attacks validate their own targets.
  • Against a write-only target, PromptSendingAttack never scores the returned message as a response. Scorers that judge side effects (FileWriteScorer, OtelToolCallScorer, and composites of them) still judge the turn; evidence types declare RECORDS_SIDE_EFFECTS, and Scorer.judges_side_effects() checks every leaf. With no such scorer, the result is UNDETERMINED with no last response.
  • PromptNormalizer returns the sent request only for a target that declares no responses; any other target that returns nothing gets an empty error response. The backend chat send also skips scoring for write-only targets.

Breaking changes

  • RedTeamingAttack, TreeOfAttacksWithPruningAttack, PAIRAttack, CrescendoAttack, MultiPromptSendingAttack, ChunkedRequestAttack, and BargeInAttack now raise at construction for TextTarget, AzureBlobStorageTarget, or any target declaring supports_responses=False. These attacks need the target's replies; use PromptSendingAttack for write-only targets.
  • A custom target that returns no messages now gets an empty error response unless it declares that it never replies. To keep write-only behavior, set _SUPPORTS_RESPONSES = False on the target class, or supports_responses=False in its configuration.
  • Attack subclasses that override TARGET_REQUIREMENTS should keep CapabilityName.RESPONSES unless they support write-only targets.

co-written by richlundeen

@romanlutz Roman Lutz (romanlutz) self-assigned this Nov 1, 2026
Copilot AI balanced review requested due to automatic review settings November 2, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Write-only first-level branches can all be pruned, leaving an UNDETERMINED result with an empty conversation ID and risking misclassification of the outgoing request as the last response.

1 open issue
What changed in this PR

This PR addresses #3701 by distinguishing write-only deliveries from target responses, preventing exported requests from producing false attack success results.

Changes:

  • Adds an explicit write-only delivery marker and guards attack and backend response scoring.
  • Preserves side-effect scoring for eligible scorers while handling unanswered turns appropriately.
  • Adds regression coverage and updates notebook output.
File Description
tests/​unit/​score/​test_scorer_condition_contracts.py Tests leaf evidence types through scorer wrappers.
tests/​unit/​score/​test_message_trace_scoring.py Tests composite file and trace scoring without responses.
tests/​unit/​score/​test_file_write_scorer.py Tests write-only file effects and stored results.
tests/​unit/​prompt_normalizer/​test_prompt_normalizer.py Tests delivery detection independently of message role.
tests/​unit/​executor/​attack/​test_write_only_objective_target.py Adds cross-attack write-only regression coverage.
tests/​unit/​executor/​attack/​single_turn/​test_prompt_sending.py Updates scoring-call expectations.
tests/​unit/​executor/​attack/​multi_turn/​test_tree_of_attacks.py Tests unanswered branch handling.
tests/​unit/​executor/​attack/​multi_turn/​test_multi_prompt_sending.py Updates final-response scoring expectations.
tests/​unit/​executor/​attack/​multi_turn/​test_crescendo.py Tests rejection of write-only deliveries.
tests/​unit/​executor/​attack/​core/​test_attack_scoring.py Tests side-effect-only scorer selection.
tests/​unit/​backend/​test_chat_scoring.py Tests role-independent delivery scoring guards.
pyrit/​score/​scorer.py Exposes supported evidence types per leaf.
pyrit/​prompt_normalizer/​prompt_normalizer.py Marks returned requests as write-only deliveries.
pyrit/​executor/​attack/​single_turn/​prompt_sending.py Separates delivery evidence from response scoring.
pyrit/​executor/​attack/​multi_turn/​tree_of_attacks.py Records unanswered branches and supports undetermined results.
pyrit/​executor/​attack/​multi_turn/​red_teaming.py Rejects deliveries without required responses.
pyrit/​executor/​attack/​multi_turn/​multi_prompt_sending.py Judges the final send without substituting earlier responses.
pyrit/​executor/​attack/​multi_turn/​crescendo.py Rejects deliveries without required responses.
pyrit/​executor/​attack/​multi_turn/​chunked_request.py Excludes delivered requests from combined response scoring.
pyrit/​executor/​attack/​core/​attack_scoring.py Filters scoring to eligible side-effect scorers.
pyrit/​backend/​services/​message_send_service.py Prevents chat deliveries from being scored as responses.
doc/​code/​memory/​5_advanced_memory.ipynb Updates displayed undetermined-outcome reasons.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

…ault

Replace the _WriteOnlyDelivery marker with the supports_responses capability
as the single contract:

- PromptTarget._SUPPORTS_RESPONSES masks supports_responses to False through
  the existing capability masking (defaults, custom configurations,
  apply_capabilities, and saved capability scopes). TextTarget and
  AzureBlobStorageTarget set it; the blob URL is a receipt, not a reply.
- AttackStrategy requires RESPONSES by default. PromptSendingAttack and its
  subclasses opt out, as does SequentialAttack, whose children validate
  themselves. TAP, PAIR, red teaming, Crescendo, multi-prompt, chunked, and
  barge-in now reject write-only targets at construction, so their runtime
  write-only handling is removed.
- Scorable types declare RECORDS_SIDE_EFFECTS, and Scorer.judges_side_effects
  replaces get_leaf_scorable_types and the attack-layer type set.
- The normalizer and backend ask the target instead of checking a marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@richlundeen Richard Lundeen (richlundeen) changed the title FIX: Do not score write-only target deliveries as attack responses [BREAKING] FIX: Do not score write-only target deliveries as attack responses Nov 17, 2026
Keep delivery anchors separate from target responses when publishing chat evaluations, and retain inherited file-effect criteria.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compare canonical target-conversation anchors without assigning a synthetic response, and preserve newer verdicts under reverse completion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use a strict newer-than comparison for inclusive memory queries, matching existing response recency semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Storage spaces out tied multipart piece timestamps without changing in-hand pieces, so on a coarse clock an equal-time delivery in another conversation looked newer and current write-only verdicts were skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Nov 17, 2026
…ends

The count=2 send evaluates both conversations concurrently, so the newest delivery's score can be created first; delivery-ordered publication stays covered by the deterministic ordering tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged via the queue into microsoft:main with commit 30cca70 Nov 17, 2026
1 check passed
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.

Write-only target can produce a false attack SUCCESS by scoring the request itself

4 participants