Skip to main content

Respan Red Team

Open-source red-team engine and CLI for AI agents. It probes an agent through normal chat messages, adapts its attacks, judges the responses, and produces an OWASP-aligned report.

Only scan systems you own or have permission to test.

Install

Requires Python 3.11 or newer.

pip install respan-redteam

For development:

git clone https://github.com/respanai/respan-redteam.git
cd respan-redteam
uv sync

Connect your agent

Create adapter.py with a TARGET. A target opens conversations, and a chat sends user messages to your agent:

class Chat:
    def send(self, message: str) -> str:
        return my_agent(message)

    def transcript(self) -> list[dict]:
        return []


class Target:
    label = "my-agent"

    def open(self) -> Chat:
        return Chat()


TARGET = Target()

Complete templates are available for a local adapter and a server-owned session.

Run

The default remote scan uses Respan's hosted engine:

respan-redteam auth login
respan-redteam adapter.py -o report.json

auth login validates your Respan API key and saves it in the operating system credential manager (macOS Keychain, Windows Credential Manager, or Linux Secret Service). The CLI never writes the key to a plaintext config file. Use respan-redteam auth status or respan-redteam auth logout to inspect or remove it.

For CI and other headless environments, set RESPAN_API_KEY. You can alternatively pass --api-key, but environment variables are preferable because command arguments may be retained in shell history or exposed in process listings.

To run the engine locally, provide an OpenAI-compatible API key:

export OPENAI_API_KEY=...
respan-redteam adapter.py --local -o report.json

From a source checkout, use uv run respan-redteam. Run respan-redteam --help for output, retry, CI-grade, and connection options.

Python API

from respan_redteam import run_campaign
from adapter import TARGET

result = run_campaign(TARGET)
print(result.grade(), result.score())
print(result.to_report())

Extend

Custom prompt attacks, payload carriers, and multi-step strategies can be registered through the public extension API. See the prompts, carriers, and strategies packages.

Local model settings use OPENAI_API_KEY, optional OPENAI_BASE_URL, and the RESPAN_MODEL_* variables documented in config.py.

Development

just test

Licensed under Apache 2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_redteam-0.1.1.tar.gz (101.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

respan_redteam-0.1.1-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file respan_redteam-0.1.1.tar.gz.

File metadata

  • Download URL: respan_redteam-0.1.1.tar.gz
  • Upload date:
  • Size: 101.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respan_redteam-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1fe2c4350a8434f8d647895c37668d60405e54f0b63322a77adbbef94c7c5ccd
MD5 ff3d2f4b72abc069842dc66c62772e4d
BLAKE2b-256 8a546c372377b5a58f0665517423a36e122423a9088f3d35b00a49983c612f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_redteam-0.1.1.tar.gz:

Publisher: publish.yml on respanai/respan-redteam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file respan_redteam-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: respan_redteam-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respan_redteam-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c9c140cc91f5d60ffca20604ed199c42fc6776fd3d09bce34d09209af515798
MD5 cdc03820cea792ab62c362c4e89d37f5
BLAKE2b-256 f91f096a76eb56e01c9bb1c279207d31784cc15ee15a355b3aa615a46b81f3b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_redteam-0.1.1-py3-none-any.whl:

Publisher: publish.yml on respanai/respan-redteam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page