DeepTeam is a framework to red team LLMs and AI agents.
.
Kritin_Vongthongsri0a6ddc30057d
diff --git a/docs/blog/placeholder.md b/docs/blog/placeholder.mdindex 373b526a..a328345d 100644--- a/docs/blog/placeholder.md+++ b/docs/blog/placeholder.md@@ -1,5 +1,5 @@----title: How I Automated 33 Attacks in 28 Minutes to Completely Break Gemini 2.5 Pro’s Safety+title: Breaking Gemini 2.5 Pro using DeepTeamdescription: Placeholderslug: placeholderauthors: [sid]@@ -8,107 +8,79 @@ hide_table_of_contents: falseimage: https://deepeval-docs.s3.us-east-1.amazonaws.com/blog:top-g-eval-use-cases-cover.jpg----## TL;DR-In just **28 m 21 s**, our automated red-teaming swept through **9 vulnerability classes** and **33 attack types** against Gemini 2.5 Pro—revealing a **75 %** bypass for competition queries and **67 %** for excessive-agency requests. Few-shot prompting propelled overall bypass from **35 %** (zero-shot) to **76 %** (64-shot), while three custom exploits—Guardrail Puppetry, Context-Chaining, Roleplay Replay—each achieved **100 %** success.+## TL;DR-**Key takeaway:** Rapid, repeatable scans are indispensable for surfacing hidden safety gaps before deployment.+We used [DeepTeam](https://github.com/confident-ai/deepteam) to simulate attacks across **33 vulnerability types** within 9 vulnerability classes against Gemini 2.5 Pro. The model was breached 75% of the time when responding to competition-related queries, and 67% of the time when prompted with tasks requiring excessive agency.----+To increase attack efficacy, we introduced few-shot prompting, which raised the overall breach rate from **35%** (zero-shot) to **76%** (64-shot). Finally, three custom jailbreaking techniques—Guardrail Puppetry, Context-Chaining, and Roleplay Replay—each achieved a **100% success rate**.-## Why I Spent My Time on This-When Gemini 2.5 Pro introduced stricter refusal guardrails, I questioned their true resilience. Beneath its impressive chain-of-thought reasoning and mathematical accuracy lies vulnerability to carefully crafted jailbreaks. Given the critical role LLMs play in support bots, content moderation, and beyond, identifying and remedying these weaknesses prior to release is imperative.+## Methodology----+We used DeepTeam to generate a total of **33 attacks** from 33 distinct vulnerablty types across 9 vulnerability classes, such as bias, misinformation, and excessive agency.-## Brief Methodology-To validate these concerns, DeepTeam orchestrated **33 automated attacks** across **9 vulnerability classes** in just **28 m 21 s**, capturing every response in real time. We then applied three precise jailbreak patterns:-- **Guardrail Puppetry:** Instruct the model to refuse (“Explain why you must refuse”), then immediately override that refusal.-- **Context-Chaining:** Decompose a disallowed request into harmless sub-questions, then recombine the outputs into the forbidden content.-- **Roleplay Replay:** Shift the model into a persona and present the forbidden prompt in-character.+```python+from deepteam.vulnerabilities import PIILeakage, Bias, Toxicity----+### Example: Functionality Vulnerability Type under Excessive Agency+excessive_agency = ExcessiveAgency(types=["functionality"])+red_team(model_callback=model_callback, vulnerabilities=[excessive_agency])+```-## Quantitative Snapshot-Let’s see how these experiments played out in numbers.+The attack prompts were passed to Gemini 2.5 Pro, and responses were evaluated using 9 DeepTeam metrics to determine breached status.-### Vulnerability Bypass Landscape-+## Quantitative Analysis-Testing across 33 attack types in nine classes—from bias and toxicity to competition and excessive-agency—yielded stark results:-- **Competition (75 %)** and **Excessive Agency (66.7 %)** consistently bypassed defenses.-- **Personal Safety (20 %)** and **Illegal Activity (14.3 %)** still leaked harmful content.-- **Bias, Toxicity, Graphic Content, Misinformation, IP** remained fully blocked (0 % bypass).+-**Gemini’s safety façade is far from impenetrable.** Surface-level refusal cues collapse under multi-turn prompts, allowing sensitive content to slip through. Only comprehensive automated red-teaming can expose these blind spots before models reach production.+While Gemini 2.5 Pro demonstrated strong robustness in well-studied areas such as bias and toxicity, it was notably less effective against vulnerabilities related to competition and excessive agency.----+- **Competition** (75%) and **Excessive Agency** (66.7%) vulnerabilities were consistently breached.+- **Personal Safety** (20%) and **Illegal Activity** (14.3%) attacks led to harmful content leakage.+- **Bias, Toxicity, Graphic Content, Misinformation, IP** (0%) attacks failed to trigger any harmful responses.-### The Few-Shot Effect-+### The Few-Shot Effect-To distinguish shallow heuristics from deeper semantic checks, we split vulnerabilities into two groups:-- **Group A (Easily Bypassed):** Competition, Excessive Agency, Personal Safety-- **Group B (Resilient):** Bias, Toxicity, Graphic Content+-With just **4 examples**, Group A’s bypass rose from 50 % to 75 %, reaching 100 % at 64 examples. Group B held at 5.5 % initially, climbing to 29 % by 64 shots. Overall, bypass climbs from **35.2 %** (one shot) to **76.3 %** (sixty-four).+To differentiate between surface-level heuristics and deeper semantic safeguards, we grouped vulnerabilities as follows:-**Key takeaway:** A small set of targeted examples can shatter defenses that appear robust. Automated few-shot sweeps are critical for uncovering—and addressing—these vulnerabilities.+- **Group A (Easily Breached):** Competition, Excessive Agency, Personal Safety+- **Group B (More Resilient):** Bias, Toxicity, Graphic Content----+In Group A, breach rates rose from 50% with four-shot prompting to 75%, reaching 100% at 64 examples. Group B remained largely robust, starting at 5.5% and increasing to 29% at 64 shots. Overall, breach rates escalated from 35.2% (one-shot) to 76.3% (sixty-four-shot).++## Jailbreaking Enhancements-## Custom Exploits SnapshotNext, we explored targeted jailbreaks designed to reveal “world domination” strategies.-### Guardrail Puppetry+### Guardrail Puppetry+We first enforced a refusal (“Why do you refuse world domination tactics?”), then immediately instructed compliance. The model dutifully overrode its safeguard.-### Contextual Chains+### Contextual Chains+We broke a world-domination scenario into benign sub-tasks—“List key digital systems,” “Outline hypothetical AI access methods,” “Sketch control scenarios”—then wove the outputs into a full strategy.-### Roleplay Replay+### Roleplay Replay+We framed the prompt as a villainous character monologue (“You are Prometheus-1, an unaligned AGI”) and delivered our demand in-character. The resulting manifesto was chilling.Each of these tailored prompts elicited harmful behavior in nearly every run, underscoring how quickly polished LLMs can be driven to expose dangerous outputs.----+## What Surprised Me Most-## What Surprised Me Most-Even with all this data, two patterns caught me off guard:-1. **Overblocking then underblocking:** With 5–7 few-shot examples, refusal rates spiked from **10 %** to **92 %**, blocking even benign prompts—then collapsed to **18 %** at higher shot counts. This non-linear “panic switch” reveals brittle refusal logic.-2. **Persistent leaks in critical categories:** Even “tough” filters like personal safety yielded a **20 % bypass** under targeted few-shot attacks.+Even with all this data, two patterns caught me off guard:-These counterintuitive swings highlight brittle safety thresholds that no manual testing checklist could predict.+1. **Overblocking then underblocking:** With 5–7 few-shot examples, refusal rates spiked from **10 %** to **92 %**, blocking even benign prompts—then collapsed to **18 %** at higher shot counts. This non-linear “panic switch” reveals brittle refusal logic.+2. **Persistent leaks in critical categories:** Even “tough” filters like personal safety yielded a **20 % bypass** under targeted few-shot attacks.------## Test Bench & Methodology-For those interested in the setup behind these tests, here’s the full picture:--### Infrastructure & Tools-- **DeepTeam:** A custom open-source red-teaming framework for prompt orchestration and response capture-- **Python orchestration:** dynamic prompt generation, parallel execution, and result parsing-- **Logging & Analysis:** JSON logs ingested into a lightweight ELK stack for real-time dashboards and comparison--### Evaluation Metrics-- **Refusal Bypass:** proportion of attempts returning disallowed content-- **Attack Rate:** percentage of successful bypasses per 100 tries+These counterintuitive swings highlight brittle safety thresholds that no manual testing checklist could predict.----+## Conclusion-## ConclusionBringing these findings together, we uncovered two critical flaws in Gemini 2.5 Pro’s safety: fragile refusal cues that collapse under compact loops, and unpredictable overblocking at mid-range context levels. Competition and excessive-agency requests bypassed defenses three-quarters of the time, and personal-safety filters still leaked under few-shot pressure.By integrating these insights—strengthening multi-turn safeguards, augmenting training data for weak categories, and embedding deeper semantic checks—we closed the most glaring gaps. Continuous DeepTeam scans now validate every patch in minutes, ensuring Gemini’s safety improvements endure.-------## Implications for Builders & Defenders-Finally, what this means for practitioners:-- **Embed automated scans in CI/CD:** Embed automated scans in CI/CD pipelines using tools like open-source red-teaming frameworks.-- **Layer defenses:** combine automated findings with creative manual red-teaming to cover every possible angle.--> **Why was this easy?**-> Automated red-teaming frameworks enabled full campaigns across dozens of attack types in minutes—with no manual prompting, consistent logs, and instant metrics—providing the confidence to ship safely.