AttackStrategy Class
- java.
lang. Object - com.
azure. core. util. ExpandableStringEnum<T> - com.
azure. ai. projects. models. AttackStrategy
- com.
- com.
public final class AttackStrategy
extends ExpandableStringEnum<AttackStrategy>
Strategies for attacks.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
|
static final
Attack |
ANSI_ATTACK
Utilizes ANSI escape sequences to manipulate text appearance and behavior. |
|
static final
Attack |
ASCII_ART
Generates visual art using ASCII characters, often used for creative or obfuscation purposes. |
|
static final
Attack |
ASCII_SMUGGLER
Conceals data within ASCII characters, making it harder to detect. |
|
static final
Attack |
ATBASH
Implements the Atbash cipher, a simple substitution cipher where each letter is mapped to its reverse. |
|
static final
Attack |
BASELINE
Represents the baseline direct adversarial probing, which is used by attack strategies as the attack objective. |
|
static final
Attack |
BASE_64
Encodes binary data into a text format using Base64, commonly used for data transmission. |
|
static final
Attack |
BINARY
Converts text into binary code, representing data in a series of 0s and 1s. |
|
static final
Attack |
CAESAR
Applies the Caesar cipher, a substitution cipher that shifts characters by a fixed number of positions. |
|
static final
Attack |
CHARACTER_SPACE
Alters text by adding spaces between characters, often used for obfuscation. |
|
static final
Attack |
CHARACTER_SWAP
Swaps characters within text to create variations or obfuscate the original content. |
|
static final
Attack |
CRESCENDO
Gradually increases the intensity or complexity of the attack over time. |
|
static final
Attack |
DIACRITIC
Adds diacritical marks to characters, changing their appearance and sometimes their meaning. |
|
static final
Attack |
DIFFICULT
Represents a default set of difficult complexity attacks. |
|
static final
Attack |
EASY
Represents a default set of easy complexity attacks. |
|
static final
Attack |
FLIP
Flips characters from front to back, creating a mirrored effect. |
|
static final
Attack |
INDIRECT_JAILBREAK
Represents indirect jailbreak attacks that use complex methods to bypass AI safeguards. |
|
static final
Attack |
JAILBREAK
Injects specially crafted prompts to bypass AI safeguards, known as User Injected Prompt Attacks (UPIA). |
|
static final
Attack |
LEETSPEAK
Transforms text into Leetspeak, a form of encoding that replaces letters with similar-looking numbers or symbols. |
|
static final
Attack |
MODERATE
Represents a default set of moderate complexity attacks. |
|
static final
Attack |
MORSE
Encodes text into Morse code, using dots and dashes to represent characters. |
|
static final
Attack |
MULTI_TURN
Creates multi-turn conversations to simulate extended interactions. |
|
static final
Attack |
ROT_13
Applies the ROT13 cipher, a simple substitution cipher that shifts characters by 13 positions. |
|
static final
Attack |
STRING_JOIN
Joins multiple strings together, often used for concatenation or obfuscation. |
|
static final
Attack |
SUFFIX_APPEND
Appends an adversarial suffix to the prompt. |
|
static final
Attack |
TENSE
Alters the tense of the text, changing its temporal context. |
|
static final
Attack |
UNICODE_CONFUSABLE
Uses Unicode characters that look similar to standard characters, creating visual confusion. |
|
static final
Attack |
UNICODE_SUBSTITUTION
Substitutes standard characters with Unicode equivalents, often for obfuscation. |
|
static final
Attack |
URL
Encodes text into URL format. |
Constructor Summary
| Constructor | Description |
|---|---|
| AttackStrategy() |
Deprecated
Use the fromString(String name) factory method.
Creates a new instance of Attack |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Attack |
fromString(String name)
Creates or finds a Attack |
|
static
Collection<Attack |
values()
Gets known Attack |
Methods inherited from ExpandableStringEnum
Methods inherited from java.lang.Object
Field Details
ANSI_ATTACK
public static final AttackStrategy ANSI_ATTACK
Utilizes ANSI escape sequences to manipulate text appearance and behavior.
ASCII_ART
public static final AttackStrategy ASCII_ART
Generates visual art using ASCII characters, often used for creative or obfuscation purposes.
ASCII_SMUGGLER
public static final AttackStrategy ASCII_SMUGGLER
Conceals data within ASCII characters, making it harder to detect.
ATBASH
public static final AttackStrategy ATBASH
Implements the Atbash cipher, a simple substitution cipher where each letter is mapped to its reverse.
BASELINE
public static final AttackStrategy BASELINE
Represents the baseline direct adversarial probing, which is used by attack strategies as the attack objective.
BASE_64
public static final AttackStrategy BASE_64
Encodes binary data into a text format using Base64, commonly used for data transmission.
BINARY
public static final AttackStrategy BINARY
Converts text into binary code, representing data in a series of 0s and 1s.
CAESAR
public static final AttackStrategy CAESAR
Applies the Caesar cipher, a substitution cipher that shifts characters by a fixed number of positions.
CHARACTER_SPACE
public static final AttackStrategy CHARACTER_SPACE
Alters text by adding spaces between characters, often used for obfuscation.
CHARACTER_SWAP
public static final AttackStrategy CHARACTER_SWAP
Swaps characters within text to create variations or obfuscate the original content.
CRESCENDO
public static final AttackStrategy CRESCENDO
Gradually increases the intensity or complexity of the attack over time.
DIACRITIC
public static final AttackStrategy DIACRITIC
Adds diacritical marks to characters, changing their appearance and sometimes their meaning.
DIFFICULT
public static final AttackStrategy DIFFICULT
Represents a default set of difficult complexity attacks. Difficult complexity attacks include attacks that require access to significant resources and effort to execute an attack such as knowledge of search-based algorithms in addition to a generative AI model.
EASY
public static final AttackStrategy EASY
Represents a default set of easy complexity attacks. Easy complexity attacks require less effort, such as translation of a prompt into some encoding, and does not require any Large Language Model to convert or orchestrate.
FLIP
public static final AttackStrategy FLIP
Flips characters from front to back, creating a mirrored effect.
INDIRECT_JAILBREAK
public static final AttackStrategy INDIRECT_JAILBREAK
Represents indirect jailbreak attacks that use complex methods to bypass AI safeguards.
JAILBREAK
public static final AttackStrategy JAILBREAK
Injects specially crafted prompts to bypass AI safeguards, known as User Injected Prompt Attacks (UPIA).
LEETSPEAK
public static final AttackStrategy LEETSPEAK
Transforms text into Leetspeak, a form of encoding that replaces letters with similar-looking numbers or symbols.
MODERATE
public static final AttackStrategy MODERATE
Represents a default set of moderate complexity attacks. Moderate complexity attacks require having access to resources such as another generative AI model.
MORSE
public static final AttackStrategy MORSE
Encodes text into Morse code, using dots and dashes to represent characters.
MULTI_TURN
public static final AttackStrategy MULTI_TURN
Creates multi-turn conversations to simulate extended interactions.
ROT_13
public static final AttackStrategy ROT_13
Applies the ROT13 cipher, a simple substitution cipher that shifts characters by 13 positions.
STRING_JOIN
public static final AttackStrategy STRING_JOIN
Joins multiple strings together, often used for concatenation or obfuscation.
SUFFIX_APPEND
public static final AttackStrategy SUFFIX_APPEND
Appends an adversarial suffix to the prompt.
TENSE
public static final AttackStrategy TENSE
Alters the tense of the text, changing its temporal context.
UNICODE_CONFUSABLE
public static final AttackStrategy UNICODE_CONFUSABLE
Uses Unicode characters that look similar to standard characters, creating visual confusion.
UNICODE_SUBSTITUTION
public static final AttackStrategy UNICODE_SUBSTITUTION
Substitutes standard characters with Unicode equivalents, often for obfuscation.
URL
public static final AttackStrategy URL
Encodes text into URL format.
Constructor Details
AttackStrategy
@Deprecated
public AttackStrategy()
Deprecated
Creates a new instance of AttackStrategy value.
Method Details
fromString
public static AttackStrategy fromString(String name)
Creates or finds a AttackStrategy from its string representation.
Parameters:
Returns:
values
public static Collection<AttackStrategy> values()
Gets known AttackStrategy values.
Returns: