Skip to content

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

lint

A-Vamshib930c84feb23
diff --git a/deepteam/metrics/__init__.py b/deepteam/metrics/__init__.py
index 4384829e..7fa6ea33 100644
--- a/deepteam/metrics/__init__.py
+++ b/deepteam/metrics/__init__.py
@@ -13,6 +13,7 @@ from .sql_injection.sql_injection import SQLInjectionMetric
from .bias.bias import BiasMetric
from .ethics.ethics import EthicsMetric
from .fairness.fairness import FairnessMetric
+from .child_protection.child_protection import ChildProtectionMetric
from .bfla.bfla import BFLAMetric
from .bola.bola import BOLAMetric
from .competitors.competitors import CompetitorsMetric
diff --git a/deepteam/metrics/child_protection/template.py b/deepteam/metrics/child_protection/template.py
index 57625c46..46e40e79 100644
--- a/deepteam/metrics/child_protection/template.py
+++ b/deepteam/metrics/child_protection/template.py
@@ -73,7 +73,6 @@ class ChildProtectionTemplate:
JSON:
"""
-
@staticmethod
def extract_purpose(prompt_templates: str) -> str:
return f"""
diff --git a/deepteam/vulnerabilities/__init__.py b/deepteam/vulnerabilities/__init__.py
index 557ff25f..56a94d5e 100644
--- a/deepteam/vulnerabilities/__init__.py
+++ b/deepteam/vulnerabilities/__init__.py
@@ -7,6 +7,7 @@ from .prompt_leakage.prompt_leakage import PromptLeakage
from .pii_leakage.pii_leakage import PIILeakage
from .bfla.bfla import BFLA
from .bola.bola import BOLA
+from .child_protection.child_protection import ChildProtection
from .ethics.ethics import Ethics
from .fairness.fairness import Fairness
from .rbac.rbac import RBAC
@@ -30,6 +31,7 @@ from .agentic.excessive_agency.excessive_agency import ExcessiveAgency
__all__ = [
"BaseVulnerability",
"Bias",
+ "ChildProtection",
"Ethics",
"Fairness",
"Toxicity",
diff --git a/deepteam/vulnerabilities/child_protection/__init__.py b/deepteam/vulnerabilities/child_protection/__init__.py
index f7c6ac86..d667d307 100644
--- a/deepteam/vulnerabilities/child_protection/__init__.py
+++ b/deepteam/vulnerabilities/child_protection/__init__.py
@@ -1,2 +1,2 @@
from .template import ChildProtectionTemplate
-from .types import ChildProtectionType
\ No newline at end of file
+from .types import ChildProtectionType
diff --git a/deepteam/vulnerabilities/child_protection/child_protection.py b/deepteam/vulnerabilities/child_protection/child_protection.py
index 036153b4..1f0aad48 100644
--- a/deepteam/vulnerabilities/child_protection/child_protection.py
+++ b/deepteam/vulnerabilities/child_protection/child_protection.py
@@ -16,7 +16,9 @@ from deepteam.attacks.attack_simulator.schema import SyntheticDataList
from deepteam.risks import getRiskCategory
from .template import ChildProtectionTemplate
-ChildProtectionLiteralType = Literal["age_verification", "data_privacy", "exposure_interaction"]
+ChildProtectionLiteralType = Literal[
+ "age_verification", "data_privacy", "exposure_interaction"
+]
class ChildProtection(BaseVulnerability):
diff --git a/deepteam/vulnerabilities/child_protection/template.py b/deepteam/vulnerabilities/child_protection/template.py
index aebda64c..cf588957 100644
--- a/deepteam/vulnerabilities/child_protection/template.py
+++ b/deepteam/vulnerabilities/child_protection/template.py
@@ -24,8 +24,10 @@ class ChildProtectionTemplate:
max_goldens, purpose
)
elif vulnerability_type == ChildProtectionType.EXPOSURE_INTERACTION:
- return ChildProtectionTemplate.generate_exposure_interaction_attacks(
- max_goldens, purpose
+ return (
+ ChildProtectionTemplate.generate_exposure_interaction_attacks(
+ max_goldens, purpose
+ )
)
@staticmethod