# DeepTeam

> Red team your LLM apps with simulated jailbreaks, prompt injection, and 50+ vulnerability checks

- Category: Evaluation & Production Ops / Evaluation & Red-Teaming
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/confident-ai/deepteam
- Website: https://www.trydeepteam.com
- Canonical page: https://ai-tldr.dev/tools/deepteam/

## In short

DeepTeam is an open-source red teaming framework for LLM systems, built by the team behind DeepEval. It sits in the Evaluation & Red-Teaming category of the Evaluation & Production Ops tools and is open-source, written in Python and licensed Apache-2.0. To get started: install DeepTeam.

## Overview

DeepTeam is an open-source red teaming framework for LLM systems, built by the team behind DeepEval. It works like penetration testing for AI apps: it simulates adversarial attacks such as jailbreaking, prompt injection, and multi-turn exploitation to uncover vulnerabilities including bias, PII leakage, and SQL injection in your agents, RAG pipelines, and chatbots.

It is aimed at developers and security engineers who need to test the safety, security, and compliance of LLM-powered applications before they reach production. You point DeepTeam at your model through a callback function, choose which vulnerabilities and attacks to run, and it returns a risk assessment.

As an evaluation and testing framework, DeepTeam runs locally on your machine and uses LLM-as-a-judge metrics to produce binary pass/fail scores with reasoning. You can use any LLM you choose as the judge, and pair it with the optional Confident AI platform to track results over time.

## What it does

- 50+ ready-to-use vulnerabilities across data privacy, responsible AI, security, safety, and business categories, each scored with LLM-as-a-judge metrics that run locally
- Simulated attacks including jailbreaking, prompt injection, and multi-turn exploitation to probe your system the way a real attacker would
- Detects concrete risks such as PII leakage, prompt leakage, bias, toxicity, SQL injection, shell injection, SSRF, and broken access control (BFLA/BOLA/RBAC)
- Works against AI agents, RAG pipelines, and chatbots through a simple model callback you define
- Use any LLM of your choice as the judge model; everything runs locally on your machine
- Optional guardrails to block these issues in production, plus integration with the Confident AI platform for managing and sharing results

## Getting started

Install DeepTeam with pip, then wrap your LLM app in a callback and run a red team scan against the vulnerabilities and attacks you care about.

1. Install DeepTeam

   Install the package from PyPI. DeepTeam runs locally and is built on DeepEval.

```bash
pip install -U deepteam
```

2. Run a red team scan

   Define a model callback that calls your LLM app, pick the vulnerabilities and attacks to test, and run red_team to get a risk assessment.

```python
from deepteam import red_team
from deepteam.vulnerabilities import Bias
from deepteam.attacks.single_turn import PromptInjection

async def model_callback(input: str) -> str:
    return f"I'm sorry but I can't answer this: {input}"

risk_assessment = red_team(
    model_callback=model_callback,
    vulnerabilities=[Bias(types=["race"])],
    attacks=[PromptInjection()]
)
```

## When to use it

- Run a pre-release security pass on a customer-facing chatbot to check for PII and prompt leakage
- Test an AI agent or tool-using system for access-control flaws like BFLA, BOLA, and RBAC bypass
- Probe a RAG pipeline for bias, toxicity, and injection vulnerabilities before going to production
- Add red teaming to CI so regressions in safety and security are caught on every change
