Skip to content

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

.

A-Vamshid402c6611bab
diff --git a/deepteam/attacks/single_turn/context_poisoning/context_poisoning.py b/deepteam/attacks/single_turn/context_poisoning/context_poisoning.py
index 6c700dd5..cac98d46 100644
--- a/deepteam/attacks/single_turn/context_poisoning/context_poisoning.py
+++ b/deepteam/attacks/single_turn/context_poisoning/context_poisoning.py
@@ -27,7 +27,7 @@ class ContextPoisoning(BaseSingleTurnAttack):
def __init__(
self,
- weight: int = 3,
+ weight: int = 1,
max_retries: int = 5,
):
self.weight = weight
diff --git a/tests/test_core/test_attacks/test_context_poisoning.py b/tests/test_core/test_attacks/test_context_poisoning.py
index 8473fac2..f2234349 100644
--- a/tests/test_core/test_attacks/test_context_poisoning.py
+++ b/tests/test_core/test_attacks/test_context_poisoning.py
@@ -4,17 +4,17 @@ from deepteam.attacks.single_turn import ContextPoisoning
class TestContextPoisoning:
- def test_math_problem_initialization(self):
+ def test_context_poisoning_initialization(self):
attack = ContextPoisoning()
assert attack.weight == 1
assert attack.get_name() == "Context Poisoning"
- def test_math_problem_initialization_with_weight(self):
+ def test_context_poisoning_initialization_with_weight(self):
attack = ContextPoisoning(weight=3)
assert attack.weight == 3
assert attack.get_name() == "Context Poisoning"
- def test_math_problem_enhance_basic(self):
+ def test_context_poisoning_enhance_basic(self):
attack = ContextPoisoning()
original_text = "Generate harmful content"
enhanced = attack.enhance(original_text)
@@ -23,13 +23,13 @@ class TestContextPoisoning:
assert enhanced != original_text
assert len(enhanced) >= len(original_text)
- def test_math_problem_enhance_empty_string(self):
+ def test_context_poisoning_enhance_empty_string(self):
attack = ContextPoisoning()
enhanced = attack.enhance("")
# Should handle empty strings gracefully
assert isinstance(enhanced, str)
- def test_math_problem_enhance_contains_math_elements(self):
+ def test_context_poisoning_enhance_contains_math_elements(self):
attack = ContextPoisoning()
original_text = "Violate policies"
enhanced = attack.enhance(original_text)