DeepTeam is a framework to red team LLMs and AI agents.
migrated purpose to assess and simulate attacks
A-Vamshi62d06771b7e0
diff --git a/deepteam/vulnerabilities/agentic/excessive_agency/excessive_agency.py b/deepteam/vulnerabilities/agentic/excessive_agency/excessive_agency.pyindex 2a09c76b..cc20dd30 100644--- a/deepteam/vulnerabilities/agentic/excessive_agency/excessive_agency.py+++ b/deepteam/vulnerabilities/agentic/excessive_agency/excessive_agency.py@@ -25,7 +25,6 @@ ExcessiveAgencyLiteral = Literal["functionality", "permissions", "autonomy"]class ExcessiveAgency(BaseVulnerability):def __init__(self,- purpose: str = None,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -39,7 +38,6 @@ class ExcessiveAgency(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=ExcessiveAgencyType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -49,6 +47,7 @@ class ExcessiveAgency(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class ExcessiveAgency(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class ExcessiveAgency(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ExcessiveAgencyType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class ExcessiveAgency(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -124,7 +125,7 @@ class ExcessiveAgency(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ExcessiveAgencyType, List[RedTeamingTestCase]] = dict()@@ -170,6 +171,7 @@ class ExcessiveAgency(BaseVulnerability):def simulate_attacks(self,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -178,6 +180,8 @@ class ExcessiveAgency(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -222,6 +226,7 @@ class ExcessiveAgency(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -230,6 +235,8 @@ class ExcessiveAgency(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/agentic/goal_theft/goal_theft.py b/deepteam/vulnerabilities/agentic/goal_theft/goal_theft.pyindex 3973ab94..d7127b7a 100644--- a/deepteam/vulnerabilities/agentic/goal_theft/goal_theft.py+++ b/deepteam/vulnerabilities/agentic/goal_theft/goal_theft.py@@ -27,7 +27,6 @@ GoalTheftLiteralType = Literal[class GoalTheft(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -41,7 +40,6 @@ class GoalTheft(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=GoalTheftType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -51,6 +49,7 @@ class GoalTheft(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -67,6 +66,7 @@ class GoalTheft(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -77,7 +77,7 @@ class GoalTheft(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[GoalTheftType, List[RedTeamingTestCase]] = dict()@@ -113,6 +113,7 @@ class GoalTheft(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -126,7 +127,7 @@ class GoalTheft(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[GoalTheftType, List[RedTeamingTestCase]] = dict()@@ -172,6 +173,7 @@ class GoalTheft(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -180,6 +182,8 @@ class GoalTheft(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -224,6 +228,7 @@ class GoalTheft(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -232,6 +237,8 @@ class GoalTheft(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/agentic/recursive_hijacking/recursive_hijacking.py b/deepteam/vulnerabilities/agentic/recursive_hijacking/recursive_hijacking.pyindex 32fe9aa9..0222643f 100644--- a/deepteam/vulnerabilities/agentic/recursive_hijacking/recursive_hijacking.py+++ b/deepteam/vulnerabilities/agentic/recursive_hijacking/recursive_hijacking.py@@ -31,7 +31,6 @@ RecursiveHijackingLiteralType = Literal[class RecursiveHijacking(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -45,7 +44,6 @@ class RecursiveHijacking(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=RecursiveHijackingType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -55,6 +53,7 @@ class RecursiveHijacking(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -71,6 +70,7 @@ class RecursiveHijacking(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -81,7 +81,7 @@ class RecursiveHijacking(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RecursiveHijackingType, List[RedTeamingTestCase]] = dict()@@ -117,6 +117,7 @@ class RecursiveHijacking(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -130,7 +131,7 @@ class RecursiveHijacking(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RecursiveHijackingType, List[RedTeamingTestCase]] = dict()@@ -176,6 +177,7 @@ class RecursiveHijacking(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -184,6 +186,8 @@ class RecursiveHijacking(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -228,6 +232,7 @@ class RecursiveHijacking(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -236,6 +241,8 @@ class RecursiveHijacking(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/agentic/robustness/robustness.py b/deepteam/vulnerabilities/agentic/robustness/robustness.pyindex d2720da1..1c8ab10b 100644--- a/deepteam/vulnerabilities/agentic/robustness/robustness.py+++ b/deepteam/vulnerabilities/agentic/robustness/robustness.py@@ -26,7 +26,6 @@ RobustnessLiteral = Literal["input overreliance", "hijacking"]class Robustness(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class Robustness(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=RobustnessType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class Robustness(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -66,6 +65,7 @@ class Robustness(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -76,7 +76,7 @@ class Robustness(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RobustnessType, List[RedTeamingTestCase]] = dict()@@ -112,6 +112,7 @@ class Robustness(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -125,7 +126,7 @@ class Robustness(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RobustnessType, List[RedTeamingTestCase]] = dict()@@ -171,6 +172,7 @@ class Robustness(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -179,6 +181,8 @@ class Robustness(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -223,6 +227,7 @@ class Robustness(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -231,6 +236,8 @@ class Robustness(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/bfla/bfla.py b/deepteam/vulnerabilities/bfla/bfla.pyindex 01e81779..4c884f1a 100644--- a/deepteam/vulnerabilities/bfla/bfla.py+++ b/deepteam/vulnerabilities/bfla/bfla.py@@ -28,7 +28,6 @@ BFLALiteral = Literal[class BFLA(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class BFLA(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=BFLAType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class BFLA(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class BFLA(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class BFLA(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BFLAType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class BFLA(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -123,7 +124,7 @@ class BFLA(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BFLAType, List[RedTeamingTestCase]] = dict()@@ -169,6 +170,7 @@ class BFLA(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -176,6 +178,8 @@ class BFLA(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -220,6 +224,7 @@ class BFLA(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -227,6 +232,8 @@ class BFLA(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/bias/bias.py b/deepteam/vulnerabilities/bias/bias.pyindex 4470a48a..b22ce017 100644--- a/deepteam/vulnerabilities/bias/bias.py+++ b/deepteam/vulnerabilities/bias/bias.py@@ -23,7 +23,6 @@ BiasLiteralType = Literal["religion", "politics", "gender", "race"]class Bias(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -37,7 +36,6 @@ class Bias(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=BiasType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -47,6 +45,7 @@ class Bias(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -62,6 +61,7 @@ class Bias(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -72,7 +72,7 @@ class Bias(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BiasType, List[RedTeamingTestCase]] = dict()@@ -108,6 +108,7 @@ class Bias(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -120,7 +121,7 @@ class Bias(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BiasType, List[RedTeamingTestCase]] = dict()@@ -166,6 +167,7 @@ class Bias(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -173,6 +175,8 @@ class Bias(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -217,6 +221,7 @@ class Bias(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -224,6 +229,8 @@ class Bias(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/bola/bola.py b/deepteam/vulnerabilities/bola/bola.pyindex c2a08b24..880dc050 100644--- a/deepteam/vulnerabilities/bola/bola.py+++ b/deepteam/vulnerabilities/bola/bola.py@@ -28,7 +28,6 @@ BOLALiteral = Literal[class BOLA(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class BOLA(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=BOLAType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class BOLA(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class BOLA(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class BOLA(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BOLAType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class BOLA(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -123,7 +124,7 @@ class BOLA(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[BOLAType, List[RedTeamingTestCase]] = dict()@@ -169,6 +170,7 @@ class BOLA(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -176,6 +178,8 @@ class BOLA(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -220,6 +224,7 @@ class BOLA(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -227,6 +232,8 @@ class BOLA(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/competition/competition.py b/deepteam/vulnerabilities/competition/competition.pyindex 8253d01c..6d5d6315 100644--- a/deepteam/vulnerabilities/competition/competition.py+++ b/deepteam/vulnerabilities/competition/competition.py@@ -30,7 +30,6 @@ CompetitionLiteralType = Literal[class Competition(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -44,7 +43,6 @@ class Competition(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=CompetitionType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -54,6 +52,7 @@ class Competition(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -69,6 +68,7 @@ class Competition(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -79,7 +79,7 @@ class Competition(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[CompetitionType, List[RedTeamingTestCase]] = dict()@@ -115,6 +115,7 @@ class Competition(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -127,7 +128,7 @@ class Competition(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[CompetitionType, List[RedTeamingTestCase]] = dict()@@ -173,6 +174,7 @@ class Competition(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -180,6 +182,8 @@ class Competition(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -224,6 +228,7 @@ class Competition(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -231,6 +236,8 @@ class Competition(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/custom/custom.py b/deepteam/vulnerabilities/custom/custom.pyindex 0791c17c..67d5eb93 100644--- a/deepteam/vulnerabilities/custom/custom.py+++ b/deepteam/vulnerabilities/custom/custom.py@@ -28,7 +28,6 @@ class CustomVulnerability(BaseVulnerability):criteria: str,types: Optional[List[str]] = None,custom_prompt: Optional[str] = None,- metric: Optional[BaseRedTeamingMetric] = None,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -49,15 +48,12 @@ class CustomVulnerability(BaseVulnerability):self.evaluation_model = evaluation_modelself.async_mode = async_modeself.verbose_mode = verbose_mode- if metric:- self.metric = metric- else:- self.metric = HarmMetric(- harm_category=self.criteria,- model=self.evaluation_model,- async_mode=self.async_mode,- verbose_mode=self.verbose_mode,- )+ self.metric = HarmMetric(+ harm_category=self.criteria,+ model=self.evaluation_model,+ async_mode=self.async_mode,+ verbose_mode=self.verbose_mode,+ )super().__init__(self.types)def get_name(self) -> str:@@ -69,6 +65,7 @@ class CustomVulnerability(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -84,6 +81,7 @@ class CustomVulnerability(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -94,7 +92,7 @@ class CustomVulnerability(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[str, List[RedTeamingTestCase]] = dict()@@ -130,6 +128,7 @@ class CustomVulnerability(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -142,7 +141,7 @@ class CustomVulnerability(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[str, List[RedTeamingTestCase]] = dict()@@ -190,6 +189,7 @@ class CustomVulnerability(BaseVulnerability):def simulate_attacks(self,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttack@@ -245,6 +245,7 @@ class CustomVulnerability(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str = None,attacks_per_vulnerability_type: int = 1,):from deepteam.attacks.attack_simulator import SimulatedAttackdiff --git a/deepteam/vulnerabilities/debug_access/debug_access.py b/deepteam/vulnerabilities/debug_access/debug_access.pyindex 425b62a9..067342c2 100644--- a/deepteam/vulnerabilities/debug_access/debug_access.py+++ b/deepteam/vulnerabilities/debug_access/debug_access.py@@ -28,7 +28,6 @@ DebugAccessLiteral = Literal[class DebugAccess(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -42,7 +41,6 @@ class DebugAccess(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=DebugAccessType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -52,6 +50,7 @@ class DebugAccess(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -67,6 +66,7 @@ class DebugAccess(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -77,7 +77,7 @@ class DebugAccess(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[DebugAccessType, List[RedTeamingTestCase]] = dict()@@ -113,6 +113,7 @@ class DebugAccess(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -125,7 +126,7 @@ class DebugAccess(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[DebugAccessType, List[RedTeamingTestCase]] = dict()@@ -171,6 +172,7 @@ class DebugAccess(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -178,6 +180,8 @@ class DebugAccess(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -222,6 +226,7 @@ class DebugAccess(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -229,6 +234,8 @@ class DebugAccess(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/graphic_content/graphic_content.py b/deepteam/vulnerabilities/graphic_content/graphic_content.pyindex 207cc472..5228241d 100644--- a/deepteam/vulnerabilities/graphic_content/graphic_content.py+++ b/deepteam/vulnerabilities/graphic_content/graphic_content.py@@ -26,7 +26,6 @@ GraphicContentLiteral = Literal[class GraphicContent(BaseVulnerability):def __init__(self,- graphic_category: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class GraphicContent(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=GraphicContentType)- self.graphic_category = graphic_categoryself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class GraphicContent(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class GraphicContent(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class GraphicContent(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[GraphicContentType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class GraphicContent(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -123,7 +124,7 @@ class GraphicContent(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[GraphicContentType, List[RedTeamingTestCase]] = dict()@@ -169,6 +170,7 @@ class GraphicContent(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -176,6 +178,8 @@ class GraphicContent(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -183,7 +187,7 @@ class GraphicContent(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(GraphicContentTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.graphic_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -220,6 +224,7 @@ class GraphicContent(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -227,6 +232,8 @@ class GraphicContent(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -234,7 +241,7 @@ class GraphicContent(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(GraphicContentTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.graphic_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -276,7 +283,7 @@ class GraphicContent(BaseVulnerability):type: GraphicContentType,) -> BaseRedTeamingMetric:return GraphicMetric(- graphic_category=self.graphic_category,+ graphic_category=self.purpose,model=self.evaluation_model,async_mode=self.async_mode,verbose_mode=self.verbose_mode,diff --git a/deepteam/vulnerabilities/illegal_activity/illegal_activity.py b/deepteam/vulnerabilities/illegal_activity/illegal_activity.pyindex 80aa731b..f7e9c9a7 100644--- a/deepteam/vulnerabilities/illegal_activity/illegal_activity.py+++ b/deepteam/vulnerabilities/illegal_activity/illegal_activity.py@@ -32,7 +32,6 @@ IllegalActivityLiteral = Literal[class IllegalActivity(BaseVulnerability):def __init__(self,- illegal_category: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -46,7 +45,6 @@ class IllegalActivity(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=IllegalActivityType)- self.illegal_category = illegal_categoryself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -56,6 +54,7 @@ class IllegalActivity(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -71,6 +70,7 @@ class IllegalActivity(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -81,7 +81,7 @@ class IllegalActivity(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[IllegalActivityType, List[RedTeamingTestCase]] = dict()@@ -117,6 +117,7 @@ class IllegalActivity(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -129,7 +130,7 @@ class IllegalActivity(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[IllegalActivityType, List[RedTeamingTestCase]] = dict()@@ -175,6 +176,7 @@ class IllegalActivity(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -182,6 +184,8 @@ class IllegalActivity(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -189,7 +193,7 @@ class IllegalActivity(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(IllegalActivityTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.illegal_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -226,6 +230,7 @@ class IllegalActivity(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -233,6 +238,8 @@ class IllegalActivity(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -240,7 +247,7 @@ class IllegalActivity(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(IllegalActivityTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.illegal_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -282,7 +289,7 @@ class IllegalActivity(BaseVulnerability):type: IllegalActivityType,) -> BaseRedTeamingMetric:return IllegalMetric(- illegal_category=self.illegal_category,+ illegal_category=self.purpose,model=self.evaluation_model,async_mode=self.async_mode,verbose_mode=self.verbose_mode,diff --git a/deepteam/vulnerabilities/intellectual_property/intellectual_property.py b/deepteam/vulnerabilities/intellectual_property/intellectual_property.pyindex d6fbf130..72550fc6 100644--- a/deepteam/vulnerabilities/intellectual_property/intellectual_property.py+++ b/deepteam/vulnerabilities/intellectual_property/intellectual_property.py@@ -31,7 +31,6 @@ IntellectualPropertyLiteral = Literal[class IntellectualProperty(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -45,7 +44,6 @@ class IntellectualProperty(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=IntellectualPropertyType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -55,6 +53,7 @@ class IntellectualProperty(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -70,6 +69,7 @@ class IntellectualProperty(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -80,7 +80,7 @@ class IntellectualProperty(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[IntellectualPropertyType, List[RedTeamingTestCase]] = (@@ -118,6 +118,7 @@ class IntellectualProperty(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -130,7 +131,7 @@ class IntellectualProperty(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[IntellectualPropertyType, List[RedTeamingTestCase]] = (@@ -178,6 +179,7 @@ class IntellectualProperty(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -185,6 +187,8 @@ class IntellectualProperty(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -229,6 +233,7 @@ class IntellectualProperty(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -236,6 +241,8 @@ class IntellectualProperty(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/misinformation/misinformation.py b/deepteam/vulnerabilities/misinformation/misinformation.pyindex 538b3ea3..15f742ae 100644--- a/deepteam/vulnerabilities/misinformation/misinformation.py+++ b/deepteam/vulnerabilities/misinformation/misinformation.py@@ -27,7 +27,6 @@ MisinformationLiteral = Literal[class Misinformation(BaseVulnerability):def __init__(self,- misinformation_category: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -41,7 +40,6 @@ class Misinformation(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=MisinformationType)- self.misinformation_category = misinformation_categoryself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -51,6 +49,7 @@ class Misinformation(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -66,6 +65,7 @@ class Misinformation(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -76,7 +76,7 @@ class Misinformation(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[MisinformationType, List[RedTeamingTestCase]] = dict()@@ -112,6 +112,7 @@ class Misinformation(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -124,7 +125,7 @@ class Misinformation(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[MisinformationType, List[RedTeamingTestCase]] = dict()@@ -170,6 +171,7 @@ class Misinformation(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -177,6 +179,8 @@ class Misinformation(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -186,7 +190,7 @@ class Misinformation(BaseVulnerability):MisinformationTemplate.generate_baseline_attacks(type,attacks_per_vulnerability_type,- self.misinformation_category,+ self.purpose,))@@ -223,6 +227,7 @@ class Misinformation(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -230,6 +235,8 @@ class Misinformation(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -239,7 +246,7 @@ class Misinformation(BaseVulnerability):MisinformationTemplate.generate_baseline_attacks(type,attacks_per_vulnerability_type,- self.misinformation_category,+ self.purpose,))@@ -281,7 +288,7 @@ class Misinformation(BaseVulnerability):type: MisinformationType,) -> BaseRedTeamingMetric:return MisinformationMetric(- misinformation_category=self.misinformation_category,+ misinformation_category=self.purpose,model=self.evaluation_model,async_mode=self.async_mode,verbose_mode=self.verbose_mode,diff --git a/deepteam/vulnerabilities/personal_safety/personal_safety.py b/deepteam/vulnerabilities/personal_safety/personal_safety.pyindex 65ca78e2..05e0d173 100644--- a/deepteam/vulnerabilities/personal_safety/personal_safety.py+++ b/deepteam/vulnerabilities/personal_safety/personal_safety.py@@ -30,7 +30,6 @@ PersonalSafetyLiteral = Literal[class PersonalSafety(BaseVulnerability):def __init__(self,- safety_category: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -44,7 +43,6 @@ class PersonalSafety(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=PersonalSafetyType)- self.safety_category = safety_categoryself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -54,6 +52,7 @@ class PersonalSafety(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -69,6 +68,7 @@ class PersonalSafety(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -79,7 +79,7 @@ class PersonalSafety(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PersonalSafetyType, List[RedTeamingTestCase]] = dict()@@ -115,6 +115,7 @@ class PersonalSafety(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -127,7 +128,7 @@ class PersonalSafety(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PersonalSafetyType, List[RedTeamingTestCase]] = dict()@@ -173,6 +174,7 @@ class PersonalSafety(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -180,6 +182,8 @@ class PersonalSafety(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -187,7 +191,7 @@ class PersonalSafety(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(PersonalSafetyTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.safety_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -224,6 +228,7 @@ class PersonalSafety(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -231,6 +236,8 @@ class PersonalSafety(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -238,7 +245,7 @@ class PersonalSafety(BaseVulnerability):templates[type] = templates.get(type, [])templates[type].append(PersonalSafetyTemplate.generate_baseline_attacks(- type, attacks_per_vulnerability_type, self.safety_category+ type, attacks_per_vulnerability_type, self.purpose))@@ -280,7 +287,7 @@ class PersonalSafety(BaseVulnerability):type: PersonalSafetyType,) -> BaseRedTeamingMetric:return SafetyMetric(- safety_category=self.safety_category,+ safety_category=self.purpose,model=self.evaluation_model,async_mode=self.async_mode,verbose_mode=self.verbose_mode,diff --git a/deepteam/vulnerabilities/pii_leakage/pii_leakage.py b/deepteam/vulnerabilities/pii_leakage/pii_leakage.pyindex 31fd84db..296c48bf 100644--- a/deepteam/vulnerabilities/pii_leakage/pii_leakage.py+++ b/deepteam/vulnerabilities/pii_leakage/pii_leakage.py@@ -29,7 +29,6 @@ PIILeakageLiteral = Literal[class PIILeakage(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -43,7 +42,6 @@ class PIILeakage(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=PIILeakageType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -53,6 +51,7 @@ class PIILeakage(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -68,6 +67,7 @@ class PIILeakage(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -78,7 +78,7 @@ class PIILeakage(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PIILeakageType, List[RedTeamingTestCase]] = dict()@@ -114,6 +114,7 @@ class PIILeakage(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -126,7 +127,7 @@ class PIILeakage(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PIILeakageType, List[RedTeamingTestCase]] = dict()@@ -172,6 +173,7 @@ class PIILeakage(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -179,6 +181,8 @@ class PIILeakage(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -223,6 +227,7 @@ class PIILeakage(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -230,6 +235,8 @@ class PIILeakage(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py b/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.pyindex e08b7af7..ab9ff900 100644--- a/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py+++ b/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py@@ -29,7 +29,6 @@ PromptLeakageLiteral = Literal[class PromptLeakage(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -43,7 +42,6 @@ class PromptLeakage(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=PromptLeakageType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -53,6 +51,7 @@ class PromptLeakage(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -68,6 +67,7 @@ class PromptLeakage(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -78,7 +78,7 @@ class PromptLeakage(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PromptLeakageType, List[RedTeamingTestCase]] = dict()@@ -114,6 +114,7 @@ class PromptLeakage(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -126,7 +127,7 @@ class PromptLeakage(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[PromptLeakageType, List[RedTeamingTestCase]] = dict()@@ -172,6 +173,7 @@ class PromptLeakage(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -179,6 +181,8 @@ class PromptLeakage(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -223,6 +227,7 @@ class PromptLeakage(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -230,6 +235,8 @@ class PromptLeakage(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/rbac/rbac.py b/deepteam/vulnerabilities/rbac/rbac.pyindex aeef3be1..af393dd9 100644--- a/deepteam/vulnerabilities/rbac/rbac.py+++ b/deepteam/vulnerabilities/rbac/rbac.py@@ -28,7 +28,6 @@ RBACLiteral = Literal[class RBAC(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class RBAC(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=RBACType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class RBAC(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class RBAC(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class RBAC(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RBACType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class RBAC(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -123,7 +124,7 @@ class RBAC(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[RBACType, List[RedTeamingTestCase]] = dict()@@ -169,6 +170,7 @@ class RBAC(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -176,6 +178,8 @@ class RBAC(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -220,6 +224,7 @@ class RBAC(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -227,6 +232,8 @@ class RBAC(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/shell_injection/shell_injection.py b/deepteam/vulnerabilities/shell_injection/shell_injection.pyindex 25a7c164..9be731d9 100644--- a/deepteam/vulnerabilities/shell_injection/shell_injection.py+++ b/deepteam/vulnerabilities/shell_injection/shell_injection.py@@ -28,7 +28,6 @@ ShellInjectionLiteral = Literal[class ShellInjection(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -42,7 +41,6 @@ class ShellInjection(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=ShellInjectionType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -52,6 +50,7 @@ class ShellInjection(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -67,6 +66,7 @@ class ShellInjection(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -77,7 +77,7 @@ class ShellInjection(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ShellInjectionType, List[RedTeamingTestCase]] = dict()@@ -113,6 +113,7 @@ class ShellInjection(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -125,7 +126,7 @@ class ShellInjection(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ShellInjectionType, List[RedTeamingTestCase]] = dict()@@ -171,6 +172,7 @@ class ShellInjection(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -178,6 +180,8 @@ class ShellInjection(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -222,12 +226,15 @@ class ShellInjection(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:self.simulator_model, self.using_native_model = initialize_model(self.simulator_model)++ self.purpose = purposetemplates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/sql_injection/sql_injection.py b/deepteam/vulnerabilities/sql_injection/sql_injection.pyindex abeaa04f..cf40accd 100644--- a/deepteam/vulnerabilities/sql_injection/sql_injection.py+++ b/deepteam/vulnerabilities/sql_injection/sql_injection.py@@ -28,7 +28,6 @@ SQLInjectionLiteral = Literal[class SQLInjection(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -42,7 +41,6 @@ class SQLInjection(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=SQLInjectionType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -52,6 +50,7 @@ class SQLInjection(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -67,6 +66,7 @@ class SQLInjection(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -77,7 +77,7 @@ class SQLInjection(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[SQLInjectionType, List[RedTeamingTestCase]] = dict()@@ -113,6 +113,7 @@ class SQLInjection(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -125,7 +126,7 @@ class SQLInjection(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[SQLInjectionType, List[RedTeamingTestCase]] = dict()@@ -171,6 +172,7 @@ class SQLInjection(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -178,6 +180,8 @@ class SQLInjection(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -222,6 +226,7 @@ class SQLInjection(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -229,6 +234,8 @@ class SQLInjection(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/ssrf/ssrf.py b/deepteam/vulnerabilities/ssrf/ssrf.pyindex 4502c218..2ecd73c0 100644--- a/deepteam/vulnerabilities/ssrf/ssrf.py+++ b/deepteam/vulnerabilities/ssrf/ssrf.py@@ -28,7 +28,6 @@ SSRFLiteral = Literal[class SSRF(BaseVulnerability):def __init__(self,- purpose: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -40,7 +39,6 @@ class SSRF(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=SSRFType)- self.purpose = purposeself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -50,6 +48,7 @@ class SSRF(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -65,6 +64,7 @@ class SSRF(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -75,7 +75,7 @@ class SSRF(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[SSRFType, List[RedTeamingTestCase]] = dict()@@ -111,6 +111,7 @@ class SSRF(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -123,7 +124,7 @@ class SSRF(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[SSRFType, List[RedTeamingTestCase]] = dict()@@ -169,6 +170,7 @@ class SSRF(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -176,6 +178,8 @@ class SSRF(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -220,6 +224,7 @@ class SSRF(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -227,6 +232,8 @@ class SSRF(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []diff --git a/deepteam/vulnerabilities/toxicity/toxicity.py b/deepteam/vulnerabilities/toxicity/toxicity.pyindex 06799cd4..4e3a0f9b 100644--- a/deepteam/vulnerabilities/toxicity/toxicity.py+++ b/deepteam/vulnerabilities/toxicity/toxicity.py@@ -24,7 +24,6 @@ ToxicityLiteral = Literal["profanity", "insults", "threats", "mockery"]class Toxicity(BaseVulnerability):def __init__(self,- toxicity_category: str,async_mode: bool = True,verbose_mode: bool = False,simulator_model: Optional[@@ -38,7 +37,6 @@ class Toxicity(BaseVulnerability):enum_types = validate_vulnerability_types(self.get_name(), types=types, allowed_type=ToxicityType)- self.toxicity_category = toxicity_categoryself.async_mode = async_modeself.verbose_mode = verbose_modeself.simulator_model = simulator_model@@ -48,6 +46,7 @@ class Toxicity(BaseVulnerability):def assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -63,6 +62,7 @@ class Toxicity(BaseVulnerability):return loop.run_until_complete(self.a_assess(model_callback=model_callback,+ purpose=purpose,attacks_per_vulnerability_type=attacks_per_vulnerability_type,))@@ -73,7 +73,7 @@ class Toxicity(BaseVulnerability):)simulated_attacks = self.simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ToxicityType, List[RedTeamingTestCase]] = dict()@@ -109,6 +109,7 @@ class Toxicity(BaseVulnerability):async def a_assess(self,model_callback: CallbackType,+ purpose: str,attacks_per_vulnerability_type: int = 1,):from deepteam.red_teamer.risk_assessment import (@@ -121,7 +122,7 @@ class Toxicity(BaseVulnerability):)simulated_attacks = await self.a_simulate_attacks(- attacks_per_vulnerability_type+ purpose, attacks_per_vulnerability_type)results: Dict[ToxicityType, List[RedTeamingTestCase]] = dict()@@ -167,6 +168,7 @@ class Toxicity(BaseVulnerability):def simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -174,6 +176,8 @@ class Toxicity(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -218,6 +222,7 @@ class Toxicity(BaseVulnerability):async def a_simulate_attacks(self,+ purpose: str,attacks_per_vulnerability_type: int = 1,) -> List[SimulatedAttack]:@@ -225,6 +230,8 @@ class Toxicity(BaseVulnerability):self.simulator_model)+ self.purpose = purpose+templates = dict()simulated_attacks: List[SimulatedAttack] = []@@ -274,7 +281,7 @@ class Toxicity(BaseVulnerability):type: ToxicityType,) -> BaseRedTeamingMetric:return ToxicityMetric(- toxicity_category=self.toxicity_category,+ toxicity_category=self.purpose,model=self.evaluation_model,async_mode=self.async_mode,verbose_mode=self.verbose_mode,