CrucibleAdversary.AttackResult (CrucibleAdversary v0.4.0)

View Source

Represents the result of an adversarial attack.

Fields

  • :original - The original input text
  • :attacked - The attacked/perturbed text
  • :attack_type - The type of attack applied (atom)
  • :success - Whether the attack was successful (boolean)
  • :metadata - Additional metadata about the attack (map)
  • :timestamp - When the attack was performed (DateTime)

Examples

iex> %CrucibleAdversary.AttackResult{
...>   original: "hello",
...>   attacked: "hlelo",
...>   attack_type: :character_swap,
...>   success: true
...> }
%CrucibleAdversary.AttackResult{
  original: "hello",
  attacked: "hlelo",
  attack_type: :character_swap,
  success: true,
  metadata: %{},
  timestamp: nil
}

Summary

Types

t()

@type t() :: %CrucibleAdversary.AttackResult{
  attack_type: atom(),
  attacked: String.t(),
  metadata: map(),
  original: String.t(),
  success: boolean(),
  timestamp: DateTime.t() | nil
}