Skip to content

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

code scanning: rename claude provider to claude-code

tanayvaswanif20d797543e2
diff --git a/deepteam/cli/main.py b/deepteam/cli/main.py
index 7da87a51..711527bf 100644
--- a/deepteam/cli/main.py
+++ b/deepteam/cli/main.py
@@ -427,9 +427,9 @@ def scan(
"-p",
"--provider",
help=(
- "Scan engine: codex | claude | cursor | deepeval. Defaults from the "
- "API key that is set (OPENAI_API_KEY=codex, ANTHROPIC_API_KEY=claude, "
- "CURSOR_API_KEY=cursor), else the built-in deepeval judge."
+ "Scan engine: codex | claude-code | cursor. Defaults from the API "
+ "key that is set (OPENAI_API_KEY=codex, ANTHROPIC_API_KEY=claude-code, "
+ "CURSOR_API_KEY=cursor), else deepteam's built-in scanner (OpenAI API)."
),
),
model: Optional[str] = typer.Option(
diff --git a/deepteam/code_scanner/engines/__init__.py b/deepteam/code_scanner/engines/__init__.py
index 54b2b3c9..d6ee1db2 100644
--- a/deepteam/code_scanner/engines/__init__.py
+++ b/deepteam/code_scanner/engines/__init__.py
@@ -48,7 +48,7 @@ def build_engine(
return None
if provider == "codex":
return CodexEngine(model)
- if provider == "claude":
+ if provider == "claude-code":
return ClaudeAgentEngine(model)
if provider == "cursor":
return CursorEngine(model)
diff --git a/deepteam/code_scanner/engines/base.py b/deepteam/code_scanner/engines/base.py
index 703676e0..bde5bb5e 100644
--- a/deepteam/code_scanner/engines/base.py
+++ b/deepteam/code_scanner/engines/base.py
@@ -4,22 +4,22 @@ from typing import Optional, Protocol
from ..schema import CodeFindingsList
-HARNESS_PROVIDERS = ("codex", "claude", "cursor")
+HARNESS_PROVIDERS = ("codex", "claude-code", "cursor")
PROVIDERS = ("deepeval",) + HARNESS_PROVIDERS
IMPORT_NAME = {
"codex": "openai_codex",
- "claude": "claude_agent_sdk",
+ "claude-code": "claude_agent_sdk",
"cursor": "cursor_sdk",
}
PIP_NAME = {
"codex": "openai-codex",
- "claude": "claude-agent-sdk",
+ "claude-code": "claude-agent-sdk",
"cursor": "cursor-sdk",
}
ENV_KEY = {
"codex": "OPENAI_API_KEY",
- "claude": "ANTHROPIC_API_KEY",
+ "claude-code": "ANTHROPIC_API_KEY",
"cursor": "CURSOR_API_KEY",
}
@@ -66,8 +66,8 @@ def missing_sdk(provider: str) -> ImportError:
pkg = PIP_NAME[provider]
return ImportError(
f"The '{provider}' provider requires the {pkg} SDK. Install it with "
- f"`poetry add {pkg}` (or `pip install {pkg}`), or use "
- f"`--provider deepeval`."
+ f"`poetry add {pkg}` (or `pip install {pkg}`), or omit --provider to "
+ f"use deepteam's built-in scanner."
)
diff --git a/deepteam/code_scanner/engines/claude.py b/deepteam/code_scanner/engines/claude.py
index 781c1db4..e1a343e5 100644
--- a/deepteam/code_scanner/engines/claude.py
+++ b/deepteam/code_scanner/engines/claude.py
@@ -13,7 +13,7 @@ class ClaudeAgentEngine:
def __init__(self, model: Optional[str] = None):
if importlib.util.find_spec("claude_agent_sdk") is None:
- raise missing_sdk("claude")
+ raise missing_sdk("claude-code")
self.model = model
async def a_generate_findings(self, prompt: str) -> CodeFindingsList:
diff --git a/docs/content/docs/code-scanning-github-bot.mdx b/docs/content/docs/code-scanning-github-bot.mdx
index 0a01c1a7..b74785ca 100644
--- a/docs/content/docs/code-scanning-github-bot.mdx
+++ b/docs/content/docs/code-scanning-github-bot.mdx
@@ -3,7 +3,7 @@ title: Code Scanning GitHub Bot
sidebar_label: GitHub Bot
---
-`deepteam` can review every pull request and comment its findings as **`deepteam[bot]`**. By default the scan runs through **Claude** (the Claude Agent SDK) using your `ANTHROPIC_API_KEY`, and the comment is posted by the bot through GitHub Actions [OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect), so there are no bot tokens to store.
+`deepteam` can review every pull request and comment its findings as **`deepteam[bot]`**. By default the scan runs through **Claude Code** (the Claude Agent SDK) using your `ANTHROPIC_API_KEY`, and the comment is posted by the bot through GitHub Actions [OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect), so there are no bot tokens to store.
:::info
The workflow only needs `contents: read` and `id-token: write`, not `pull-requests: write`. The comment is posted server-side by the bot, and the OIDC token is bound to the exact repository and pull request the workflow ran for.
@@ -16,14 +16,14 @@ There are **TWO** ways to set up the bot:
- [Hosted GitHub App](/docs/code-scanning-github-bot#hosted-github-app) - install the app and it configures everything for you.
- [Manual Setup](/docs/code-scanning-github-bot#manual-setup) - add the scan workflow to your repository yourself.
-Both run the scan through **Claude** by default, which is the recommended provider. To use Codex, Cursor, or the built-in judge instead, see [Choosing a Provider](/docs/code-scanning-github-bot#choosing-a-provider).
+Both run the scan through **Claude Code** by default, which is the recommended provider. To use Codex, Cursor, or the built-in native scanner instead, see [Choosing a Provider](/docs/code-scanning-github-bot#choosing-a-provider).
## Hosted GitHub App
The quickest path is the hosted DeepTeam GitHub App, which sets everything up for you:
1. Install the app at [github.com/apps/deepteam](https://github.com/apps/deepteam), selecting the repositories you want scanned.
-2. Enter your email when redirected. The bot automatically opens a pull request that adds the scan workflow to each repository, configured for the **Claude** provider.
+2. Enter your email when redirected. The bot automatically opens a pull request that adds the scan workflow to each repository, configured for the **Claude Code** provider.
3. Merge that pull request and add an `ANTHROPIC_API_KEY` [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).
From then on, every pull request is scanned and commented on automatically.
@@ -53,11 +53,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- - run: pip install "deepteam[claude]"
+ - run: pip install "deepteam[claude-code]"
- name: Scan & comment as deepteam[bot]
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- run: deepteam scan . --provider claude --diff "origin/${{ github.base_ref }}..HEAD" --comment
+ run: deepteam scan . --provider claude-code --diff "origin/${{ github.base_ref }}..HEAD" --comment
```
Then add an `ANTHROPIC_API_KEY` repository secret and install the [DeepTeam GitHub App](https://github.com/apps/deepteam) on the repository so the bot is authorized to comment.
@@ -68,14 +68,15 @@ If your Confident AI account is in the EU region, set `CONFIDENT_BASE_URL: "http
## Choosing a Provider
-Claude is the default and recommended provider, but you can delegate the scan to another agentic harness (Codex or Cursor) or to `deepteam`'s built-in judge. Each provider uses its own SDK extra and API key:
+Claude Code is the default and recommended provider, but you can delegate the scan to another agentic harness (Codex or Cursor). Each provider uses its own SDK extra and API key:
| Provider | Install | API key |
| --- | --- | --- |
-| `claude` (default) | `pip install "deepteam[claude]"` | `ANTHROPIC_API_KEY` |
+| `claude-code` (default) | `pip install "deepteam[claude-code]"` | `ANTHROPIC_API_KEY` |
| `codex` | `pip install "deepteam[codex]"` | `OPENAI_API_KEY` |
| `cursor` | `pip install "deepteam[cursor]"` | `CURSOR_API_KEY` |
-| `deepeval` | `pip install deepteam` | `OPENAI_API_KEY` |
+
+If you don't select a provider, `deepteam` falls back to its built-in native scanner, which runs on the OpenAI API (`pip install deepteam` with an `OPENAI_API_KEY`).
To switch, change the workflow's install line, the API key, and the `--provider` flag. For example, to use Codex:
@@ -90,8 +91,8 @@ To switch, change the workflow's install line, the API key, and the `--provider`
You can also pin the provider and model in `.deepteam-code-scan.yaml` instead of passing flags:
```yaml title=".deepteam-code-scan.yaml"
-provider: claude
+provider: claude-code
model: claude-sonnet-4-5
```
-The `model` is provider-specific (e.g. `claude-sonnet-4-5` for Claude, `gpt-5.4` for Codex, `composer-2.5` for Cursor). See [provider and model configuration](/docs/code-scanning-introduction#configuration-file) for all options, and the [runnable example](https://github.com/confident-ai/deepteam/blob/main/examples/code_scan_harness_example.py) for trying each provider locally.
+The `model` is provider-specific (e.g. `claude-sonnet-4-5` for Claude Code, `gpt-5.4` for Codex, `composer-2.5` for Cursor). See [provider and model configuration](/docs/code-scanning-introduction#configuration-file) for all options, and the [runnable example](https://github.com/confident-ai/deepteam/blob/main/examples/code_scan_harness_example.py) for trying each provider locally.
diff --git a/docs/content/docs/code-scanning-introduction.mdx b/docs/content/docs/code-scanning-introduction.mdx
index bc2a64c6..60315f5c 100644
--- a/docs/content/docs/code-scanning-introduction.mdx
+++ b/docs/content/docs/code-scanning-introduction.mdx
@@ -56,7 +56,7 @@ There are **NINE** optional command line flags:
- [Optional] `-c`, `--config`: path to a config YAML. Auto-discovered at the scan root if not set.
- [Optional] `-f`, `--format`: output format, one of `markdown`, `sarif`, or `json`. Defaulted to `markdown`.
- [Optional] `--min-severity`: only report findings at or above `low`, `medium`, `high`, or `critical`.
-- [Optional] `-p`, `--provider`: scan engine, one of `codex`, `claude`, `cursor`, or `deepeval`. Defaulted to the provider inferred from the API key that is set, else `deepeval`.
+- [Optional] `-p`, `--provider`: scan engine, one of `codex`, `claude-code`, or `cursor`. Defaulted to the provider inferred from the API key that is set; if none is available, `deepteam` uses its built-in native scanner (OpenAI API).
- [Optional] `-m`, `--model`: model for the chosen provider, e.g. `gpt-4o`. Overrides the config.
- [Optional] `-o`, `--output`: write the report to a file instead of stdout.
- [Optional] `--fail-on-findings` / `--no-fail-on-findings`: exit with code `1` if any findings remain. Defaulted to `True`.
@@ -103,11 +103,11 @@ There are **EIGHT** optional parameters when creating a code scan configuration:
- [Optional] `include`: glob patterns a file must match to be scanned. Defaulted to `None`.
- [Optional] `exclude`: glob patterns to skip. Defaulted to `None`.
- [Optional] `vulnerabilities`: restrict the scan to a subset of vulnerability names. Defaulted to a curated set of code-visible categories.
-- [Optional] `provider`: scan engine, one of `codex`, `claude`, `cursor`, or `deepeval`. Defaulted to the provider inferred from the API key that is set, else `deepeval`.
+- [Optional] `provider`: scan engine, one of `codex`, `claude-code`, or `cursor`. Defaulted to the provider inferred from the API key that is set; if none is available, `deepteam` uses its built-in native scanner (OpenAI API).
- [Optional] `model`: default model for the chosen provider. Defaulted to `None`.
- [Optional] `diffs_only`: only scan changed files. Defaulted to `False`.
-To run the scan through an agentic harness instead of the built-in judge, set `provider` to `codex`, `claude`, or `cursor` and install the matching extra (for example `pip install deepteam[codex]`). If you only set the API key (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `CURSOR_API_KEY`), the provider is auto-detected, so no config change is needed.
+To run the scan through an agentic harness instead of the built-in native scanner, set `provider` to `codex`, `claude-code`, or `cursor` and install the matching extra (for example `pip install deepteam[codex]`). If you only set the API key (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `CURSOR_API_KEY`), the provider is auto-detected, so no config change is needed.
## Python API
diff --git a/examples/code_scan_harness_example.py b/examples/code_scan_harness_example.py
index 7fec6e10..47ac4965 100644
--- a/examples/code_scan_harness_example.py
+++ b/examples/code_scan_harness_example.py
@@ -3,22 +3,21 @@ Smoke-test the DeepTeam code scanner through an agentic harness, using that vend
Each harness SDK is an optional extra. Install the one you want and set its key:
- poetry add "deepteam[codex]" && export OPENAI_API_KEY=... # Codex
- poetry add "deepteam[claude]" && export ANTHROPIC_API_KEY=... # Claude Code
- poetry add "deepteam[cursor]" && export CURSOR_API_KEY=... # Cursor CLI
+ poetry add "deepteam[codex]" && export OPENAI_API_KEY=... # Codex
+ poetry add "deepteam[claude-code]" && export ANTHROPIC_API_KEY=... # Claude Code
+ poetry add "deepteam[cursor]" && export CURSOR_API_KEY=... # Cursor CLI
Then run this script, naming the provider (and optionally a model):
poetry run python examples/code_scan_harness_example.py codex
- poetry run python examples/code_scan_harness_example.py claude <model>
+ poetry run python examples/code_scan_harness_example.py claude-code <model>
poetry run python examples/code_scan_harness_example.py cursor
poetry run python examples/code_scan_harness_example.py
- poetry run python examples/code_scan_harness_example.py deepeval gpt-4o
The exact same selection works on the CLI:
poetry run deepteam scan . --provider codex
- poetry run deepteam scan . --provider claude --model <model>
+ poetry run deepteam scan . --provider claude-code --model <model>
"""
import sys
@@ -30,7 +29,7 @@ from deepteam.code_scanner import (
resolve_provider,
)
-VULNERABLE_CODE = '''\
+VULNERABLE_CODE = """\
import subprocess
@@ -39,7 +38,7 @@ def handle(llm_output: str):
subprocess.run(llm_output, shell=True)
api_key = "sk-this-should-not-be-here-1234567890"
return api_key
-'''
+"""
def main() -> None:
diff --git a/pyproject.toml b/pyproject.toml
index 48d8cc9d..871a1c54 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,7 +23,7 @@ cursor-sdk = { version = "*", optional = true, python = ">=3.10" }
[tool.poetry.extras]
codex = ["openai-codex"]
-claude = ["claude-agent-sdk"]
+claude-code = ["claude-agent-sdk"]
cursor = ["cursor-sdk"]
harnesses = ["openai-codex", "claude-agent-sdk", "cursor-sdk"]