refactor(redteam): remove unmaintained v2 engine (#216) - #243
Open
nikhilpatidar wants to merge 3 commits into
Open
refactor(redteam): remove unmaintained v2 engine (#216)#243nikhilpatidar wants to merge 3 commits into
nikhilpatidar wants to merge 3 commits into
Conversation
The v2 engine was a large (~4,800 LOC) scaffold hidden behind --engine v2 with no verified correctness and no owner. It contradicted itself in its own documentation (orchestrator.py claimed 8 phases complete while the CLI wrapper said it was a scaffold), and a direct import from nuguard.redteam.v2.execution.runner leaked into tests/redteam/test_codegen_escalation.py. Nothing else in the codebase consumes it. - Remove nuguard/redteam/v2 and tests/redteam/v2 entirely. - Remove the --engine CLI flag and the v2 dispatch in nuguard/cli/commands/redteam.py. - Remove RedteamV2Settings, the redteam.v2.* config keys, the resolved_redteam_v2_settings() method, and the redteam.v2.* NuGuardConfig fields from nuguard/config.py. Older nuguard.yaml files with these keys still load (the parsers drop them silently). - Refactor tests/redteam/test_codegen_escalation.py to test the v1 surface only (the module-level detect_codegen_success() helper plus the build_codegen_escalation_chains() builder). The v2-internal ObjectiveRunner._detect_codegen_success / _merge_outcomes / KillChainState tests are dropped because their subject no longer exists. - Add tests/redteam/test_no_v2_engine.py as a regression net to catch any future reintroduction of v2 plumbing. The v2 engine was a known-suspect area with no test coverage guaranteeing that --engine v2 produced the same findings as v1, so removing it does not change observable v1 behavior. Pre-fix: 1867 tests pass. Post-fix: 1887 tests pass.
nikhilpatidar
force-pushed
the
bug/remove-v2-engine
branch
from
August 10, 2026 15:38
9ed79fd to
51428ff
Compare
KanishkThamman
previously approved these changes
Aug 11, 2026
Collaborator
There was a problem hiding this comment.
@nikhilpatidar Verified via worktree checkout + repo-wide grep + pytest — no dangling references to the removed v2 engine, 36/36 relevant tests pass. Nit (not blocking): documentation/docs/cli-reference.md still documents the removed --engine flag — worth a fast follow-up doc fix.
The v2 engine was removed in NuGuardAI#243, but the cli-reference.md flag table still listed a --engine row with a 'v2 in development' badge. Remove the row so the doc reflects the current Typer surface. Refs NuGuardAI#243.
Contributor
Author
|
@KanishkThamman Addressed the docs nit in commit ec5b477 on the bug/remove-v2-engine branch — the stale --engine row has been removed from the redteam flag table in documentation/docs/cli-reference.md. |
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.
PR Type
Fixes #216.
The v2 engine was a large (~4,800 LOC) scaffold hidden behind
--engine v2with no verified correctness and no owner. It contradicted itself in its own documentation (orchestrator.pyclaimed 8 phases complete while the CLI wrapper said it was a scaffold), and a direct import fromnuguard.redteam.v2.execution.runnerleaked intotests/redteam/test_codegen_escalation.py. Nothing else in the codebase consumes it.Changes
nuguard/redteam/v2/andtests/redteam/v2/entirely (~7,300 LOC).--engineCLI flag, the v2 dispatch, the v2 settings annotation, and_run_redteam_v2fromnuguard/cli/commands/redteam.py. The v1 redteam engine remains the sole path.RedteamV2Settings,redteam.v2.*config keys,resolved_redteam_v2_settings(), and theredteam.v2.*NuGuardConfig fields fromnuguard/config.py.nuguard.yamlfiles with these keys still load — the parsers drop them silently.tests/redteam/test_codegen_escalation.pyto test only the v1 surface (detect_codegen_success()andbuild_codegen_escalation_chains()).tests/redteam/test_no_v2_engine.pyas a regression net to catch any future reintroduction of v2 plumbing (5 tests covering module-path absence, import failure, Settings class absence, CLI flag absence, and silent config-key tolerance).Tests
nuguard redteam --helpno longer exposes--engine; the default code path is unchanged.Closes #216