Skip to main content

Adaptive red-team engine and CLI for AI agents

Project description

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 adapter.py -o report.json

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.

Project details


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.0.tar.gz (87.1 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.0-py3-none-any.whl (65.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: respan_redteam-0.1.0.tar.gz
  • Upload date:
  • Size: 87.1 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.0.tar.gz
Algorithm Hash digest
SHA256 0aa33a1056d8f1e054a7c6b89dace6a8e9a07e4a04317fe39d00f1458767ebe9
MD5 6419c780e7b41192fa0591aa287e80ed
BLAKE2b-256 4e8a77948b55e07b65d8a54f419baccc3f6a9f389ae285591c2df5e16e42ffc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_redteam-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: respan_redteam-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 65.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecdf6d06953360a85559f242cf5d6e0fb4ac23faada3c48c48e9f0c064249780
MD5 571dc37164d09cd9880cd50e6e8560b8
BLAKE2b-256 4817c82dd3b5851a1b63ba3d202ea35a2b8391d02fcf112023f9b2e989c42753

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_redteam-0.1.0-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page