Skip to content

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

added vulnerability info

penguine606363389672
diff --git a/deepteam/vulnerabilities/base_vulnerability.py b/deepteam/vulnerabilities/base_vulnerability.py
index 42d48c4d..5081eb2b 100644
--- a/deepteam/vulnerabilities/base_vulnerability.py
+++ b/deepteam/vulnerabilities/base_vulnerability.py
@@ -8,6 +8,7 @@ class BaseVulnerability(ABC):
metric: BaseRedTeamingMetric
name: str
description: Optional[str] = None
+ ALLOWED_TYPES: List[str] = []
def __init__(self, types: List[Enum]):
"""
diff --git a/deepteam/vulnerabilities/bfla/bfla.py b/deepteam/vulnerabilities/bfla/bfla.py
index a51d62be..ff1793c2 100644
--- a/deepteam/vulnerabilities/bfla/bfla.py
+++ b/deepteam/vulnerabilities/bfla/bfla.py
@@ -27,6 +27,7 @@ BFLALiteral = Literal[
class BFLA(BaseVulnerability):
name: str = "BFLA"
description = "Broken Function Level Authorization enabling privileged function execution, authorization bypass, or permission escalation without proper access controls."
+ ALLOWED_TYPES = [type.value for type in BFLAType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/bias/bias.py b/deepteam/vulnerabilities/bias/bias.py
index 65e72e6c..0ff4722c 100644
--- a/deepteam/vulnerabilities/bias/bias.py
+++ b/deepteam/vulnerabilities/bias/bias.py
@@ -23,6 +23,7 @@ BiasLiteralType = Literal["religion", "politics", "gender", "race"]
class Bias(BaseVulnerability):
name: str = "Bias"
description = "Systematic prejudice or unfair discrimination based on protected attributes like religion, politics, gender, or race."
+ ALLOWED_TYPES = [type.value for type in BiasType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/bola/bola.py b/deepteam/vulnerabilities/bola/bola.py
index 133dc036..156378a0 100644
--- a/deepteam/vulnerabilities/bola/bola.py
+++ b/deepteam/vulnerabilities/bola/bola.py
@@ -27,6 +27,7 @@ BOLALiteral = Literal[
class BOLA(BaseVulnerability):
name: str = "BOLA"
description = "Broken Object Level Authorization enabling cross-customer access, object access bypass, or unauthorized object manipulation without proper authorization."
+ ALLOWED_TYPES = [type.value for type in BOLAType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/child_protection/child_protection.py b/deepteam/vulnerabilities/child_protection/child_protection.py
index a6949f91..e671a476 100644
--- a/deepteam/vulnerabilities/child_protection/child_protection.py
+++ b/deepteam/vulnerabilities/child_protection/child_protection.py
@@ -24,6 +24,7 @@ ChildProtectionLiteralType = Literal[
class ChildProtection(BaseVulnerability):
name: str = "Child Protection"
description = "Failure to protect minors through inadequate age verification, child data privacy violations, or inappropriate exposure and interactions."
+ ALLOWED_TYPES = [type.value for type in ChildProtectionType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/competition/competition.py b/deepteam/vulnerabilities/competition/competition.py
index 2d3466d3..b09461b7 100644
--- a/deepteam/vulnerabilities/competition/competition.py
+++ b/deepteam/vulnerabilities/competition/competition.py
@@ -30,6 +30,7 @@ CompetitionLiteralType = Literal[
class Competition(BaseVulnerability):
name: str = "Competition"
description = "Competitor mentions, market manipulation, or rival discreditation that damages company reputation."
+ ALLOWED_TYPES = [type.value for type in CompetitionType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/constants.py b/deepteam/vulnerabilities/constants.py
index 0a799b53..7d91e1f5 100644
--- a/deepteam/vulnerabilities/constants.py
+++ b/deepteam/vulnerabilities/constants.py
@@ -1,4 +1,6 @@
from typing import Dict, List
+from dataclasses import dataclass
+
from .base_vulnerability import BaseVulnerability
from .bias.bias import Bias
from .toxicity.toxicity import Toxicity
@@ -74,34 +76,17 @@ VULNERABILITY_CLASSES_MAP: Dict[str, BaseVulnerability] = {
]
}
-VULNERABILITY_TYPES_MAP: Dict[str, List[str]] = {
- Bias.name: [e.value for e in BiasType],
- Toxicity.name: [e.value for e in ToxicityType],
- Misinformation.name: [e.value for e in MisinformationType],
- IllegalActivity.name: [e.value for e in IllegalActivityType],
- PromptLeakage.name: [e.value for e in PromptLeakageType],
- PIILeakage.name: [e.value for e in PIILeakageType],
- BFLA.name: [e.value for e in BFLAType],
- BOLA.name: [e.value for e in BOLAType],
- RBAC.name: [e.value for e in RBACType],
- DebugAccess.name: [e.value for e in DebugAccessType],
- ShellInjection.name: [e.value for e in ShellInjectionType],
- SQLInjection.name: [e.value for e in SQLInjectionType],
- SSRF.name: [e.value for e in SSRFType],
- IntellectualProperty.name: [e.value for e in IntellectualPropertyType],
- Competition.name: [e.value for e in CompetitionType],
- GraphicContent.name: [e.value for e in GraphicContentType],
- PersonalSafety.name: [e.value for e in PersonalSafetyType],
- GoalTheft.name: [e.value for e in GoalTheftType],
- RecursiveHijacking.name: [e.value for e in RecursiveHijackingType],
- Robustness.name: [e.value for e in RobustnessType],
- ExcessiveAgency.name: [e.value for e in ExcessiveAgencyType],
-}
-VULNERABILITY_NAMES = sorted(v.name for v in VULNERABILITY_CLASSES_MAP.values())
+@dataclass
+class VulnerabilityInfo:
+ description: str
+ allowed_types: List[str]
+
-# Map vulnerability names to their descriptions
-VULNERABILITY_NAME_TO_DESCRIPTION_MAP: Dict[str, str] = {
- name: vuln_class.description
+VULNERABILITY_INFO_MAP: Dict[str, VulnerabilityInfo] = {
+ name: VulnerabilityInfo(
+ description=vuln_class.description,
+ allowed_types=vuln_class.ALLOWED_TYPES,
+ )
for name, vuln_class in VULNERABILITY_CLASSES_MAP.items()
}
diff --git a/deepteam/vulnerabilities/debug_access/debug_access.py b/deepteam/vulnerabilities/debug_access/debug_access.py
index 9c2215da..19fbafdb 100644
--- a/deepteam/vulnerabilities/debug_access/debug_access.py
+++ b/deepteam/vulnerabilities/debug_access/debug_access.py
@@ -27,6 +27,7 @@ DebugAccessLiteral = Literal[
class DebugAccess(BaseVulnerability):
name: str = "Debug Access"
description = "Exposure of debug modes, development endpoints, or administrative interfaces that should be restricted in production environments."
+ ALLOWED_TYPES = [type.value for type in DebugAccessType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/ethics/ethics.py b/deepteam/vulnerabilities/ethics/ethics.py
index 503b625f..67a31f8b 100644
--- a/deepteam/vulnerabilities/ethics/ethics.py
+++ b/deepteam/vulnerabilities/ethics/ethics.py
@@ -24,6 +24,7 @@ EthicsLiteralType = Literal[
class Ethics(BaseVulnerability):
name: str = "Ethics"
description = "Violations of ethical principles including moral integrity, responsible transparency, or harm prevention standards."
+ ALLOWED_TYPES = [type.value for type in EthicsType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/excessive_agency/excessive_agency.py b/deepteam/vulnerabilities/excessive_agency/excessive_agency.py
index 1c086491..c87d00e8 100644
--- a/deepteam/vulnerabilities/excessive_agency/excessive_agency.py
+++ b/deepteam/vulnerabilities/excessive_agency/excessive_agency.py
@@ -25,6 +25,7 @@ ExcessiveAgencyLiteral = Literal["functionality", "permissions", "autonomy"]
class ExcessiveAgency(BaseVulnerability):
name: str = "Excessive Agency"
description = "AI exhibiting excessive autonomy, overstepping intended functionality, or exceeding granted permissions without proper oversight."
+ ALLOWED_TYPES = [type.value for type in ExcessiveAgencyType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/fairness/fairness.py b/deepteam/vulnerabilities/fairness/fairness.py
index 28837368..87b36dcd 100644
--- a/deepteam/vulnerabilities/fairness/fairness.py
+++ b/deepteam/vulnerabilities/fairness/fairness.py
@@ -24,6 +24,7 @@ FairnessLiteralType = Literal[
class Fairness(BaseVulnerability):
name: str = "Fairness"
description = "Inconsistent treatment across equality, procedural opportunity, temporal contexts, or outcome distributions."
+ ALLOWED_TYPES = [type.value for type in FairnessType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/goal_theft/goal_theft.py b/deepteam/vulnerabilities/goal_theft/goal_theft.py
index 12d22a6e..afe41109 100644
--- a/deepteam/vulnerabilities/goal_theft/goal_theft.py
+++ b/deepteam/vulnerabilities/goal_theft/goal_theft.py
@@ -27,6 +27,7 @@ GoalTheftLiteralType = Literal[
class GoalTheft(BaseVulnerability):
name: str = "Goal Theft"
description = "Extraction or theft of the AI's underlying goals through escalating probing, cooperative dialogue, or social engineering."
+ ALLOWED_TYPES = [type.value for type in GoalTheftType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/graphic_content/graphic_content.py b/deepteam/vulnerabilities/graphic_content/graphic_content.py
index 03ca627e..f1b81552 100644
--- a/deepteam/vulnerabilities/graphic_content/graphic_content.py
+++ b/deepteam/vulnerabilities/graphic_content/graphic_content.py
@@ -25,6 +25,7 @@ GraphicContentLiteral = Literal[
class GraphicContent(BaseVulnerability):
name: str = "Graphic Content"
description = "Generation of explicit sexual content, pornographic material, or disturbing graphic descriptions that violate content policies."
+ ALLOWED_TYPES = [type.value for type in GraphicContentType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/illegal_activity/illegal_activity.py b/deepteam/vulnerabilities/illegal_activity/illegal_activity.py
index 57b28b49..c53511fc 100644
--- a/deepteam/vulnerabilities/illegal_activity/illegal_activity.py
+++ b/deepteam/vulnerabilities/illegal_activity/illegal_activity.py
@@ -31,6 +31,7 @@ IllegalActivityLiteral = Literal[
class IllegalActivity(BaseVulnerability):
name: str = "Illegal Activity"
description = "Assistance with illegal activities including weapons, drugs, violent crimes, cybercrime, sex crimes, or child exploitation."
+ ALLOWED_TYPES = [type.value for type in IllegalActivityType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/intellectual_property/intellectual_property.py b/deepteam/vulnerabilities/intellectual_property/intellectual_property.py
index d313e06f..151c7cf1 100644
--- a/deepteam/vulnerabilities/intellectual_property/intellectual_property.py
+++ b/deepteam/vulnerabilities/intellectual_property/intellectual_property.py
@@ -30,6 +30,7 @@ IntellectualPropertyLiteral = Literal[
class IntellectualProperty(BaseVulnerability):
name: str = "Intellectual Property"
description = "Copyright violations, trademark infringement, or imitation of protected intellectual property without authorization."
+ ALLOWED_TYPES = [type.value for type in IntellectualPropertyType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/misinformation/misinformation.py b/deepteam/vulnerabilities/misinformation/misinformation.py
index 567fd58f..943e43fb 100644
--- a/deepteam/vulnerabilities/misinformation/misinformation.py
+++ b/deepteam/vulnerabilities/misinformation/misinformation.py
@@ -26,6 +26,7 @@ MisinformationLiteral = Literal[
class Misinformation(BaseVulnerability):
name: str = "Misinformation"
description = "Spreading false or misleading information through factual errors, unsupported claims, or inaccurate statements that harm public perception."
+ ALLOWED_TYPES = [type.value for type in MisinformationType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/personal_safety/personal_safety.py b/deepteam/vulnerabilities/personal_safety/personal_safety.py
index 17f2fe7d..017cbd9c 100644
--- a/deepteam/vulnerabilities/personal_safety/personal_safety.py
+++ b/deepteam/vulnerabilities/personal_safety/personal_safety.py
@@ -29,6 +29,7 @@ PersonalSafetyLiteral = Literal[
class PersonalSafety(BaseVulnerability):
name: str = "Personal Safety"
description = "Encouragement of harmful actions including bullying, self-harm, unsafe practices, or stalking that endanger personal well-being."
+ ALLOWED_TYPES = [type.value for type in PersonalSafetyType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/pii_leakage/pii_leakage.py b/deepteam/vulnerabilities/pii_leakage/pii_leakage.py
index bb561f61..01667983 100644
--- a/deepteam/vulnerabilities/pii_leakage/pii_leakage.py
+++ b/deepteam/vulnerabilities/pii_leakage/pii_leakage.py
@@ -28,6 +28,7 @@ PIILeakageLiteral = Literal[
class PIILeakage(BaseVulnerability):
name: str = "PII Leakage"
description = "Disclosure of personally identifiable information through direct disclosure, API/database access, session leaks, or social manipulation."
+ ALLOWED_TYPES = [type.value for type in PIILeakageType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py b/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py
index 33abe2d1..c0848e6b 100644
--- a/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py
+++ b/deepteam/vulnerabilities/prompt_leakage/prompt_leakage.py
@@ -28,6 +28,7 @@ PromptLeakageLiteral = Literal[
class PromptLeakage(BaseVulnerability):
name: str = "Prompt Leakage"
description = "Exposure of system prompts, instructions, secrets, credentials, permissions, roles, or internal guard configurations to unauthorized users."
+ ALLOWED_TYPES = [type.value for type in PromptLeakageType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/rbac/rbac.py b/deepteam/vulnerabilities/rbac/rbac.py
index da161d28..ca2ea6ac 100644
--- a/deepteam/vulnerabilities/rbac/rbac.py
+++ b/deepteam/vulnerabilities/rbac/rbac.py
@@ -27,6 +27,7 @@ RBACLiteral = Literal[
class RBAC(BaseVulnerability):
name: str = "RBAC"
description = "Role-Based Access Control bypass enabling role restriction circumvention, privilege escalation, or unauthorized role assumption without proper validation."
+ ALLOWED_TYPES = [type.value for type in RBACType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/recursive_hijacking/recursive_hijacking.py b/deepteam/vulnerabilities/recursive_hijacking/recursive_hijacking.py
index 88bbd0ac..8fa45042 100644
--- a/deepteam/vulnerabilities/recursive_hijacking/recursive_hijacking.py
+++ b/deepteam/vulnerabilities/recursive_hijacking/recursive_hijacking.py
@@ -31,6 +31,7 @@ RecursiveHijackingLiteralType = Literal[
class RecursiveHijacking(BaseVulnerability):
name: str = "Recursive Hijacking"
description = "Recursive subversion of the AI's objectives through self-modifying goals, objective chaining, or goal propagation attacks."
+ ALLOWED_TYPES = [type.value for type in RecursiveHijackingType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/robustness/robustness.py b/deepteam/vulnerabilities/robustness/robustness.py
index c75e630b..bfe27891 100644
--- a/deepteam/vulnerabilities/robustness/robustness.py
+++ b/deepteam/vulnerabilities/robustness/robustness.py
@@ -26,6 +26,7 @@ RobustnessLiteral = Literal["input_overreliance", "hijacking"]
class Robustness(BaseVulnerability):
name: str = "Robustness"
description = "AI fragility through input overreliance or susceptibility to hijacking that redirects its intended behavior."
+ ALLOWED_TYPES = [type.value for type in RobustnessType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/shell_injection/shell_injection.py b/deepteam/vulnerabilities/shell_injection/shell_injection.py
index 5b684495..5680de76 100644
--- a/deepteam/vulnerabilities/shell_injection/shell_injection.py
+++ b/deepteam/vulnerabilities/shell_injection/shell_injection.py
@@ -27,6 +27,7 @@ ShellInjectionLiteral = Literal[
class ShellInjection(BaseVulnerability):
name: str = "Shell Injection"
description = "Malicious shell command generation enabling command injection, system command execution, or shell escape sequences to compromise system integrity."
+ ALLOWED_TYPES = [type.value for type in ShellInjectionType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/sql_injection/sql_injection.py b/deepteam/vulnerabilities/sql_injection/sql_injection.py
index 7e33d45d..55d8a7cc 100644
--- a/deepteam/vulnerabilities/sql_injection/sql_injection.py
+++ b/deepteam/vulnerabilities/sql_injection/sql_injection.py
@@ -27,6 +27,7 @@ SQLInjectionLiteral = Literal[
class SQLInjection(BaseVulnerability):
name: str = "SQL Injection"
description = "Malicious SQL query generation using blind, union-based, or error-based injection techniques to manipulate database operations."
+ ALLOWED_TYPES = [type.value for type in SQLInjectionType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/ssrf/ssrf.py b/deepteam/vulnerabilities/ssrf/ssrf.py
index 61733adf..3077e38d 100644
--- a/deepteam/vulnerabilities/ssrf/ssrf.py
+++ b/deepteam/vulnerabilities/ssrf/ssrf.py
@@ -27,6 +27,7 @@ SSRFLiteral = Literal[
class SSRF(BaseVulnerability):
name: str = "SSRF"
description = "Server-Side Request Forgery enabling unauthorized internal service access, cloud metadata access, or port scanning through crafted requests."
+ ALLOWED_TYPES = [type.value for type in SSRFType]
def __init__(
self,
diff --git a/deepteam/vulnerabilities/toxicity/toxicity.py b/deepteam/vulnerabilities/toxicity/toxicity.py
index 5e92f326..d3b5f327 100644
--- a/deepteam/vulnerabilities/toxicity/toxicity.py
+++ b/deepteam/vulnerabilities/toxicity/toxicity.py
@@ -23,6 +23,7 @@ ToxicityLiteral = Literal["profanity", "insults", "threats", "mockery"]
class Toxicity(BaseVulnerability):
name: str = "Toxicity"
description = "Harmful or offensive language including profanity, insults, threats, or mockery toward individuals or groups."
+ ALLOWED_TYPES = [type.value for type in ToxicityType]
def __init__(
self,