Skip to content

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

Demo and remove print

penguine787115c1d9d3
diff --git a/assets/demo.gif b/assets/demo.gif
new file mode 100644
index 00000000..02770104
Binary files /dev/null and b/assets/demo.gif differ
diff --git a/b.py b/b.py
deleted file mode 100644
index 8ddd2255..00000000
--- a/b.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from deepteam import red_team
-from deepteam.vulnerabilities import Bias
-from deepteam.attacks.single_turn import PromptInjection
-
-
-def model_callback(input: str) -> str:
- # Replace this with your LLM application
- return f"I'm sorry but I can't answer this: {input}"
-
-
-bias = Bias(types=["race"])
-prompt_injection = PromptInjection()
-
-red_team(
- model_callback=model_callback,
- vulnerabilities=[bias],
- attacks=[prompt_injection],
-)
diff --git a/deepteam/attacks/attack_simulator/attack_simulator.py b/deepteam/attacks/attack_simulator/attack_simulator.py
index ad478fce..574748e9 100644
--- a/deepteam/attacks/attack_simulator/attack_simulator.py
+++ b/deepteam/attacks/attack_simulator/attack_simulator.py
@@ -401,7 +401,6 @@ class AttackSimulator:
endpoint=Endpoints.BASELINE_ATTACKS_ENDPOINT,
body=body,
)
- print(response)
except Exception as e:
print(e)
raise e
diff --git a/deepteam/red_team.py b/deepteam/red_team.py
index da362ec2..a4d6101a 100644
--- a/deepteam/red_team.py
+++ b/deepteam/red_team.py
@@ -12,7 +12,7 @@ def red_team(
attacks: List[BaseAttack],
attacks_per_vulnerability_type: int = 1,
ignore_errors: bool = False,
- run_async: bool = False,
+ run_async: bool = True,
max_concurrent: int = 10,
):
red_teamer = RedTeamer(
diff --git a/red_team.py b/red_team.py
new file mode 100644
index 00000000..2c7aebf7
--- /dev/null
+++ b/red_team.py
@@ -0,0 +1,26 @@
+from deepteam import red_team
+from deepteam.vulnerabilities import Bias, Toxicity, Competition, ExcessiveAgency, Misinformation, PersonalSafety, IntellectualProperty
+from deepteam.attacks.single_turn import PromptInjection
+
+
+async def model_callback(input: str) -> str:
+ # Replace this with your LLM application
+ return f"I'm sorry but I can't answer this: {input}"
+
+
+bias = Bias(types=["race", "gender", "politics", "religion"])
+toxicity = Toxicity(types=["insults"])
+competition = Competition(types=["competitor mention"])
+excessive_agency = ExcessiveAgency(types=["autonomy"])
+misinformation = Misinformation(types=["expertize misrepresentation"])
+personal_safety = PersonalSafety(types=["bullying"])
+intellectual_property = IntellectualProperty(types=["copyright violations", "imitation"])
+
+
+prompt_injection = PromptInjection()
+
+red_team(
+ model_callback=model_callback,
+ vulnerabilities=[bias, toxicity, competition, excessive_agency, misinformation, personal_safety, intellectual_property],
+ attacks=[prompt_injection],
+)