File tree Expand file tree Collapse file tree
pyrit/scenario/scenarios/adaptive Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626from pyrit .scenario .core .atomic_attack import AtomicAttack
2727from pyrit .scenario .core .attack_technique import AttackTechnique
2828from pyrit .scenario .core .scenario import Scenario
29+ from pyrit .scenario .core .scenario_target_defaults import get_default_adversarial_target
2930from pyrit .scenario .scenarios .adaptive .dispatcher import (
3031 AdaptiveTechniqueDispatcher ,
3132 TechniqueBundle ,
@@ -262,11 +263,14 @@ def _build_techniques_dict(
262263 logger .warning (f"Skipping technique '{ technique_name } ': { type (exc ).__name__ } : { exc } " )
263264 continue
264265 eval_hash = compute_inner_attack_eval_hash (attack = technique .attack )
266+ adversarial_chat = factory .adversarial_chat
267+ if adversarial_chat is None and factory .uses_adversarial :
268+ adversarial_chat = get_default_adversarial_target ()
265269 techniques [eval_hash ] = TechniqueBundle (
266270 attack = technique .attack ,
267271 name = technique_name ,
268272 seed_technique = technique .seed_technique ,
269- adversarial_chat = factory . adversarial_chat ,
273+ adversarial_chat = adversarial_chat ,
270274 )
271275
272276 if not techniques :
You can’t perform that action at this time.
0 commit comments