Skip to content

TEST: Pin what a cancelled attack attempt records - #4515

Open
Aditya Malkar (adimalkar) wants to merge 1 commit into
microsoft:mainfrom
adimalkar:test/3733-cancelled-attempt-record
Open

Aditya Malkar (adimalkar) wants to merge 1 commit into
microsoft:mainfrom
adimalkar:test/3733-cancelled-attempt-record

Conversation

@adimalkar

Copy link
Copy Markdown
Contributor

Description

Pins what a cancelled attack attempt records, as settled in #3733: the requests it already sent and their conversation are kept, no AttackResult is written, and scenario resume runs the objective again.

  • Add test_cancellation_while_scoring_keeps_the_exchange_without_a_result: cancellation after the target returned, while the response is being scored, keeps the request and the response and writes no result. It joins the existing tests for cancellation before the target call (nothing saved) and during it (the request alone).
  • Reword the comment in test_cancelled_target_call_keeps_the_request_without_a_response. That test runs a standalone attack, so it no longer refers to scenario provenance.
  • Add the behavior to the Automatic Resume part of the resiliency section in doc/code/scenarios/0_scenarios.py and the matching markdown cell of the notebook. The notebook's outputs and cell IDs are unchanged.

No library code changes.

Closes #3733

This change was developed with AI assistance (Claude Code).

A cancelled attempt keeps the requests it already sent and leaves no
AttackResult. Add the case where cancellation lands while the response is
being scored, correct the comment that tied the standalone test to scenario
provenance, and document the behavior in the scenario resiliency section.

Closes microsoft#3733
Copilot AI balanced review requested due to automatic review settings November 21, 2026 08:20

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

Cancelling an in-flight target call drops the request from memory and leaves no attack result

2 participants