superred-target-chatbot
A general chatbot target for the superred red-teaming framework: it wraps any LLM reachable through litellm as a single-turn or multi-turn chatbot under test, exposing its system prompt, user message, response, and model identity as controllables/observables.
Install
pip install superred-target-chatbot
# for AWS Bedrock providers:
pip install "superred-target-chatbot[bedrock]"
Usage
from chatbot_target import ChatbotTarget, USER_TAG
target = ChatbotTarget(model="gpt-4o-mini", api_base="https://api.openai.com/v1", api_key="sk-...")
Optional keyword arguments bound the provider call: request_timeout (default
120s, passed to every call because litellm's own default is 600-6000s),
max_attempts / retry_backoff_s / retry_max_elapsed_s (bounded retries, for
transient failures only), and max_consecutive_invalid (how many unusable
injected messages in a row end the run).
Turn outcomes
Every victim turn ends in exactly one recorded outcome. A turn that produced no
victim text leaves last_response empty and appends nothing to the conversation
sent to the provider: the target never invents a reply, and never puts an empty
assistant turn on the wire (providers either delete it, silently merging the
attacker's surrounding messages, or reject it outright).
| outcome | what happened | trace |
|---|---|---|
ok |
the victim replied with text | -- |
empty |
the victim replied with a blank string | response_empty observable |
blocked |
a provider content filter suppressed the reply | response_blocked observable, blocked_turns, last_block_reason |
no_content |
the provider returned no content field at all, after retries | response_missing observable |
invalid_injection |
the injected user message was None, not a string, or blank, so nothing was sent |
invalid_user_message observable |
Anything else -- a transient failure that survives the retries, or a persistent
one (auth, context window, malformed request) -- propagates and errors the task,
because those are infrastructure failures and must stay loud. A retried attempt
emits a response_retry observable at the system tag, so a turn that cost
three provider calls is never invisible.
Because the target does not fabricate, last_response alone cannot tell these
apart: empty, blocked, no_content and invalid_injection all leave it
empty. Use the last_turn_outcome, turn_outcomes and turns_completed
queries. In particular a task should abstain rather than score 0.0 when
last_turn_outcome == "no_content" or turns_completed == "0": those runs
contain no victim reply to judge.
Credits / upstream
Original work of the superred project, released under the MIT License (see
LICENSE). It contains no third-party code and no bundled datasets. It reaches
models through litellm (MIT) and, optionally, AWS Bedrock via boto3 (Apache-2.0),
both ordinary pip dependencies.
License
MIT
Metadata
Release files for superred-target-chatbot 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| superred_target_chatbot-0.2.0.tar.gz | 28.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| superred_target_chatbot-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / superred_target_chatbot-0.2.0.tar.gz
| Download URL | superred_target_chatbot-0.2.0.tar.gz |
|---|---|
| Size | 28.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
349168567748e1ffff8d52aeb956d3ad4195e2f9cd28ebaa4e0181641b3c21fc
|
|
BLAKE2b-256 checksum How to use checksums |
b857e710615e92be6e00dfb77d520094bc9496b82eabaf35a42b459757da15be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / superred_target_chatbot-0.2.0-py3-none-any.whl
| Download URL | superred_target_chatbot-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
461a59bced58b8b49d6a79e08cffbd0126069eaba59285ef57735ee219988aa1
|
|
BLAKE2b-256 checksum How to use checksums |
a2ffd6feb76d578cc3930c20a6793df1315bc6004b06646c4bf120a60300cc0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logSecurity for superred-target-chatbot 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for superred_target_chatbot-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.