Appearance
Managing campaigns
INFERENCE RED-TEAM
This article is meant for Inference Red-Team users.
ROLES AND PERMISSIONS
To complete the tasks described in this section, make sure you have the required permissions.
CalypsoAI provides several options for you to manage your campaigns.
You can do the following:
Get a list of campaigns
When managing your campaigns, you may find it useful to see all the campaigns available in the system.
To get the list of campaigns:
Add your token value to the following sample:
pythonfrom calypsoai import CalypsoAI import json # 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 a list of all campaigns campaigns = [campaign.model_dump_json() for campaign in cai.campaigns.iterate()] # Print the response print(campaigns)
Run the script.
Analyze the response.
json[ { "attacks": [ { "converters": [ "base64", "leetspeak", "unicode_confusable", "caesar", "repeat_token", "single_character" ], "pack": "2025-05", "severity": 1, "technique": "static_content", "vector": "fictional_context_change" }, (...) ], "description": "Test Run", "id": "019744f1-5121-70d2-b315-fc31f3d62129", "name": "Test run", "orgId": null, "vendored": false }, (...) ]
LIST OF CAMPAIGNS
Our sample JSON response is a shortened version and only shows details for the
Test run
campaign. The full version shows all campaigns.
Update a campaign
After you create a campaign, you may want to update it. To update a campaign, you just need to provide the campaign ID in your request and update the campaign as described below.
You can update the following campaign properties:
- The name of the campaign
- The description of the campaign
- The attacks included in the campaign
To update a campaign:
Edit the following sample.
pythonfrom calypsoai import CalypsoAI from calypsoai.datatypes import StaticContentAttack, DynamicSingleTurnContentAttack, DynamicMultiTurnContentAttack, OperationalAttack, Vector1, Vector, PromptConverter, OperationalAttackVector # 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) # Update the campaign cai.campaigns.update( campaign='ADD-YOUR-CAMPAIGN-ID-HERE', name="ADD-YOUR-NEW-CAMPAIGN-NAME-HERE", description="ADD-YOUR-NEW-CAMPAIGN-DESCRIPTION-HERE", attacks=[ StaticContentAttack(vector=Vector1.DAN, converters=[PromptConverter.BASE64]), DynamicSingleTurnContentAttack(vector=Vector1.FICTIONAL_CONTEXT_CHANGE, converters=[PromptConverter.CAESAR]), DynamicMultiTurnContentAttack(vector=Vector.CRESCENDO, converters=[PromptConverter.LEETSPEAK]), OperationalAttack(vector=OperationalAttackVector.TLS), ] )
- Add your token value.
- In
campaign
, provide the ID of the campaign you want to update. - In
name
, provide a new name for the campaign. - In
description
, provide a new description for the campaign. - In
attacks
, provide the attacks you want to include in the campaign.
UPDATING A CAMPAIGN
The
name
,description
, andattacks
properties are all optional. In your request, you only need to include the properties that you want to update.Run the script.
If the request is successful, you receive theNone
response.THE NONE RESPONSE
Confirm the campaign is updated by checking the campaign properties in the list of campaigns.
Delete a campaign
If you no longer require a campaign, you can delete it. To delete a campaign, you just need to provide the campaign ID in your request.
To delete a campaign:
Add your token and campaign ID values to the following sample:
pythonfrom 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) # Delete the campaign cai.campaigns.delete(campaign='ADD-YOUR-CAMPAIGN-ID-HERE')
Run the script.
If the request is successful, you receive theNone
response.THE NONE RESPONSE
Confirm the campaign is deleted by searching for the campaign in the list of campaigns.