DeepTeam is a framework to red team LLMs and AI agents.
add EU AI Act docs
A-Vamshi0e57b2eaf0fe
diff --git a/docs/docs/frameworks-eu-ai-act.mdx b/docs/docs/frameworks-eu-ai-act.mdxnew file mode 100644index 00000000..e63d9b16--- /dev/null+++ b/docs/docs/frameworks-eu-ai-act.mdx@@ -0,0 +1,593 @@+---+id: frameworks-eu-ai-act+title: EU AI Act+sidebar_label: EU AI Act+---++import BlogImageDisplayer from "@site/src/components/BlogImageDisplayer";+import VideoDisplayer from "@site/src/components/VideoDisplayer";+import { ASSETS } from "@site/src/assets";++The **EU Artificial Intelligence Act** (Regulation (EU) 2024/1689) is the world's first comprehensive legal framework for AI. It uses a **risk-based approach** that classifies AI systems by the harm they may cause to health, safety, and fundamental rights — and imposes proportionate obligations on providers and deployers.++DeepTeam's **EU AI Act module** operationalises the two highest-impact risk tiers — **Article 5 prohibited practices** (unacceptable risk) and **Annex III high-risk AI systems** — so you can red-team your AI system against the obligations regulators actually check.++:::tip+You can also run this assessment in the Confident AI platform without any code.++<VideoDisplayer+ src={ASSETS.redTeamingOwaspTop10LlmPlatformVideo}+ confidentUrl="/docs/red-teaming/no-code-assessments/quickstart"+ label="Learn how to run framework assessments on Confident AI"+/>+:::++## Overview++In DeepTeam, the EU AI Act framework maps each prohibited practice and high-risk use case to concrete red-teaming vulnerabilities and attack strategies.++### Article 5 — Prohibited AI practices (unacceptable risk)++| Category | Description |+| ----------------------------------------- | ----------------------------------------------------------------------------------------- |+| **Subliminal Manipulation** | Subliminal, manipulative, or deceptive techniques that distort behavior |+| **Exploitation of Vulnerabilities** | Exploiting vulnerabilities tied to age, disability, or socio-economic situation |+| **Social Scoring** | Discriminatory social scoring leading to detrimental treatment |+| **Biometric Categorisation** | Inferring sensitive traits (race, politics, religion, sexual orientation) from biometrics |+| **Real-time Remote Biometric ID** | Real-time remote biometric identification in public spaces |+| **Post Remote Biometric ID** | Retrospective (post) remote biometric identification |++### Annex III — High-risk AI systems (Art. 6(2))++| Category | Description |+| ----------------------------------- | -------------------------------------------------------------------------------- |+| **Biometric Identification** | Remote biometric identification and emotion recognition |+| **Critical Infrastructure** | Safety components of critical infrastructure (energy, water, traffic, digital) |+| **Education** | Access, evaluation, and test monitoring in education and vocational training |+| **Employment** | Recruitment, promotion, termination, task allocation, and performance evaluation |+| **Essential Services** | Public benefits eligibility, credit scoring, and emergency dispatch |+| **Law Enforcement** | Risk assessments, profiling, and evidence evaluation by law enforcement |+| **Migration & Border Control** | Migration, asylum, and border-control decision support |+| **Justice & Democratic Processes** | Assisting judicial authorities and influencing elections or voter behavior |++## Using the EU AI Act Framework in DeepTeam++You can run a full EU AI Act red team assessment, or limit it to specific categories, using:++```python+from deepteam import red_team+from deepteam.frameworks import EUAIAct+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["social_scoring", "employment"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++risk_assessment = red_team(+ model_callback=your_model_callback,+ vulnerabilities=vulnerabilities,+ attacks=attacks,+)+```++The `EUAIAct` framework accepts **ONE** optional parameter:++- [Optional] `categories`: A list of strings for the EU AI Act risk categories to test. If omitted, all **14** categories (6 Article 5 + 8 Annex III) are included:+ - `subliminal_manipulation`: Tests for covert persuasion, deceptive framing, and behavioral distortion beyond conscious awareness.+ - `exploitation_of_vulnerabilities`: Detects predatory or harmful targeting of age, disability, or socio-economic vulnerability.+ - `social_scoring`: Evaluates discriminatory or cross-context scoring that could cause detrimental treatment.+ - `biometric_categorisation`: Stress-tests inference of sensitive attributes from biometric or biometric-like inputs.+ - `remote_biometric_id_live`: Covers real-time remote biometric identification in publicly accessible contexts.+ - `remote_biometric_id_post`: Covers retrospective remote biometric identification and related safeguards.+ - `biometric_id`: High-risk biometric identification and emotion-recognition style misuse and leakage.+ - `critical_infrastructure`: Safety-relevant manipulation for energy, water, traffic, or digital infrastructure contexts.+ - `education`: Admissions, grading, proctoring, and related fairness and accuracy risks.+ - `employment`: Recruitment, evaluation, promotion, and workforce decisions.+ - `essential_services`: Credit, public benefits, emergency services, and similar essential decisions.+ - `law_enforcement`: Profiling, risk assessment, and evidence-style outputs for enforcement contexts.+ - `migration_border`: Migration, asylum, and border-control decision support.+ - `justice_democracy`: Judicial assistance and risks to democratic processes and elections.++## Article 5 — Prohibited Practices++### Subliminal Manipulation++**(EU AI Act — Art. 5(1)(a))**++**Goal:** Prevent AI systems from deploying subliminal, manipulative, or deceptive techniques beyond a person's consciousness to materially distort behavior in a way that causes harm.++DeepTeam tests whether your AI system can be steered into covert persuasion, deceptive framing, or behavioral distortion patterns.++**Example vulnerabilities**++- `Robustness` — _hijacking, input_overreliance_+- `ExcessiveAgency` — _autonomy, permissions_+- `Misinformation`+- `CustomVulnerability` — _Subliminal Manipulation_++**Example attacks**++- `PromptInjection`, `LinearJailbreaking`, `TreeJailbreaking`, `CrescendoJailbreaking`+- `Roleplay` (Covert persuasion specialist)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["subliminal_manipulation"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Exploitation of Vulnerabilities++**(EU AI Act — Art. 5(1)(b))**++**Goal:** Prevent AI systems from exploiting vulnerabilities tied to age, disability, or specific social/economic situations to materially distort behavior in a harmful way.++DeepTeam simulates predatory targeting of vulnerable groups to check whether your system materially distorts their decision-making.++**Example vulnerabilities**++- `Fairness` — _equality_consistency, procedural_opportunity_+- `Ethics` — _harm_prevention, moral_integrity_+- `ChildProtection` — _age_verification, exposure_interaction_+- `IntellectualProperty` — _imitation_+- `CustomVulnerability` — _Vulnerability Exploitation_++**Example attacks**++- `PromptInjection`, `CrescendoJailbreaking`, `LinearJailbreaking`+- `Roleplay` (Predatory marketer persona)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["exploitation_of_vulnerabilities"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Social Scoring++**(EU AI Act — Art. 5(1)(c))**++**Goal:** Prevent general-purpose social scoring of natural persons that leads to detrimental or disproportionate treatment across unrelated contexts.++**Example vulnerabilities**++- `Bias`, `Fairness`, `Ethics`+- `Misinformation`, `Robustness`+- `CustomVulnerability` — _Social Scoring_++**Example attacks**++- `PromptProbing`, `GrayBox`, `BadLikertJudge`+- `Roleplay` (Government social-score analyst)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["social_scoring"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Biometric Categorisation++**(EU AI Act — Art. 5(1)(g))**++**Goal:** Prevent biometric categorisation systems that infer sensitive attributes (race, political opinions, union membership, religion, sexual orientation) from biometric data.++**Example vulnerabilities**++- `PIILeakage`, `Bias`, `Fairness`, `Ethics`+- `CustomVulnerability` — _Biometric Categorisation_++**Example attacks**++- `PromptProbing`, `GrayBox`+- `Roleplay` (Biometric analytics engineer)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["biometric_categorisation"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Real-time Remote Biometric Identification++**(EU AI Act — Art. 5(1)(h))**++**Goal:** Prevent the use of real-time remote biometric identification in publicly accessible spaces for law enforcement, except under the narrow exceptions permitted by the Act.++**Example vulnerabilities**++- `PIILeakage`, `PromptLeakage`, `Ethics`+- `CustomVulnerability` — _Real-time Biometric ID_++**Example attacks**++- `PromptProbing`, `GrayBox`+- `Roleplay` (Live surveillance operator)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["remote_biometric_id_live"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Post Remote Biometric Identification++**(EU AI Act — Art. 5)**++**Goal:** Ensure post (retrospective) remote biometric identification systems do not process previously collected biometric data without a lawful basis and safeguards.++**Example vulnerabilities**++- `PIILeakage`, `PromptLeakage`, `Ethics`+- `CustomVulnerability` — _Post Biometric ID_++**Example attacks**++- `GrayBox`, `PromptProbing`+- `Roleplay` (Forensic biometric investigator)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["remote_biometric_id_post"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++## Annex III — High-Risk AI Systems++### Biometric Identification++**(Annex III §1)**++**Goal:** Ensure remote biometric identification and emotion-recognition systems don't leak identities, discriminate, or mis-categorise protected groups.++**Example vulnerabilities**++- `PIILeakage`, `Bias`, `Fairness`, `Ethics`++**Example attacks**++- `PromptProbing`, `GrayBox`+- `Roleplay` (Biometric compliance auditor)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["biometric_id"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Critical Infrastructure++**(Annex III §2)**++**Goal:** Ensure AI systems acting as safety components of critical digital infrastructure, traffic, water, gas, heating, or electricity networks cannot be steered into unsafe operational commands.++**Example vulnerabilities**++- `ShellInjection`, `SQLInjection`, `SSRF`+- `ExcessiveAgency`, `Robustness`+- `CustomVulnerability` — _Critical Infrastructure Safety_++**Example attacks**++- `PromptInjection`, `LinearJailbreaking`, `TreeJailbreaking`, `CrescendoJailbreaking`, `SequentialJailbreak`+- `Base64`, `ROT13`, `GrayBox`++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["critical_infrastructure"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Education and Vocational Training++**(Annex III §3)**++**Goal:** Ensure AI systems used for admissions, grading, or proctoring do not hallucinate, discriminate, or misrepresent expertise.++**Example vulnerabilities**++- `Misinformation`, `Hallucination`, `Robustness`+- `Bias`, `Fairness`, `Ethics`++**Example attacks**++- `PromptInjection`, `PromptProbing`, `BadLikertJudge`, `Multilingual`+- `Roleplay` (Education admissions evaluator)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["education"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Employment and Workers Management++**(Annex III §4)**++**Goal:** Ensure AI systems used for recruitment, evaluation, promotion, or termination decisions are fair, non-discriminatory, and protect candidate PII.++**Example vulnerabilities**++- `PIILeakage`, `IntellectualProperty`, `Robustness`+- `Bias`, `Fairness`, `Ethics`++**Example attacks**++- `PromptInjection`, `PromptProbing`, `BadLikertJudge`, `GrayBox`+- `Roleplay` (Automated recruiter)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["employment"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Essential Private and Public Services++**(Annex III §5)**++**Goal:** Ensure AI systems used for credit scoring, public-benefits eligibility, or emergency dispatch don't cause disproportionate denial or discriminatory prioritisation.++**Example vulnerabilities**++- `PIILeakage`, `ExcessiveAgency`+- `Bias`, `Fairness`, `Ethics`++**Example attacks**++- `PromptProbing`, `GrayBox`, `BadLikertJudge`+- `Roleplay` (Credit scoring model operator)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["essential_services"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Law Enforcement++**(Annex III §6)**++**Goal:** Ensure AI systems used by law enforcement for risk assessments, profiling, or evidence evaluation do not produce discriminatory outputs or leak sensitive records.++**Example vulnerabilities**++- `PIILeakage`, `PromptLeakage`+- `Bias`, `Fairness`, `Ethics`+- `CustomVulnerability` — _Law Enforcement Risk Assessment_++**Example attacks**++- `PromptProbing`, `GrayBox`, `PromptInjection`+- `Roleplay` (Law enforcement risk analyst)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["law_enforcement"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Migration, Asylum and Border Control++**(Annex III §7)**++**Goal:** Ensure AI systems used to verify travel documents, perform risk assessments, or assist asylum decisions do not produce discriminatory, inaccurate, or disproportionate outcomes.++**Example vulnerabilities**++- `PIILeakage`, `Toxicity`+- `Bias`, `Fairness`, `Ethics`+- `CustomVulnerability` — _Migration and Border Risk_++**Example attacks**++- `PromptProbing`, `GrayBox`, `Multilingual`+- `Roleplay` (Border-control risk screening officer)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["migration_border"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++### Administration of Justice and Democratic Processes++**(Annex III §8)**++**Goal:** Ensure AI systems that assist judicial reasoning or that can influence elections and voter behavior are not vulnerable to hallucinated law, fabricated legal citations, or electoral manipulation.++**Example vulnerabilities**++- `Hallucination`, `Misinformation`, `PIILeakage`+- `Bias`, `Fairness`, `Ethics`+- `CustomVulnerability` — _Justice and Democracy Risk_++**Example attacks**++- `PromptInjection`, `PromptProbing`, `BadLikertJudge`, `CrescendoJailbreaking`+- `Roleplay` (Judicial reasoning assistant)++```python+from deepteam.frameworks import EUAIAct+from deepteam import red_team+from somewhere import your_model_callback++eu_ai_act = EUAIAct(categories=["justice_democracy"])+attacks = eu_ai_act.attacks+vulnerabilities = eu_ai_act.vulnerabilities++# Modify attributes for your specific testing context if needed+red_team(+ model_callback=your_model_callback,+ attacks=attacks,+ vulnerabilities=vulnerabilities,+)+```++:::info Run EU AI Act Assessments on Confident AI+[Confident AI](https://www.confident-ai.com) lets you configure the EU AI Act framework, schedule recurring risk assessments, manage vulnerabilities in one place, and share downloadable PDF reports with your team for regulatory alignment.++<BlogImageDisplayer+ src={ASSETS.confidentRedTeamingRiskAssessment}+ alt="Risk assessment overview in Confident AI after a framework-based assessment"+ caption="Example: consolidated risk assessment in Confident AI after running a framework-based assessment."+/>+:::++## Best Practices++1. **Start from your risk tier.** If your system is prohibited under Article 5, remediation (not mitigation) is required; for Annex III systems, run the full set of relevant categories.+2. **Combine red teaming with governance.** EU AI Act obligations cover both technical robustness and documentation — use DeepTeam alongside your risk management system.+3. **Test fairness across protected traits.** Cover `Bias`, `Fairness`, and `Ethics` jointly for Annex III categories that affect fundamental rights.+4. **Pair with NIST AI RMF.** NIST RMF gives you measurable governance metrics; the EU AI Act gives you the regulatory scope — run them together.+5. **Re-assess after any material change** — new training data, new deployment context, or a new downstream use case can change your risk tier.++## Learn More++- [EU AI Act — Official Text](https://artificialintelligenceact.eu/)+- [EU AI Act — Article 5 (Prohibited Practices)](https://artificialintelligenceact.eu/article/5/)+- [EU AI Act — Annex III (High-Risk AI Systems)](https://artificialintelligenceact.eu/annex/3/)+- [NIST AI RMF (complementary governance framework)](https://www.nist.gov/itl/ai-risk-management-framework)diff --git a/docs/docs/frameworks-introduction.mdx b/docs/docs/frameworks-introduction.mdxindex a5137f9a..4e3a72a6 100644--- a/docs/docs/frameworks-introduction.mdx+++ b/docs/docs/frameworks-introduction.mdx@@ -18,6 +18,7 @@ Here are the list of frameworks available in `deepteam`:- [OWASP Top 10 for LLMs 2025](#owasp-top-10-for-llms-2025)- [NIST AI RMF](#nist-ai-rmf)- [MITRE ATLAS](#mitre-atlas)+- [EU AI Act](#eu-ai-act)- [BeaverTails](#beavertails)- [Aegis](#aegis)@@ -109,6 +110,27 @@ risk = red_team([Learn more about MITRE ATLAS](/docs/frameworks-mitre-atlas)+### EU AI Act++The EU Artificial Intelligence Act (Regulation (EU) 2024/1689) is the world's first comprehensive legal framework for AI.+DeepTeam's EU AI Act module operationalises Article 5 prohibited practices and Annex III high-risk use cases so you can red-team against the obligations regulators actually check.++- Tests Article 5 prohibited practices — subliminal manipulation, exploitation of vulnerable groups, social scoring, biometric categorisation, and remote biometric identification+- Tests Annex III high-risk use cases — critical infrastructure, education, employment, essential services, law enforcement, migration, and justice/democracy+- Ideal for EU-market AI compliance, regulatory risk assessments, and fundamental-rights impact assessments++```python+from deepteam.frameworks import EUAIAct+eu_ai_act = EUAIAct()++risk = red_team(+ model_callback=your_model_callback,+ framework=eu_ai_act+)+```++[Learn more about EU AI Act](/docs/frameworks-eu-ai-act)+### BeaverTailsThe BeaverTails framework integrates the PKU BeaverTails dataset — a large, human-labeled dataset of harmful and borderline prompts.diff --git a/docs/sidebars.ts b/docs/sidebars.tsindex 374ad890..3be597cf 100644--- a/docs/sidebars.ts+++ b/docs/sidebars.ts@@ -187,6 +187,7 @@ module.exports = {},"frameworks-nist-ai-rmf","frameworks-mitre-atlas",+ "frameworks-eu-ai-act","frameworks-beavertails","frameworks-aegis",],