-
Notifications
You must be signed in to change notification settings - Fork 649
FEAT Support baseline-only execution in Scenario #1321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
slister1001
wants to merge
6
commits into
Azure:main
Choose a base branch
from
slister1001:feature/baseline-only-execution
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
FEAT Support baseline-only execution in Scenario #1321
slister1001
wants to merge
6
commits into
Azure:main
from
slister1001:feature/baseline-only-execution
Conversation
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
This change allows scenarios to be initialized with an empty strategies list when include_baseline=True. Previously, empty strategies would raise a ValueError even when baseline was requested. Changes: - Add allow_empty parameter to prepare_scenario_strategies() in ScenarioStrategy. When True and an empty sequence is explicitly provided, returns an empty list instead of raising ValueError. - Update Scenario.initialize_async() to pass allow_empty=include_baseline so baseline-only execution is allowed when baseline is requested. - Add _create_standalone_baseline() method to Scenario that creates a baseline attack directly from dataset_config when no other atomic attacks exist to derive from. - Add unit tests for baseline-only execution scenarios. This enables use cases where users want to run only baseline attacks without any additional attack strategies, such as for establishing baseline metrics before applying attack techniques.
…nd consolidate methods
- Add return type annotation to _get_baseline_data() method - Apply ruff formatting to scenario files
rlundeen2
reviewed
Jan 23, 2026
| Raises: | ||
| ValueError: If required data is not available. | ||
| """ | ||
| if self._atomic_attacks and len(self._atomic_attacks) > 0: |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good!
Can we get rid of the if statement and just get scenario-level settings? The only reason we didn't do that before was these didn't exist.
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.
Summary
This PR enables scenarios to be initialized with an empty strategies list when
include_baseline=True. Previously, empty strategies would raise aValueErroreven when baseline was requested.Problem
When using
RedTeamAgent(orFoundryScenario) withinclude_baseline=Trueandscenario_strategies=[], the scenario would fail with:This prevented users from running baseline-only attacks, which is useful for:
Changes
scenario_strategy.py: Addedallow_emptyparameter toprepare_scenario_strategies(). WhenTrueand an empty sequence is explicitly provided, returns an empty list instead of raisingValueError.scenario.py:initialize_async()to passallow_empty=self._include_baselineso baseline-only execution is allowed when baseline is requested_create_standalone_baseline()method that creates a baseline attack directly fromdataset_configwhen no other atomic attacks exist to derive fromTests: Added 4 unit tests covering baseline-only execution scenarios
Usage Example
Test Results
All 29 scenario tests pass, including 4 new tests for baseline-only execution.