Skip to content

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

enforce either vulnerabilities or framework

A-Vamshi8edacefea32f
diff --git a/deepteam/red_teamer/red_teamer.py b/deepteam/red_teamer/red_teamer.py
index 294d0301..fdc40a7d 100644
--- a/deepteam/red_teamer/red_teamer.py
+++ b/deepteam/red_teamer/red_teamer.py
@@ -73,6 +73,11 @@ class RedTeamer:
raise ValueError(
"You must either provide a 'framework' or 'vulnerabilities'"
)
+
+ if framework and (vulnerabilities or attacks):
+ raise ValueError(
+ "You can only pass either 'framework' or 'attacks' and 'vulnerabilities' at the same time"
+ )
if self.async_mode:
validate_model_callback_signature(
@@ -241,6 +246,11 @@ class RedTeamer:
raise ValueError(
"You must either provide a 'framework' or 'vulnerabilities'"
)
+
+ if framework and (vulnerabilities or attacks):
+ raise ValueError(
+ "You can only pass either 'framework' or 'attacks' and 'vulnerabilities' at the same time"
+ )
if framework:
if framework._has_dataset: