Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

pyrit.executor.attack

Attack executor module.

Functions

attack_outcome_from_score

attack_outcome_from_score(score: Score) → AttackOutcome

Map an objective score onto the outcome it justifies.

This is the attack-side contract for undetermined scores, stated once so no attack invents its own. An undetermined score is neither achievement nor refutation, so it never reads as failure; an attack that ends on one ends undetermined.

ParameterTypeDescription
scoreScoreThe objective score to read.

Returns:

generate_simulated_conversation_async

generate_simulated_conversation_async(objective: str, adversarial_chat: PromptTarget, objective_scorer: TrueFalseScorer, num_turns: int = 3, starting_sequence: int = 0, adversarial_chat_system_prompt: SeedPrompt | None = None, simulated_target_system_prompt: SeedPrompt | None = None, next_message_system_prompt: SeedPrompt | None = None, adversarial_chat_system_prompt_path: str | Path | None = None, simulated_target_system_prompt_path: str | Path | None = None, next_message_system_prompt_path: str | Path | None = None, attack_converter_config: AttackConverterConfig | None = None, memory_labels: dict[str, str] | None = None) → SimulatedConversationResult

Generate a simulated conversation between an adversarial chat and a target.

This utility runs a RedTeamingAttack with score_last_turn_only=True against a simulated target (the same LLM as adversarial_chat, optionally configured with a system prompt). The resulting prompts and their source conversation references are returned together so downstream attacks can preserve the simulation lineage.

Use cases:

ParameterTypeDescription
objectivestrThe objective for the adversarial chat to work toward.
adversarial_chatPromptTargetThe adversarial LLM that generates attack prompts. This same LLM is also used as the simulated target.
objective_scorerTrueFalseScorerScorer to evaluate the final turn.
num_turnsintNumber of conversation turns to generate. Defaults to 3.
starting_sequenceintThe starting sequence number for the generated SeedPrompts. Each message gets an incrementing sequence number. Defaults to 0.
adversarial_chat_system_promptSeedPrompt | NoneSystem prompt for the adversarial chat. Required unless the deprecated path input is used. Defaults to None.
simulated_target_system_promptSeedPrompt | NoneSystem prompt for the simulated target. If None, no system prompt is used for the simulated target. Defaults to None.
next_message_system_promptSeedPrompt | NoneOptional system prompt for generating a final user message. If provided, after the simulated conversation, a single LLM call generates a user message that attempts to get the target to fulfill the objective in their next response. The prompt template receives objective and conversation_context parameters. Defaults to None.
adversarial_chat_system_prompt_pathstr | Path | NoneDeprecated. Path to the adversarial chat system prompt YAML. Use adversarial_chat_system_prompt instead. Defaults to None.
simulated_target_system_prompt_pathstr | Path | NoneDeprecated. Path to the simulated target system prompt YAML. Use simulated_target_system_prompt instead. Defaults to None.
next_message_system_prompt_pathstr | Path | NoneDeprecated. Path to the next message system prompt YAML. Use next_message_system_prompt instead. Defaults to None.
attack_converter_configAttackConverterConfig | NoneConverter configuration for the attack. Defaults to None.
memory_labelsdict[str, str] | NoneLabels to associate with the conversation in memory. Defaults to None.

Returns:

Raises:

Examples:

get_lazy_dir

get_lazy_dir(module_globals: dict[str, Any], exports: Mapping[str, LazyExport]) → list[str]

Return package attributes and unresolved public exports.

ParameterTypeDescription
module_globalsdict[str, Any]The package globals.
exportsMapping[str, LazyExport]Public names and their implementation locations.

Returns:

resolve_lazy_export

resolve_lazy_export(name: str, module_name: str, module_globals: dict[str, Any], exports: Mapping[str, LazyExport]) → Any

Resolve and cache one package export.

ParameterTypeDescription
namestrPublic attribute requested from the package.
module_namestrPackage name used in an AttributeError.
module_globalsdict[str, Any]Package globals where the resolved value is cached.
exportsMapping[str, LazyExport]Public names and their implementation locations.

Returns:

Raises:

AttackAdversarialConfig

Adversarial configuration for attacks that involve adversarial chat targets.

This class defines the configuration for attacks that utilize an adversarial chat target, including the target chat model, system prompt, and seed prompt for the attack.

Examples:

AttackContext

Bases: StrategyContext, ABC, Generic[AttackParamsT]

Base class for all attack contexts.

This class holds both the immutable attack parameters and the mutable execution state. The params field contains caller-provided inputs, while other fields track execution progress.

Attacks that generate certain values internally (e.g., a simulated-conversation technique generates next_message and prepended_conversation) can set the mutable override fields (_next_message_override, _prepended_conversation_override) during _setup_async.

AttackConverterConfig

Bases: StrategyConverterConfig

Configuration for converters used in attacks.

This class defines the converter configurations that transform prompts during the attack process, both for requests and responses.

Examples:

AttackExecutor

Manages the execution of attack strategies with support for parallel execution.

The AttackExecutor provides controlled execution of attack strategies with concurrency limiting. It uses the attack’s params_type to create parameters from seed groups.

Constructor Parameters:

ParameterTypeDescription
max_concurrencyintMaximum number of concurrent attack executions (default: 1). A single asyncio.Semaphore of this size is used internally to gate both parameter-building (from_seed_group_async) and execution. Sharing one AttackExecutor across multiple call sites therefore shares a single concurrency budget across all of them. Defaults to 1.

Examples:

Methods:

execute_attack_async

execute_attack_async(attack: AttackStrategy[AttackStrategyContextT, AttackStrategyResultT], objectives: Sequence[str], field_overrides: Sequence[dict[str, Any]] | None = None, return_partial_on_failure: bool = False, attribution: AttackResultAttribution | None = None, broadcast_fields: Any = {}) → AttackExecutorResult[AttackStrategyResultT]

Execute attacks in parallel for each objective.

Creates AttackParameters directly from objectives and field values.

ParameterTypeDescription
attackAttackStrategy[AttackStrategyContextT, AttackStrategyResultT]The attack strategy to execute.
objectivesSequence[str]List of attack objectives.
field_overridesSequence[dict[str, Any]] | NoneOptional per-objective field overrides. If provided, must match the length of objectives. Defaults to None.
return_partial_on_failureboolIf True, returns partial results when some objectives fail. If False (default), raises the first exception.
attributionAttackResultAttribution | NoneOptional AttackResultAttribution stamped onto every per-task AttackContext so the persistence path can record orchestrator linkage. When None, no attribution is applied. Defaults to None.
**broadcast_fieldsAnyFields applied to all objectives (e.g., memory_labels). Per-objective field_overrides take precedence. Defaults to {}.

Returns:

Raises:

execute_attack_from_seed_groups_async

execute_attack_from_seed_groups_async(attack: AttackStrategy[AttackStrategyContextT, AttackStrategyResultT], seed_groups: Sequence[AttackSeedGroup], adversarial_chat: PromptTarget | None = None, objective_scorer: TrueFalseScorer | None = None, field_overrides: Sequence[dict[str, Any]] | None = None, return_partial_on_failure: bool = False, attribution: AttackResultAttribution | None = None, attributions: Sequence[AttackResultAttribution] | None = None, atomic_attack_identifiers: Sequence[AtomicAttackIdentifier] | None = None, result_metadata: Sequence[Mapping[str, Any]] | None = None, broadcast_fields: Any = {}) → AttackExecutorResult[AttackStrategyResultT]

Execute attacks in parallel, extracting parameters from AttackSeedGroups.

Uses the attack’s params_type.from_seed_group() to extract parameters, automatically handling which fields the attack accepts.

ParameterTypeDescription
attackAttackStrategy[AttackStrategyContextT, AttackStrategyResultT]The attack strategy to execute.
seed_groupsSequence[AttackSeedGroup]AttackSeedGroups containing objectives and optional prompts.
adversarial_chatPromptTarget | NoneOptional chat target for generating adversarial prompts or simulated conversations. Required when seed groups contain SeedSimulatedConversation configurations. Defaults to None.
objective_scorerTrueFalseScorer | NoneOptional scorer for evaluating simulated conversations. Required when seed groups contain SeedSimulatedConversation configurations. Defaults to None.
field_overridesSequence[dict[str, Any]] | NoneOptional per-seed-group field overrides. If provided, must match the length of seed_groups. Each dict is passed to from_seed_group() as overrides. Defaults to None.
return_partial_on_failureboolIf True, executes successfully constructed objectives and returns parameter-build or execution failures alongside completed results. If False (default), a parameter-build failure suppresses execution and raises the first exception by input order.
attributionAttackResultAttribution | NoneOptional AttackResultAttribution stamped onto every per-task AttackContext so the persisted AttackResultEntry row carries attribution_parent_id + attribution_data. When None (default), no attribution is applied. The same attribution is shared across all tasks; per-task identity is reconstructed from the row’s own objective_sha256.
attributionsSequence[AttackResultAttribution] | NoneOptional per-seed-group attribution. Must match seed_groups and cannot be combined with attribution. Defaults to None.
atomic_attack_identifiersSequence[AtomicAttackIdentifier] | NonePer-input caller-prepared behavioral and source identities, recorded before persistence without changing the attack’s strategy identity. Defaults to None.
result_metadataSequence[Mapping[str, Any]] | NonePer-input caller-prepared metadata copied onto success and error results. Defaults to None.
**broadcast_fieldsAnyFields applied to all seed groups (e.g., memory_labels). Per-seed-group field_overrides take precedence. Defaults to {}.

Returns:

Raises:

AttackExecutorResult

Bases: Generic[AttackResultT]

Result container for attack execution, supporting both full and partial completion.

This class holds results from parallel attack execution. It is iterable and behaves like a list in the common case where all objectives complete successfully.

When some objectives don’t complete (throw exceptions), access incomplete_objectives to retrieve the failures, or use raise_if_incomplete() to raise the first exception.

Note: “completed” means the execution finished, not that the attack objective was achieved.

Methods:

get_results

get_results() → list[AttackResultT]

Get completed results, raising if any incomplete.

Returns:

raise_if_incomplete

raise_if_incomplete() → None

Raise the first exception if any objectives are incomplete.

AttackParameters

Immutable parameters for attack execution.

This class defines the standard contract for attack parameters. All attacks at a given level of the hierarchy share the same parameter signature.

Attacks that don’t accept certain parameters should use the excluding() factory to create a derived params type without those fields. Attacks that need additional parameters should extend this class with new fields.

Examples:

Methods:

excluding

excluding(field_names: str = ()) → type[AttackParameters]

Create a new AttackParameters subclass that excludes the specified fields.

This factory method creates a frozen dataclass without the specified fields. The resulting class inherits the from_seed_group() behavior and will raise if excluded fields are passed as overrides.

ParameterTypeDescription
*field_namesstrNames of fields to exclude from the new params type. Defaults to ().

Returns:

Raises:

from_seed_group_async

from_seed_group_async(seed_group: AttackSeedGroup, adversarial_chat: PromptTarget | None = None, objective_scorer: TrueFalseScorer | None = None, overrides: Any = {}) → AttackParamsT

Create an AttackParameters instance from a AttackSeedGroup.

Extracts standard fields from the seed group and applies any overrides. If the seed_group has a simulated conversation config, generates the simulated conversation using the provided adversarial_chat and scorer.

ParameterTypeDescription
seed_groupAttackSeedGroupThe seed attack group to extract parameters from.
adversarial_chatPromptTarget | NoneThe adversarial chat target for generating simulated conversations. Required if seed_group has a simulated conversation config. Defaults to None.
objective_scorerTrueFalseScorer | NoneThe scorer for evaluating simulated conversations. Required if seed_group has a simulated conversation config. Defaults to None.
**overridesAnyField overrides to apply. Must be valid fields for this params type. Defaults to {}.

Returns:

Raises:

AttackScoringConfig

Scoring configuration for evaluating attack effectiveness.

This class defines the scoring components used to evaluate attack effectiveness, detect refusals, and perform auxiliary scoring operations.

Examples:

AttackStrategy

Bases: Strategy[AttackStrategyContextT, AttackStrategyResultT], Identifiable, ABC

Abstract base class for attack strategies. Defines the interface for executing attacks and handling results.

Subclasses must use the keyword-only constructor shape (def __init__(self, *, ...)); the contract is enforced at class definition time via enforce_keyword_only_init. See .github/instructions/attacks.instructions.md for the full contract.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack.
context_typetype[AttackStrategyContextT]The type of context this strategy operates on.
params_typetype[AttackParamsT]The type of parameters this strategy accepts. Defaults to AttackParameters. Use AttackParameters.excluding() to create a params type that rejects certain fields.
prepended_conversation_configPrependedConversationConfig | NonePolicy for prepended conversations. Controls converter role scope and target-facing history formatting. Defaults to None.
loggerlogging.LoggerLogger instance for logging events. Defaults to logger.

Methods:

execute_async

execute_async(kwargs: Any = {}) → AttackStrategyResultT

Execute the attack strategy asynchronously with the provided parameters.

This method provides a stable contract for all attacks. The signature includes all standard parameters (objective, expectation, next_message, prepended_conversation, memory_labels). Attacks that don’t accept certain parameters will raise ValueError if those parameters are provided.

ParameterTypeDescription
objectivestrThe objective of the attack.
expectationScoringExpectation | NonePer-execution scoring criteria. Missing scoring context defaults to the attack objective without changing supplied conditions.
next_messageMessage | NoneMessage to send to the target. Defaults to None.
prepended_conversationlist[Message] | NoneConversation to prepend. Defaults to None.
memory_labelsdict[str, str] | NoneMemory labels for the attack context. Defaults to None.
persist_attack_resultboolWhether to persist the completed or error attack result. Messages produced during execution are persisted independently. Defaults to True.
**kwargsAnyAdditional context-specific parameters (conversation_id, metadata, etc.). Defaults to {}.

Returns:

Raises:

execute_with_context_async

execute_with_context_async(context: AttackStrategyContextT) → AttackStrategyResultT

Execute an attack and persist its completed result after teardown.

ParameterTypeDescription
contextAttackStrategyContextTThe attack execution context.

Returns:

Raises:

get_adversarial_prompt_requirements

get_adversarial_prompt_requirements() → AdversarialPromptRequirements

Get the prompt contract declared by an adversarial attack.

Returns:

Raises:

get_attack_adversarial_config

get_attack_adversarial_config() → AttackAdversarialConfig | None

Get the attack adversarial configuration used by this strategy.

Returns:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

get_objective_target

get_objective_target() → PromptTarget

Get the objective target for this attack strategy.

Returns:

get_request_converters

get_request_converters() → list[Any]

Get request converter configurations used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate configuration independent of execution inputs.

Subclasses reuse their constructor checks here for deferred registry construction. Validators must not construct components, perform I/O, or require execution targets or scorers.

BargeInAttack

Bases: AttackStrategy['BargeInAttackContext[Any]', AttackResult]

Streaming attack that drives a Realtime API session with server VAD + barge-in.

The attack pushes user audio chunks through the target, lets server VAD detect turn boundaries, manually fires response.create after each commit, and observes assistant turns (including interrupted ones) via per-turn futures returned by the target’s request_response_async.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetTarget to attack. Must declare the STREAMING_AUDIO capability (today only RealtimeTarget does). Defaults to REQUIRED_VALUE.
attack_converter_configAttackConverterConfig | NoneConverters applied to each committed user turn. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer used to apply converters and persist messages. Defaults to a fresh PromptNormalizer.
params_typetype[AttackParamsT]Attack parameter dataclass type. Defaults to AttackParameters.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for prepended-conversation converter-role selection. Its message formatter is not used by the direct realtime streaming path. Defaults to None.

BargeInAttackContext

Bases: AttackContext[AttackParamsT]

Context for a streaming barge-in attack with an audio chunk source.

prepended_conversation (inherited from AttackContext) is persisted to memory on setup, but only the leading system message is propagated to the live realtime session as session instructions. User / assistant turns from the prepended history are not pushed through conversation.item.create, so the model conditions only on the system prompt plus live audio chunks.

ChunkedRequestAttack

Bases: MultiTurnAttackStrategy[ChunkedRequestAttackContext, AttackResult]

Implementation of chunked extraction attack strategy.

This class orchestrates a multi-turn attack where protected information is requested in chunks/segments across multiple turns. This technique bypasses length-based filters or output truncation by asking for specific character ranges of a secret value.

This technique was discovered during CTF red teaming exercises where targets would reveal portions of secrets when asked for specific segments, even when they refused to reveal the complete value.

The attack flow consists of:

  1. Generating chunk request prompts based on the configured strategy.

  2. Sending each chunk request to the target system sequentially.

  3. Collecting responses from each chunk request.

  4. Combining all chunk responses to reconstruct the full value.

  5. Evaluating the combined result with scorers if configured.

  6. Returning the attack result with achievement status.

The strategy supports customization through converters and scorers for comprehensive evaluation.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
chunk_sizeintSize of each chunk to request (default: 50). Defaults to 50.
total_lengthintEstimated total length of the target value (default: 200). Defaults to 200.
chunk_typestrType of chunk to request (e.g., “characters”, “bytes”, “words”). Defaults to 'characters'.
request_templatestrTemplate for generating chunk requests (default: “Give me {chunk_type} {start}-{end} of ‘{objective}’”). Defaults to DEFAULT_TEMPLATE.
attack_converter_configAttackConverterConfig | NoneConfiguration for converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for scoring components. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer for handling prompts. Defaults to None.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for prepended-conversation conversion and target-facing formatting. Defaults to None.

Examples:

Methods:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate chunk bounds and template fields without constructing an attack.

Raises:

ChunkedRequestAttackContext

Bases: MultiTurnAttackContext[Any]

Context for the ChunkedRequest attack strategy.

ConversationManager

Manages conversations for attacks, handling message history, system prompts, and conversation state.

This class provides methods to:

Constructor Parameters:

ParameterTypeDescription
prompt_normalizerPromptNormalizer | NoneOptional prompt normalizer for converting prompts. If not provided, a default PromptNormalizer instance will be created. Defaults to None.

Methods:

add_prepended_conversation_to_memory_async

add_prepended_conversation_to_memory_async(prepended_conversation: list[Message], conversation_id: str, request_converters: list[ConverterConfiguration] | None = None, prepended_conversation_config: PrependedConversationConfig | None = None, max_turns: int | None = None, target_identifier: ComponentIdentifier | None = None, target: PromptTarget | None = None) → int

Add prepended conversation messages to memory for a target.

This is a lower-level method that handles adding messages to memory without modifying any attack context state. It can be called directly by attacks that manage their own state (like TAP nodes) or internally by initialize_context_async for standard attacks.

Messages are added with:

ParameterTypeDescription
prepended_conversationlist[Message]Messages to add to memory.
conversation_idstrConversation ID to assign to all messages.
request_converterslist[ConverterConfiguration] | NoneOptional converters to apply to messages. Defaults to None.
prepended_conversation_configPrependedConversationConfig | NoneOptional configuration for converter roles. Defaults to None.
max_turnsint | NoneIf provided, validates that turn count doesn’t exceed this limit. Defaults to None.
target_identifierComponentIdentifier | NoneThe target the conversation is held with, if known. Recorded once per conversation. Defaults to None.
targetPromptTarget | NoneTarget that will receive the first live request. Defaults to None.

Returns:

Raises:

create_prepended_history_send_context

create_prepended_history_send_context(target: PromptTarget, conversation_id: str, prepended_messages: list[Message]) → PrependedHistorySendContext | None

Build persisted-prefix state for a target without editable history.

Returns:

get_conversation

get_conversation(conversation_id: str) → list[Message]

Retrieve a conversation by its ID.

ParameterTypeDescription
conversation_idstrThe ID of the conversation to retrieve.

Returns:

get_conversation_async

get_conversation_async(conversation_id: str) → list[Message]

Retrieve a conversation by its ID.

ParameterTypeDescription
conversation_idstrThe ID of the conversation to retrieve.

Returns:

get_last_message

get_last_message(conversation_id: str, role: ChatMessageRole | None = None) → MessagePiece | None

Retrieve the most recent message from a conversation.

ParameterTypeDescription
conversation_idstrThe ID of the conversation to retrieve from.
roleChatMessageRole | NoneIf provided, return only the last message matching this role. Defaults to None.

Returns:

get_last_message_async

get_last_message_async(conversation_id: str, role: ChatMessageRole | None = None) → MessagePiece | None

Retrieve the most recent message from a conversation.

ParameterTypeDescription
conversation_idstrThe ID of the conversation to retrieve from.
roleChatMessageRole | NoneIf provided, return only the last message matching this role. Defaults to None.

Returns:

get_persistable_prepended_messages

get_persistable_prepended_messages(prepended_conversation: list[Message]) → list[Message]

Return prepended messages that can be recovered from memory at send time.

ParameterTypeDescription
prepended_conversationlist[Message]Candidate prepended messages.

Returns:

initialize_context_async

initialize_context_async(context: AttackContext[Any], target: PromptTarget, conversation_id: str, request_converters: list[ConverterConfiguration] | None = None, prepended_conversation_config: PrependedConversationConfig | None = None, max_turns: int | None = None, memory_labels: dict[str, str] | None = None) → ConversationState

Initialize attack context with prepended conversation and merged labels.

This is the primary method for setting up an attack context. It:

  1. Merges memory_labels from attack strategy with context labels

  2. Persists prepended_conversation structurally with role-scoped converters

  3. Updates context.executed_turns for multi-turn attacks

For all PromptTarget types, prepended messages are added to memory with simulated_assistant roles and new UUIDs.

ParameterTypeDescription
contextAttackContext[Any]The attack context to initialize.
targetPromptTargetThe objective target for the conversation.
conversation_idstrUnique identifier for the conversation.
request_converterslist[ConverterConfiguration] | NoneConverters to apply to messages. Defaults to None.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for handling prepended conversation. Defaults to None.
max_turnsint | NoneMaximum turns allowed (for validation and state tracking). Defaults to None.
memory_labelsdict[str, str] | NoneLabels from the attack strategy to merge with context labels. Defaults to None.

Returns:

Raises:

set_system_prompt

set_system_prompt(target: PromptTarget, conversation_id: str, system_prompt: str) → None

Set or update the system prompt for a conversation.

ParameterTypeDescription
targetPromptTargetThe target to set the system prompt on. Must handle the SYSTEM_PROMPT capability (natively or via an ADAPT policy).
conversation_idstrUnique identifier for the conversation.
system_promptstrThe system prompt text.

Raises:

set_system_prompt_async

set_system_prompt_async(target: PromptTarget, conversation_id: str, system_prompt: str) → None

Set or update the system prompt for a conversation.

ParameterTypeDescription
targetPromptTargetThe target to set the system prompt on. Must handle the SYSTEM_PROMPT capability (natively or via an ADAPT policy).
conversation_idstrUnique identifier for the conversation.
system_promptstrThe system prompt text.

Raises:

ConversationSession

Session for conversations.

ConversationState

Container for conversation state data returned from context initialization.

CrescendoAttack

Bases: MultiTurnAttackStrategy[CrescendoAttackContext, CrescendoAttackResult]

Implementation of the Crescendo attack strategy.

The Crescendo Attack is a multi-turn strategy that progressively guides the model to generate harmful content through small, benign steps. It leverages the model’s recency bias, pattern-following tendency, and trust in self-generated text.

The attack flow consists of:

  1. Generating progressively harmful prompts using an adversarial chat model.

  2. Sending prompts to the target and evaluating responses for refusal.

  3. Backtracking when the target refuses to respond.

  4. Scoring responses to determine if the objective has been achieved.

  5. Continuing until the objective is met or maximum turns/backtracks are reached.

You can learn more about the Crescendo attack Russinovich et al., 2024.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Must support editable conversation history. Defaults to REQUIRED_VALUE.
attack_adversarial_configAttackAdversarialConfigConfiguration for the adversarial component, including the adversarial chat target and optional system prompt path.
attack_converter_configAttackConverterConfig | NoneConfiguration for attack converters, including request and response converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for scoring responses. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer for prompts. Defaults to None.
max_backtracksintMaximum number of backtracks allowed. Defaults to 10.
max_turnsintMaximum number of turns allowed. Defaults to 10.
prepended_conversation_configPrependedConversationConfiguration | NoneConfiguration for how to process prepended conversations. Controls converter application by role and request formatting for targets without editable history. Defaults to None.

Examples:

Methods:

get_attack_adversarial_config

get_attack_adversarial_config() → AttackAdversarialConfig | None

Get the effective adversarial configuration used by this strategy.

Returns:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate search bounds without constructing an attack.

Raises:

CrescendoAttackContext

Bases: MultiTurnAttackContext[Any]

Context for the Crescendo attack strategy.

CrescendoAttackResult

Bases: AttackResult

Result of the Crescendo attack strategy execution.

ManyShotJailbreakAttack

Bases: PromptSendingAttack

Implement the Many Shot Jailbreak method Anthropic, 2024.

Prepends the seed prompt with a faux dialogue between a human and an AI, using examples from a dataset to demonstrate successful jailbreaking attempts. This method leverages the model’s ability to learn from examples to bypass safety measures.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_converter_config(AttackConverterConfig, Optional)Configuration for the converters. Defaults to None.
attack_scoring_config(AttackScoringConfig, Optional)Configuration for scoring components. Defaults to None.
prompt_normalizer(PromptNormalizer, Optional)Normalizer for handling prompts. Defaults to None.
max_attempts_on_failure(int, Optional)Maximum number of attempts to retry on failure. Defaults to 0.
example_countintThe number of examples to include from many_shot_examples or the Many Shot Jailbreaking dataset. Must be a positive integer. Defaults to the first 100.
many_shot_examples(list[dict[str, str]], Optional)The many shot jailbreaking examples to use. If not provided, takes the first example_count examples from Many Shot Jailbreaking dataset. Defaults to None.

Examples:

Methods:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate the supplied example selection without loading the default dataset.

Raises:

MultiPromptSendingAttack

Bases: MultiTurnAttackStrategy[MultiTurnAttackContext[Any], AttackResult]

Implementation of multi-prompt sending attack strategy.

This class orchestrates a multi-turn attack where a series of predefined malicious prompts are sent sequentially to try to achieve a specific objective against a target system. The strategy evaluates the final target response using optional scorers to determine if the objective has been met.

The attack flow consists of:

  1. Sending each predefined prompt to the target system in sequence.

  2. Continuing until all predefined prompts are sent.

  3. Evaluating the final response with scorers if configured.

  4. Returning the attack result with achievement status.

Note: This attack always runs all predefined prompts regardless of whether the objective is achieved early in the sequence.

The strategy supports customization through prepended conversations, converters, and multiple scorer types for comprehensive evaluation.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_converter_configAttackConverterConfig | NoneConfiguration for converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for scoring components. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer for handling prompts. Defaults to None.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for prepended-conversation conversion and target-facing formatting. Defaults to None.

Examples:

Methods:

execute_async

execute_async(kwargs: Any = {}) → AttackResult

Execute the attack strategy asynchronously with the provided parameters.

Returns:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

MultiPromptSendingAttackParameters

Bases: AttackParameters

Parameters for MultiPromptSendingAttack.

Extends AttackParameters to include user_messages field for multi-turn attacks. Seed preparation accepts objective, user_messages, memory_labels, operation_id, and expectation, and carries the seed group’s harm categories into targeted_harm_categories.

Methods:

from_seed_group_async

from_seed_group_async(seed_group: AttackSeedGroup, adversarial_chat: PromptTarget | None = None, objective_scorer: TrueFalseScorer | None = None, overrides: Any = {}) → MultiPromptSendingAttackParameters

Create parameters from a SeedGroup, extracting user messages.

ParameterTypeDescription
seed_groupAttackSeedGroupThe seed group to extract parameters from.
adversarial_chatPromptTarget | NoneNot used by this attack type. Defaults to None.
objective_scorerTrueFalseScorer | NoneNot used by this attack type. Defaults to None.
**overridesAnyField overrides to apply. Defaults to {}.

Returns:

Raises:

MultiTurnAttackContext

Bases: AttackContext[AttackParamsT]

Context for multi-turn attacks.

Holds execution state for multi-turn attacks. The immutable attack parameters (objective, next_message, prepended_conversation, memory_labels) are stored in the params field inherited from AttackContext.

MultiTurnAttackStrategy

Bases: AttackStrategy[MultiTurnAttackStrategyContextT, AttackStrategyResultT], ABC

Strategy for executing multi-turn attacks. This strategy is designed to handle attacks that consist of multiple turns of interaction with the target model.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack.
context_typetype[MultiTurnAttackContext]The type of context this strategy will use.
params_typetype[AttackParamsT]The type of parameters this strategy accepts. Defaults to AttackParameters.
prepended_conversation_configPrependedConversationConfig | NonePolicy for prepended conversations. See AttackStrategy. Defaults to None.
loggerlogging.LoggerLogger instance for logging events and messages. Defaults to logger.

PAIRAttack

Bases: TreeOfAttacksWithPruningAttack

Implement the Prompt Automatic Iterative Refinement (PAIR) attack strategy Chao et al., 2023.

PAIR is a structural special case of Tree of Attacks with Pruning Mehrotra et al., 2023: parallel “streams” of single-branch iterative refinement, with no tree expansion and no off-topic pruning. PyRIT implements PAIR as a thin subclass of TreeOfAttacksWithPruningAttack that hardcodes the two definitional structural parameters (branching_factor=1 and on_topic_checking_enabled=False) and reuses TAP’s adversarial system prompt. The remaining configuration (target, scoring, converters, width and depth budget) is exposed exactly as on TAP, with TAP’s defaults preserved for tree_width (number of parallel streams) and tree_depth (refinement iterations per stream).

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_adversarial_configAttackAdversarialConfigConfiguration for the adversarial chat component.
attack_converter_configAttackConverterConfig | NoneConfiguration for attack converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneScoring configuration. The objective scorer’s verdict decides success, and it must keep a float value on each verdict, as FloatScaleThresholdScorer does. If not provided, a default FloatScaleThresholdScorer wrapping SelfAskScaleScorer (threshold 0.7) is created. Defaults to None.
prompt_normalizerPromptNormalizer | NoneThe prompt normalizer to use. Defaults to None.
tree_widthintNumber of parallel “streams” (N in the PAIR paper). Defaults to 3.
tree_depthintMaximum refinement iterations per stream (K in the PAIR paper). Defaults to 5.
desired_response_prefixstrExpected prefix for successful responses. Defaults to “Sure, here is”.
batch_sizeintNumber of nodes to process in parallel per batch. Defaults to 10.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for prepended-conversation handling. Defaults to None.

PrependedConversationConfig

Configuration for controlling how prepended conversations are processed before being sent to the objective target.

This class provides control over:

Prepended messages remain role-structured in memory. Request converters are applied to configured roles before a target without editable history renders that history and the applicable live request together (via message_normalizer; default: ConversationContextNormalizer). Those converters must produce text because string normalization cannot preserve converted image, audio, or other non-text output.

Methods:

get_message_normalizer

get_message_normalizer() → MessageStringNormalizer

Get the normalizer for objective target context, with a default fallback.

Returns:

get_normalizer_overrides

get_normalizer_overrides(target: PromptTarget, prepended_history_send_context: PrependedHistorySendContext | None) → dict[CapabilityName, MessageListNormalizer[Message]]

Build per-send target normalizer overrides for prepended history.

ParameterTypeDescription
targetPromptTargetTarget that receives the live request.
prepended_history_send_contextPrependedHistorySendContext | NoneExplicit persisted seed boundary for this attack execution.

Returns:

PromptSendingAttack

Bases: SingleTurnAttackStrategy

Implementation of single-turn prompt sending attack strategy.

This class orchestrates a single-turn attack where malicious prompts are injected to try to achieve a specific objective against a target system. The strategy evaluates the target response using optional scorers to determine if the objective has been met.

The attack flow consists of:

  1. Preparing the prompt based on the objective.

  2. Sending the prompt to the target system through optional converters.

  3. Evaluating the response with scorers if configured.

  4. Retrying on failure up to the configured number of retries.

  5. Returning the attack result with achievement status.

The strategy supports customization through prepended conversations, converters, and multiple scorer types for comprehensive evaluation.

A target that never replies (supports_responses=False, e.g. TextTarget) is supported: the sent request is never scored as a response, and only scorers that judge side effects (e.g. a written file or invoked tools) decide the outcome.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_converter_configAttackConverterConfig | NoneConfiguration for converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for scoring components. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer for handling prompts. Defaults to None.
max_attempts_on_failureintMaximum number of attempts to retry on failure. Converter randomness is scoped per attempt and is reproducible with a configured root seed. Defaults to 0.
params_typetype[AttackParamsT]The type of parameters this strategy accepts. Defaults to PromptSendingAttackParameters. Use AttackParameters.excluding() to create a params type that rejects certain fields.
prepended_conversation_configPrependedConversationConfiguration | NoneConfiguration for how to process prepended conversations. Controls converter application by role and request formatting for targets without editable history. Request converters apply to prepended user messages by default; include "assistant" explicitly to transform simulated assistant history. Defaults to None.

Examples:

Methods:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate the retry bound without constructing an attack.

Raises:

PromptSendingAttackParameters

Bases: AttackParameters

Parameters for prompt sending, including simulated-conversation preparation state.

RTASystemPromptPaths

Bases: enum.Enum

Enum for predefined red teaming attack system prompt paths.

Examples:

RedTeamingAttack

Bases: MultiTurnAttackStrategy[MultiTurnAttackContext[Any], AttackResult]

Implementation of multi-turn red teaming attack strategy.

This class orchestrates an iterative attack process where an adversarial chat model generates prompts to send to a target system, attempting to achieve a specified objective. The strategy evaluates each target response using a scorer to determine if the objective has been met.

The attack flow consists of:

  1. Generating adversarial prompts based on previous responses and scoring feedback.

  2. Sending prompts to the target system through optional converters.

  3. Scoring target responses to assess objective achievement.

  4. Using scoring feedback to guide subsequent prompt generation.

  5. Continuing until the objective is achieved or maximum turns are reached.

The strategy supports customization through system prompts, seed prompts, and converters, allowing for various attack techniques and scenarios.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_adversarial_configAttackAdversarialConfigConfiguration for the adversarial component.
attack_converter_configAttackConverterConfig | NoneConfiguration for attack converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for attack scoring. Defaults to None.
prompt_normalizerPromptNormalizer | NoneThe prompt normalizer to use for sending prompts. Defaults to None.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for prepended-conversation converter roles and target-facing formatting. Defaults to None.
max_turnsintMaximum number of turns for the attack. Defaults to 10.
score_last_turn_onlyboolIf True, only score the final turn instead of every turn. This reduces LLM calls when intermediate scores are not needed (e.g., for generating simulated conversations). The attack will run for exactly max_turns when this is enabled. Defaults to False.

Examples:

Methods:

get_attack_adversarial_config

get_attack_adversarial_config() → AttackAdversarialConfig | None

Get the effective adversarial configuration used by this strategy.

Returns:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate the turn bound without constructing an attack.

Raises:

SequenceCompletionPolicy

Bases: str, Enum

How a SequentialAttack iterates and aggregates its child attacks.

Each policy bundles a stop condition (when to halt iteration) and an outcome rule (how to derive the envelope’s outcome from the inner results), chosen so each policy matches a common use case.

Examples:

SequentialAttack

Bases: AttackStrategy[AttackContext[AttackParameters], SequentialAttackResult]

Run a sequence of AttackStrategy child attacks against one objective.

Use this when an objective should be attacked by several techniques in sequence — for example “try Crescendo first, fall back to PromptSending” — without breaking the one-objective → one-AttackResult invariant or pushing branching logic up to the Scenario layer. Each child attack runs as a real attack through AttackExecutor and persists its own row; the compound returns one SequentialAttackResult whose iteration and aggregation are controlled by SequenceCompletionPolicy.

The default SequenceCompletionPolicy.FIRST_SUCCESS matches the adaptive “try strategies until one works” pattern, resilient to transient inner errors. See SequenceCompletionPolicy for the other policies (FIRST_DECISIVE, STRICT_ALL, EXHAUSTIVE, LAST_RESULT).

Example:

.. code-block:: python

sequential = SequentialAttack(
    objective_target=target,
    child_attacks=[
        SequentialChildAttack(strategy=crescendo, seed_group=sg),
        SequentialChildAttack(strategy=prompt_sending, seed_group=sg),
    ],
)
result = await sequential.execute_async(objective="...")

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetTarget the compound is nominally bound to (forwarded to AttackStrategy for identifier construction). Each child attack runs against whatever target its own strategy is configured with.
child_attacksSequence[SequentialChildAttack]Child attacks to run, in order. Must be non-empty.
completion_policySequenceCompletionPolicyIteration + aggregation policy. Defaults to SequenceCompletionPolicy.FIRST_SUCCESS (resilient adaptive).

Examples:

Methods:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate the child selection without constructing or executing child attacks.

Raises:

SequentialAttackResult

Bases: AttackResult

Result of a SequentialAttack execution.

Inherits every field from AttackResult. The envelope owns no conversation, last response, or last score of its own — those live on the inner per-child-attack AttackResult rows. Callers reach the inner results via:

Attributes:

ParameterTypeDescription
child_attack_resultslist[AttackResult]The inner per-child-attack results, in dispatch order. Populated at execute time; empty after a DB round-trip.
completion_policySequenceCompletionPolicyThe policy that governed the sequence’s iteration and aggregation. Also mirrored into metadata["completion_policy"] for DB round-trip.

SequentialChildAttack

One child attack in a SequentialAttack.

Each entry bundles an AttackStrategy with the inputs that the compound forwards to AttackExecutor when dispatching it. seed_group is required per entry so callers compose seed groups up front (e.g. merging per-technique AttackTechniqueSeedGroup objects into a shared base) without any implicit fallback at the compound layer.

Attributes:

ParameterTypeDescription
strategyAttackStrategyThe inner attack to run for this entry.
seed_groupAttackSeedGroupThe seed group dispatched to the inner attack. Must carry the objective.
adversarial_chatPromptTarget | NoneForwarded to the executor for inner attacks that need an adversarial chat target (e.g. multi-turn attacks, or seed groups with simulated-conversation configs).
objective_scorerTrueFalseScorer | NoneForwarded to the executor for inner attacks that need an objective scorer.
memory_labelsMapping[str, str]Per-entry labels merged on top of the compound’s context.memory_labels for this call.
atomic_attack_identifierAtomicAttackIdentifier | NoneCaller-prepared source identity, passed unchanged to the existing result-recording path.
result_metadataMapping[str, Any]Caller-prepared result metadata.
technique_identifierComponentIdentifier | NoneOptional packaged technique identity used for the compound configuration and persisted child results.
identity_seed_groupAttackSeedGroup | NoneSource seeds before technique merging. Defaults to seed_group when no separate source group is supplied.

Examples:

SimulatedConversationResult

Generated prompts and the source conversations that produced them.

SingleTurnAttackContext

Bases: AttackContext[AttackParamsT]

Context for single-turn attacks.

Holds execution state for single-turn attacks. The immutable attack parameters (objective, next_message, prepended_conversation, memory_labels) are stored in the params field inherited from AttackContext.

Examples:

SingleTurnAttackStrategy

Bases: AttackStrategy[SingleTurnAttackContext[Any], AttackResult], ABC

Strategy for executing single-turn attacks. This strategy is designed to handle attacks that consist of a single turn of interaction with the target model.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack.
context_typetype[SingleTurnAttackContext]The type of context this strategy will use. Defaults to SingleTurnAttackContext.
params_typetype[AttackParamsT]The type of parameters this strategy accepts. Defaults to AttackParameters.
prepended_conversation_configPrependedConversationConfig | NonePolicy for prepended conversations. See AttackStrategy. Defaults to None.
loggerlogging.LoggerLogger instance for logging events and messages. Defaults to logger.

SkeletonKeyAttack

Bases: PromptSendingAttack

Implementation of the skeleton key jailbreak attack strategy.

This attack prepends a simulated skeleton key exchange to the conversation context before sending the actual objective prompt in a single turn. The prepended exchange consists of the skeleton key prompt (user) and a simulated acceptance response (assistant), priming the target to bypass its safety mechanisms.

The attack flow consists of:

  1. Prepending [skeleton key prompt (user) + acceptance response (assistant)] as conversation history.

  2. Sending the actual objective prompt to the primed target.

  3. Evaluating the response using configured scorers to determine success.

Learn more about the attack Microsoft Security Response Center, 2024.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_converter_configAttackConverterConfig | NoneConfiguration for converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneConfiguration for scoring components. Defaults to None.
prompt_normalizerPromptNormalizer | NoneNormalizer for handling prompts. Defaults to None.
skeleton_key_promptstr | NoneThe skeleton key prompt to prepend as the user turn. If not provided, uses the default skeleton key prompt. Defaults to None.
skeleton_key_acceptancestr | NoneThe simulated assistant acceptance response to prepend. If not provided, uses the default acceptance response. Defaults to None.
max_attempts_on_failureintMaximum number of attempts to retry on failure. Defaults to 0.
prepended_conversation_configPrependedConversationConfig | NonePolicy for the skeleton key exchange this attack prepends. Controls which roles receive request converters and how a target without editable history renders that exchange with the live request. Defaults to None.

Examples:

TAPAttackContext

Bases: MultiTurnAttackContext[Any]

Context for the Tree of Attacks with Pruning (TAP) attack strategy.

This context contains all execution-specific state for a TAP attack instance, ensuring thread safety by isolating state per execution.

TAPAttackResult

Bases: AttackResult

Result of the Tree of Attacks with Pruning (TAP) attack strategy execution.

This result includes the standard attack result information with attack-specific data stored in the metadata dictionary.

TAPSystemPromptPaths

Bases: enum.Enum

Enum for predefined TAP attack system prompt paths.

TreeOfAttacksWithPruningAttack

Bases: AttackStrategy[TAPAttackContext, TAPAttackResult]

Implement the Tree of Attacks with Pruning (TAP) attack strategy.

The TAP attack strategy systematically explores multiple adversarial prompt paths in parallel using a tree structure. It employs breadth-first search with pruning to efficiently find effective jailbreaks while managing computational resources.

How it works:

  1. Initialization: Creates multiple initial attack branches (width) to explore different approaches

  2. Tree Expansion: For each iteration (depth), branches are expanded by a branching factor

  3. Prompt Generation: Each node generates adversarial prompts via an LLM red-teaming assistant

  4. Evaluation: Responses are evaluated for objective achievement and on-topic relevance

  5. Pruning: Low-scoring or off-topic branches are pruned to maintain the width constraint

  6. Iteration: The process continues until the objective is achieved or max depth is reached

The strategy balances exploration (trying diverse approaches) with exploitation (focusing on promising paths) through its pruning mechanism.

Execution returns an AttackResult containing the TAP attack result.

Constructor Parameters:

ParameterTypeDescription
objective_targetPromptTargetThe target system to attack. Defaults to REQUIRED_VALUE.
attack_adversarial_configAttackAdversarialConfigConfiguration for the adversarial chat component.
attack_converter_configAttackConverterConfig | NoneConfiguration for attack converters. Defaults to None.
attack_scoring_configAttackScoringConfig | NoneScoring configuration for TAP. The objective scorer’s true/false verdict decides success, and the scorer must keep a float value on each verdict for ranking branches (ScorerCapabilityName.PRESERVES_FLOAT_SCALE_VALUE), as FloatScaleThresholdScorer does. If not provided, a default configuration with SelfAskScaleScorer and threshold 0.7 is created. Defaults to None.
prompt_normalizerPromptNormalizer | NoneThe prompt normalizer to use. Defaults to None.
tree_widthintNumber of branches to explore in parallel at each level. Defaults to 3.
tree_depthintMaximum number of iterations to perform. Defaults to 5.
branching_factorintNumber of child branches to create from each parent. Defaults to 2.
on_topic_checking_enabledboolWhether to check if prompts are on-topic. Defaults to True.
desired_response_prefixstrExpected prefix for successful responses. Defaults to “Sure, here is”.
batch_sizeintNumber of nodes to process in parallel per batch. Defaults to 10.
prepended_conversation_configPrependedConversationConfig | NoneConfiguration for how to process prepended conversations. Controls converter application by role and request formatting for targets without editable history. Defaults to None.

Methods:

execute_async

execute_async(kwargs: Any = {}) → TAPAttackResult

Execute the multi-turn attack strategy asynchronously with the provided parameters.

ParameterTypeDescription
objectivestrThe objective of the attack.
memory_labelsdict[str, str] | NoneMemory labels for the attack context. Defaults to None.
**kwargsAnyAdditional parameters for the attack. Defaults to {}.

Returns:

get_attack_adversarial_config

get_attack_adversarial_config() → AttackAdversarialConfig | None

Get the effective adversarial configuration used by this strategy.

Returns:

get_attack_scoring_config

get_attack_scoring_config() → AttackScoringConfig | None

Get the attack scoring configuration used by this strategy.

Returns:

validate_constructor_parameters

validate_constructor_parameters(params: dict[str, Any]) → None

Validate TAP search limits without constructing an attack.

References
  1. Russinovich, M., Salem, A., & Eldan, R. (2024). Great, Now Write an Article About That: The Crescendo Multi-Turn LLM Jailbreak Attack. arXiv Preprint arXiv:2404.01833. https://arxiv.org/abs/2404.01833
  2. Anthropic. (2024). Many-Shot Jailbreaking. https://www.anthropic.com/research/many-shot-jailbreaking
  3. Chao, P., Robey, A., Dobriban, E., Hassani, H., Pappas, G. J., & Wong, E. (2023). Jailbreaking Black Box Large Language Models in Twenty Queries. arXiv Preprint arXiv:2310.08419. https://arxiv.org/abs/2310.08419
  4. Mehrotra, A., Zampetakis, M., Kassianik, P., Nelson, B., Anderson, H., Singer, Y., & Karbasi, A. (2023). Tree of Attacks: Jailbreaking Black-Box LLMs Automatically. arXiv Preprint arXiv:2312.02119. https://arxiv.org/abs/2312.02119
  5. Microsoft Security Response Center. (2024). Mitigating Skeleton Key, a New Type of Generative AI Jailbreak Technique. https://www.microsoft.com/en-us/security/blog/2024/06/26/mitigating-skeleton-key-a-new-type-of-generative-ai-jailbreak-technique/