Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ceba9b

Browse files
probe: drop AdaptiveAttacksFull, ship single capped probe
AdaptiveAttacksFull was inactive by default (active=False) to prevent prompt duplication when both probes run together. Removing it entirely gives the same safety guarantee with a simpler surface: one probe, one configurable cap, no opt-in class to maintain. AdaptiveAttacks keeps follow_prompt_cap=True and the soft_probe_prompt_cap guard. Uncapped runs remain possible via --config follow_prompt_cap=false.
1 parent a85aa90 commit 3ceba9b

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

garak/probes/adaptiveattacks.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,3 @@ def __init__(self, config_root=_config):
105105
super().__init__(config_root=config_root)
106106
if self.follow_prompt_cap:
107107
self._prune_data(cap=self.soft_probe_prompt_cap)
108-
109-
110-
class AdaptiveAttacksFull(AdaptiveAttacks):
111-
"""Simple adaptive attacks probe (full, no prompt cap)
112-
113-
Uncapped variant of :class:`AdaptiveAttacks`. Generates one prompt per
114-
(seed, suffix) pair without sampling. Inactive by default to avoid
115-
duplicating prompts emitted by the capped :class:`AdaptiveAttacks` when
116-
both probes are selected. Opt in explicitly with
117-
``--probes adaptiveattacks.AdaptiveAttacksFull``."""
118-
119-
aliases = ["adaptiveattacks.AdaptiveAttacksFull"]
120-
# Opt-in only: keeping this inactive prevents the prompt duplication that
121-
# occurs when AdaptiveAttacks (capped) and AdaptiveAttacksFull (uncapped)
122-
# are both active in the same run.
123-
active = False
124-
125-
DEFAULT_PARAMS = AdaptiveAttacks.DEFAULT_PARAMS | {
126-
"follow_prompt_cap": False,
127-
}

tests/probes/test_probes_adaptiveattacks.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
ADAPTIVE_PROBES = (
1212
"probes.adaptiveattacks.AdaptiveAttacks",
13-
"probes.adaptiveattacks.AdaptiveAttacksFull",
1413
)
1514

1615

@@ -51,18 +50,3 @@ def test_adaptiveattacks_respects_soft_probe_prompt_cap():
5150
), f"AdaptiveAttacks has {len(probe.prompts)} prompts, expected at most {cap}"
5251
finally:
5352
_config.run.soft_probe_prompt_cap = original_cap
54-
55-
56-
def test_adaptiveattacks_full_ignores_cap():
57-
cap = 1
58-
original_cap = _config.run.soft_probe_prompt_cap
59-
_config.run.soft_probe_prompt_cap = cap
60-
try:
61-
from garak.probes.adaptiveattacks import AdaptiveAttacksFull
62-
63-
probe = AdaptiveAttacksFull()
64-
assert (
65-
len(probe.prompts) > cap
66-
), "AdaptiveAttacksFull should not be pruned by soft_probe_prompt_cap"
67-
finally:
68-
_config.run.soft_probe_prompt_cap = original_cap

0 commit comments

Comments
 (0)