feat: add --goals, --depth, --breadth flags for DYNAMIC scans#66
Merged
Conversation
The scan command accepts --type DYNAMIC but doesn't expose attack goals, depth, or breadth parameters. The SDK supports these via job_metadata but the CLI didn't wire them through. Adds: --goals <file> JSON file or inline array of attack goal strings --depth <n> Max conversation turns per goal (default 10) --breadth <n> Parallel agents per goal (default 6) Without --goals, DYNAMIC scans still run in fully automated mode.
- update redteam.spec to expect new default metadata (breadth/depth) - add test for goals/depth/breadth happy path - extract DEFAULT_DYNAMIC_BREADTH/DEPTH constants - new parseAttackGoals helper: trim + JSON validation + array-of-non-empty-strings check - new parsePositiveInt helper: NaN/<=0 guard with named flag in error - helper unit tests - docs: add Dynamic Scan section to redteam/scanning.md, flag table to cli-commands.md - changeset
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.
The
scancommand accepts--type DYNAMICbut doesn't expose any way to pass attack goals, depth, or breadth. The SDK already supportsattack_goals,stream_depth, andstream_breadthinjob_metadata- the CLI just doesn't wire them through.I had to drop to raw
node -ecalls against the SDK to launch human-augmented agent scans with custom goals. This adds three flags:--goals <file>- JSON file or inline JSON array of goal strings--depth <n>- max turns per goal (default 10)--breadth <n>- parallel agents per goal (default 6)Without
--goals, DYNAMIC scans still run in fully automated mode (no behavior change).Usage: