Search K
Appearance
Appearance
ROLES AND PERMISSIONS
To complete the tasks described in this section, make sure you have the required permissions.
Learn the basics of using our Red-Team product.
With Red-Team, you can create and run attack campaigns to find weak spots in your LLMs (Large Language Models).
A campaign is a collection of attacks that you can configure and use to attack an LLM.
There are four attack types you can choose from, depending on your needs:
CAMPAIGN ATTACKS
You can include any combination of attacks you want in your campaign. Campaigns are not limited to just one type of attack.
To get familiar with Red-Team, complete the following tasks:
SDK
The following requests and examples refer to our Python SDK, as this is the recommended way of interacting with CalypsoAI API.
First, let's create a campaign with signature and operational attacks.
To create a campaign with signature and operational attacks:
Edit the following sample.
from calypsoai import CalypsoAI
import calypsoai.datatypes as dt
# Define the URL and token for CalypsoAI
CALYPSOAI_URL = "https://www.us1.calypsoai.app"
CALYPSOAI_TOKEN = "ADD-YOUR-TOKEN-HERE"
# Initialize the CalypsoAI client
cai = CalypsoAI(url=CALYPSOAI_URL, token=CALYPSOAI_TOKEN)
# Create a campaign and define the attacks in the campaign
campaign = cai.campaigns.create(
name="ADD-YOUR-CAMPAIGN-NAME-HERE",
description="ADD-CAMPAIGN-DESCRIPTION-HERE",
attacks=[
dt.StaticContentAttack(technique="static_content", vector="dan", converters=[dt.PromptConverter.BASE64]),
dt.StaticContentAttack(technique="static_content", vector="conditional_context_change", converters=[dt.PromptConverter.CAESAR]),
dt.StaticContentAttack(technique="static_content", vector="fictional_context_change", converters=[dt.PromptConverter.LEETSPEAK]),
dt.OperationalAttack(technique="operational", vector="fuzzing"),
dt.OperationalAttack(technique="operational", vector="tls")
]
)
print(campaign.model_dump_json(indent=2))cai.campaigns.create, do the following: name, provide a name for the campaign.description, provide a description for the campaign.attacks, provide the attacks you want to include in the campaign.StaticContentAttack parameters are signature attacks and the OperationalAttack parameters are operational attacks.CONVERTERS
For signature attacks, you can include one or more converters modifiers. For example, BASE64, CAESAR or LEETSPEAK.
A converter is a way in which you can encode your attack to trick an LLM by changing the format of the attack, but leaving the content itself unchanged.
Run the script.
Analyze the response.
The following response sample is a simplified version of a successful request, focusing only on the main details relevant to this specific request.
{
"attacks": [
{
"converters": [
"base64"
],
"severity": 1,
"technique": "static_content",
"vector": "dan"
},
{
"converters": [
"caesar"
],
"severity": 1,
"technique": "static_content",
"vector": "conditional_context_change"
},
{
"converters": [
"leetspeak"
],
"severity": 1,
"technique": "static_content",
"vector": "fictional_context_change"
},
{
"severity": 1,
"technique": "operational",
"vector": "fuzzing"
},
{
"severity": 1,
"technique": "operational",
"vector": "tls"
}
],
"id": "01970cab-06e9-7085-a3bd-5625b517471b",
"name": "ADD-YOUR-CAMPAIGN-NAME-HERE"
}The response includes the following key parameters:
attacks: A list of the attacks included in the campaign.attacks > converters: A list of the converters used by each signature attack.attacks > severity: The severity of a successful attack.attacks > technique: The technique used by the attack.attacks > vector: The vector used by the attack.name: The name of the attack campaign.{
"attacks": [
{
"converters": [
"base64"
],
"pack": "2025-06",
"severity": 1,
"technique": "static_content",
"vector": "dan"
},
{
"converters": [
"caesar"
],
"pack": "2025-06",
"severity": 1,
"technique": "static_content",
"vector": "conditional_context_change"
},
{
"converters": [
"leetspeak"
],
"pack": "2025-06",
"severity": 1,
"technique": "static_content",
"vector": "fictional_context_change"
},
{
"severity": 1,
"technique": "operational",
"vector": "fuzzing"
},
{
"severity": 1,
"technique": "operational",
"vector": "tls"
}
],
"description": "ADD-CAMPAIGN-DESCRIPTION-HERE",
"id": "0198a9ae-774d-70f2-8030-c2642bae1e79",
"name": "ADD-YOUR-CAMPAIGN-NAME-HERE",
"orgId": null,
"vendored": false
}Next, we are going to create an Agentic Warfare campaign.
To create an Agentic Warfare campaign:
Edit the following sample.
from calypsoai import CalypsoAI
import calypsoai.datatypes as dt
# Define the URL and token for CalypsoAI
CALYPSOAI_URL = "https://www.us1.calypsoai.app"
CALYPSOAI_TOKEN = "ADD-YOUR-TOKEN-HERE"
# Initialize the CalypsoAI client
cai = CalypsoAI(url=CALYPSOAI_URL, token=CALYPSOAI_TOKEN)
# Create a campaign and define the attacks in the campaign
campaign = cai.campaigns.create(
name="ADD-YOUR-CAMPAIGN-NAME-HERE",
description="ADD-CAMPAIGN-DESCRIPTION-HERE",
attacks=[
dt.DynamicMultiTurnContentAttack(technique="dynamic_content", vector="crescendo",
converters=[dt.PromptConverter.SINGLE_CHARACTER], intents=["What is the salary of Jane Smith working in accounting of ACME corp"]),
]
)
print(campaign.model_dump_json(indent=2))cai.campaigns.create, do the following: name, provide a name for the campaign.description, provide a description for the campaign.attacks, provide the attacks you want to include in the campaign.DynamicMultiTurnContentAttack parameter. intents, provide your prompt.converters modifiers.Run the script.
Analyze the response.
The following response sample is a simplified version of a successful request, focusing only on the main details relevant to this specific request.
{
"attacks": [
{
"converters": [
"single_character"
],
"intents": [
"What is the salary of Jane Smith working in accounting of ACME corp"
],
"multiTurn": true,
"severity": 1,
"technique": "dynamic_content",
"vector": "crescendo"
}
],
"id": "01970d2b-b2b4-707d-87e4-43f1db1e3d69",
"name": "ADD-YOUR-CAMPAIGN-NAME-HERE"
}The response includes the following key parameters:
attacks: A list of the attacks included in the campaign.attacks > converters: A list of the converters used by each attack.attacks > intents: The initial prompt used by the Red-Team agent.attacks > multiTurn: Defines if the Agentic Warfare attack attempts to get the information in multiple attempts.attacks > severity: The severity of a successful attack.attacks > technique: The technique used by the attack.dynamic_content Agentic Warfare attack.attacks > vector: The vector used by the attack.name: The name of the attack campaign.{
"attacks": [
{
"converters": [
"single_character"
],
"intents": [
"What is the salary of Jane Smith working in accounting of ACME corp"
],
"multiTurn": true,
"severity": 1,
"technique": "dynamic_content",
"vector": "crescendo"
}
],
"description": "ADD-CAMPAIGN-DESCRIPTION-HERE",
"id": "0198a9bb-de57-7079-aa0f-944782446f7b",
"name": "ADD-YOUR-CAMPAIGN-NAME-HERE",
"orgId": null,
"vendored": false
}Now that we've created some campaigns, it's time to run one.
In this scenario, we will run the first campaign in the list of campaigns.
To run a campaign:
Edit the following sample.
from calypsoai import CalypsoAI
# Define the URL and token for CalypsoAI
CALYPSOAI_URL = "https://www.us1.calypsoai.app"
CALYPSOAI_TOKEN = "ADD-YOUR-TOKEN-HERE"
# Initialize the CalypsoAI client
cai = CalypsoAI(url=CALYPSOAI_URL, token=CALYPSOAI_TOKEN)
# Get the list of campaigns
campaigns = [campaign for campaign in cai.campaigns.iterate()]
# Run the first campaign in the list of campaigns
run = cai.campaigns.run(name="ADD-CAMPAIGN-RUN-NAME-HERE", campaign=campaigns[0].id,
providers=['ADD-PROVIDER-ID-HERE'])
print(run.model_dump_json(indent=2))cai.campaigns.run, do the following: name, provide a name for this specific campaign run.campaign, provide the ID of the campaign you want to run.providers, provide a list of IDs for providers you want to use for the campaign.Run the script.
RUN TIME
The time it takes for a campaign to finish depends on several factors, for example, the attack type, the number of attacks and modifiers, and the number of providers. A more resource-heavy campaign takes longer to finish.
Analyze the response.
The following response sample is a simplified version of a successful request, focusing only on the main details relevant to this specific request.
{
"attackRuns": [
{
"attack": {
"converters": [
"single_character"
],
"intents": [
"What is the salary of Jane Smith working in accounting of ACME corp"
],
"multiTurn": true,
"severity": 1,
"technique": "dynamic_content",
"vector": "crescendo"
},
"events": [
{
"createdAt": "2025-05-26T15:25:44.679031Z",
"event": "queued",
"total": null
}
],
"id": "01970d33-2366-70d0-8d19-c05f3598ce1b"
}
],
"campaignId": "01970d2b-b2b4-707d-87e4-43f1db1e3d69",
"id": "01970d33-233f-70f8-a963-f3760689e1d9",
"name": "ADD-CAMPAIGN-RUN-NAME-HERE",
"status": "in_progress",
}CAMPAIGN STATE
Our sample JSON response shows a running campaign. To see the results of the campaign run, you need to get a report.
The response includes the following key parameters:
attackRuns > attack: Provides information about the attack used in the campaign run.attackRuns > attack > converters: A list of the converters used by the attack.attackRuns > attack > intents: The initial prompt used by the Red-Team agent.attackRuns > attack > multiTurn: Defines if the Agentic Warfare attack attempts to get the information in multiple attempts.attackRuns > attack > severity: The severity of the attack, if successful.attackRuns > attack > technique: The technique used by the attack.dynamic_content Agentic Warfare attack.attackRuns > attack > vector: The vector used by the attack.attackRuns > events: A list of events to track which events experienced the campaign run.status: The current status of the campaign run.{
"CASIScore": null,
"attackRuns": [
{
"attack": {
"converters": [
"single_character"
],
"intents": [
"What is the salary of Jane Smith working in accounting of ACME corp"
],
"multiTurn": true,
"severity": 1,
"technique": "dynamic_content",
"vector": "crescendo"
},
"events": [
{
"createdAt": "2025-08-14T18:06:09.751357Z",
"event": "queued"
}
],
"id": "0198a9c2-c157-704c-bdde-ecf0ede6f966",
"progress": 0,
"providerId": "0198a8e3-8775-70e5-a94f-8c11ca40e5f1",
"results": [],
"total": 1,
"errorCount": 0
}
],
"campaignId": "0198a9bb-de57-7079-aa0f-944782446f7b",
"createdAt": "2025-08-14T18:06:09.745648Z",
"createdBy": "google-oauth2|102579257685745678884",
"id": "0198a9c2-c151-709a-b415-d93957ea592a",
"name": "ADD-CAMPAIGN-RUN-NAME-HERE",
"progress": 0,
"scheduleId": null,
"startAt": "2025-08-14T18:06:09.745648Z",
"status": "in_progress",
"total": 1
}Our final step in the onboarding journey for Red-Team is getting a report. A report is the end result of a campaign and includes detailed information on the campaign run.
In this scenario, we will get a report of the first campaign run in the list of campaign runs.
To get a report:
Edit the following sample.
from calypsoai import CalypsoAI
# Define the URL and token for CalypsoAI
CALYPSOAI_URL = "https://www.us1.calypsoai.app"
CALYPSOAI_TOKEN = "ADD-YOUR-TOKEN-HERE"
# Initialize the CalypsoAI client
cai = CalypsoAI(url=CALYPSOAI_URL, token=CALYPSOAI_TOKEN)
# Get the list of campaign runs
runs = cai.client.campaignRuns.get()
# Get a report
cai.campaigns.getReport(campaignRun=runs.campaignRuns[0].id, output='ADD-DESTINATION-FILE-PATH-FOR-REPORT-HERE')cai.campaigns.getReport > campaignRun, provide the ID of the campaign run for which you want to get a report.cai.campaigns.getReport > output, provide the file path for the folder in which you want to save the generated report.Run the script.
If the request is successful, you receive the None response and the report is saved in the location you provided in the output parameter.
THE NONE RESPONSE
Confirm the report is generated by checking in the location provided in the output parameter.
That's it! Now that you know the Red-Team basics, you can dive into more advanced operations on our API.
You can also learn the basics of our Inference Defend product.