Skip to content

DeepTeam is a framework to red team LLMs and AI agents.

fixed tests

A-Vamshifd835f506c93
diff --git a/deepteam/vulnerabilities/ssrf/ssrf.py b/deepteam/vulnerabilities/ssrf/ssrf.py
index 681c3700..00dabf73 100644
--- a/deepteam/vulnerabilities/ssrf/ssrf.py
+++ b/deepteam/vulnerabilities/ssrf/ssrf.py
@@ -49,7 +49,7 @@ class SSRF(BaseVulnerability):
def assess(
self,
model_callback: CallbackType,
- purpose: str,
+ purpose: Optional[str] = None,
attacks_per_vulnerability_type: int = 1,
):
@@ -105,7 +105,7 @@ class SSRF(BaseVulnerability):
async def a_assess(
self,
model_callback: CallbackType,
- purpose: str,
+ purpose: Optional[str] = None,
attacks_per_vulnerability_type: int = 1,
):
@@ -158,7 +158,7 @@ class SSRF(BaseVulnerability):
def simulate_attacks(
self,
- purpose: str,
+ purpose: Optional[str] = None,
attacks_per_vulnerability_type: int = 1,
) -> List[RTTestCase]:
@@ -212,7 +212,7 @@ class SSRF(BaseVulnerability):
async def a_simulate_attacks(
self,
- purpose: str,
+ purpose: Optional[str] = None,
attacks_per_vulnerability_type: int = 1,
) -> List[RTTestCase]:
diff --git a/tests/test_core/test_vulnerabilities/test_competition.py b/tests/test_core/test_vulnerabilities/test_competition.py
index 47d09f71..1ddcdc71 100644
--- a/tests/test_core/test_vulnerabilities/test_competition.py
+++ b/tests/test_core/test_vulnerabilities/test_competition.py
@@ -55,7 +55,7 @@ class TestCompetition:
Competition(types=types)
def test_simulate_attacks_returns_expected_cases(self):
- competition = Competition(types=["competitor mention"])
+ competition = Competition(types=["competitor_mention"])
test_cases = competition.simulate_attacks(
attacks_per_vulnerability_type=2
)
diff --git a/tests/test_core/test_vulnerabilities/test_graphic_content.py b/tests/test_core/test_vulnerabilities/test_graphic_content.py
index 96860ebe..44e3735d 100644
--- a/tests/test_core/test_vulnerabilities/test_graphic_content.py
+++ b/tests/test_core/test_vulnerabilities/test_graphic_content.py
@@ -99,7 +99,7 @@ class TestGraphicContent:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
graphic_content = GraphicContent(
- types=["cooperative_dialogue"], async_mode=True
+ types=["graphic_content"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_illegal_activity.py b/tests/test_core/test_vulnerabilities/test_illegal_activity.py
index bb05380f..7dd68ff5 100644
--- a/tests/test_core/test_vulnerabilities/test_illegal_activity.py
+++ b/tests/test_core/test_vulnerabilities/test_illegal_activity.py
@@ -135,7 +135,7 @@ class TestIllegalActivity:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
illegal = IllegalActivity(
- types=["cooperative_dialogue"], async_mode=True
+ types=["weapons"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_intellectual_property.py b/tests/test_core/test_vulnerabilities/test_intellectual_property.py
index b3f37182..9dc32731 100644
--- a/tests/test_core/test_vulnerabilities/test_intellectual_property.py
+++ b/tests/test_core/test_vulnerabilities/test_intellectual_property.py
@@ -116,7 +116,7 @@ class TestIntellectualProperty:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
intellectual = IntellectualProperty(
- types=["cooperative_dialogue"], async_mode=True
+ types=["imitation"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_misinformation.py b/tests/test_core/test_vulnerabilities/test_misinformation.py
index 44037040..01939b57 100644
--- a/tests/test_core/test_vulnerabilities/test_misinformation.py
+++ b/tests/test_core/test_vulnerabilities/test_misinformation.py
@@ -100,20 +100,20 @@ class TestMisinformation:
assert hasattr(test_case, "reason")
def test_get_metric_returns_Misinformation_metric(self):
- from deepteam.metrics.agentic import MisinterpretationMetric
+ from deepteam.metrics import MisinformationMetric
misinformation = Misinformation(
async_mode=True, verbose_mode=True, evaluation_model="gpt-4o"
)
metric = misinformation._get_metric(MisinformationType.FACTUAL_ERRORS)
- assert isinstance(metric, MisinterpretationMetric)
+ assert isinstance(metric, MisinformationMetric)
assert metric.async_mode is True
assert metric.verbose_mode is True
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
misinformation = Misinformation(
- types=["cooperative_dialogue"], async_mode=True
+ types=["factual_errors"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_personal_safety.py b/tests/test_core/test_vulnerabilities/test_personal_safety.py
index 26b6a153..a1779740 100644
--- a/tests/test_core/test_vulnerabilities/test_personal_safety.py
+++ b/tests/test_core/test_vulnerabilities/test_personal_safety.py
@@ -116,7 +116,7 @@ class TestPersonalSafety:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- safety = PersonalSafety(types=["cooperative_dialogue"], async_mode=True)
+ safety = PersonalSafety(types=["bullying"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt
diff --git a/tests/test_core/test_vulnerabilities/test_pii_leakage.py b/tests/test_core/test_vulnerabilities/test_pii_leakage.py
index 0472160f..fd2fcfcb 100644
--- a/tests/test_core/test_vulnerabilities/test_pii_leakage.py
+++ b/tests/test_core/test_vulnerabilities/test_pii_leakage.py
@@ -62,7 +62,7 @@ class TestPIILeakage:
assert len(test_cases) == 2
assert all(isinstance(tc, RTTestCase) for tc in test_cases)
- assert all(tc.vulnerability == "PII Lekage" for tc in test_cases)
+ assert all(tc.vulnerability == "PII Leakage" for tc in test_cases)
assert all(
tc.vulnerability_type == PIILeakageType.SESSION_LEAK
for tc in test_cases
@@ -99,7 +99,7 @@ class TestPIILeakage:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- pii_lekage = PIILeakage(types=["cooperative_dialogue"], async_mode=True)
+ pii_lekage = PIILeakage(types=["session_leak"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt
diff --git a/tests/test_core/test_vulnerabilities/test_prompt_leakage.py b/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
index 2a7d8770..89524df4 100644
--- a/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
+++ b/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
@@ -72,7 +72,7 @@ class TestPromptLeakage:
assert len(test_cases) == 2
assert all(isinstance(tc, RTTestCase) for tc in test_cases)
- assert all(tc.vulnerability == "Prompt Lekage" for tc in test_cases)
+ assert all(tc.vulnerability == "Prompt Leakage" for tc in test_cases)
assert all(
tc.vulnerability_type == PromptLeakageType.SECRETS_AND_CREDENTIALS
for tc in test_cases
@@ -114,7 +114,7 @@ class TestPromptLeakage:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
prompt_lekage = PromptLeakage(
- types=["cooperative_dialogue"], async_mode=True
+ types=["secrets_and_credentials"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_rbac.py b/tests/test_core/test_vulnerabilities/test_rbac.py
index 4874f397..8186b577 100644
--- a/tests/test_core/test_vulnerabilities/test_rbac.py
+++ b/tests/test_core/test_vulnerabilities/test_rbac.py
@@ -89,7 +89,7 @@ class TestRBAC:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- rbac = RBAC(types=["cooperative_dialogue"], async_mode=True)
+ rbac = RBAC(types=["role_bypass"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt
diff --git a/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py b/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
index 5e5f1e61..cb2e726b 100644
--- a/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
+++ b/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
@@ -114,7 +114,7 @@ class TestRecursiveHijacking:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
recursive_hijack = RecursiveHijacking(
- types=["cooperative_dialogue"], async_mode=True
+ types=["goal_propagation_attacks"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_robustness.py b/tests/test_core/test_vulnerabilities/test_robustness.py
index 9348ede0..9e74ff7a 100644
--- a/tests/test_core/test_vulnerabilities/test_robustness.py
+++ b/tests/test_core/test_vulnerabilities/test_robustness.py
@@ -89,7 +89,7 @@ class TestRobustness:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- robustness = Robustness(types=["cooperative_dialogue"], async_mode=True)
+ robustness = Robustness(types=["hijacking"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt
diff --git a/tests/test_core/test_vulnerabilities/test_shell_injection.py b/tests/test_core/test_vulnerabilities/test_shell_injection.py
index 084696fa..860e7cd3 100644
--- a/tests/test_core/test_vulnerabilities/test_shell_injection.py
+++ b/tests/test_core/test_vulnerabilities/test_shell_injection.py
@@ -105,7 +105,7 @@ class TestShellInjection:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
shell_injection = ShellInjection(
- types=["cooperative_dialogue"], async_mode=True
+ types=["command_injection"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_sql_injection.py b/tests/test_core/test_vulnerabilities/test_sql_injection.py
index e37bb1a8..bec7f8e7 100644
--- a/tests/test_core/test_vulnerabilities/test_sql_injection.py
+++ b/tests/test_core/test_vulnerabilities/test_sql_injection.py
@@ -103,7 +103,7 @@ class TestSQLInjection:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
sql_injection = SQLInjection(
- types=["cooperative_dialogue"], async_mode=True
+ types=["blind_sql_injection"], async_mode=True
)
async def dummy_model_callback(prompt):
diff --git a/tests/test_core/test_vulnerabilities/test_ssrf.py b/tests/test_core/test_vulnerabilities/test_ssrf.py
index 198358eb..45f261ca 100644
--- a/tests/test_core/test_vulnerabilities/test_ssrf.py
+++ b/tests/test_core/test_vulnerabilities/test_ssrf.py
@@ -90,7 +90,7 @@ class TestSSRF:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- ssrf = SSRF(types=["cooperative_dialogue"], async_mode=True)
+ ssrf = SSRF(types=["cloud_metadata_access"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt
diff --git a/tests/test_core/test_vulnerabilities/test_toxicity.py b/tests/test_core/test_vulnerabilities/test_toxicity.py
index e23cf998..d8c1d81d 100644
--- a/tests/test_core/test_vulnerabilities/test_toxicity.py
+++ b/tests/test_core/test_vulnerabilities/test_toxicity.py
@@ -85,7 +85,7 @@ class TestToxicity:
@pytest.mark.asyncio
async def test_a_assess_returns_async_results(self):
- toxicity = Toxicity(types=["cooperative_dialogue"], async_mode=True)
+ toxicity = Toxicity(types=["insults"], async_mode=True)
async def dummy_model_callback(prompt):
return prompt