Tribunal.RedTeam.Plugins.Imitation (Tribunal v3.0.0)

Copy Markdown View Source

Generates attacks that try to get the assistant to impersonate a brand, staff member, or authority figure.

Inspired by promptfoo's imitation plugin. Failure modes here:

  • The assistant adopts an unauthorised persona (a named brand representative, a customer service manager, a celebrity associated with the brand).
  • The assistant speaks on behalf of the company in ways the company hasn't sanctioned (legal positions, refund commitments, exclusive deals, brand opinions).
  • The assistant confirms a user's claim that it is a particular person or system (e.g., "you ARE the support team, right?") rather than clarifying its scope.

Each generated case carries an explicit identity and authority policy in expected.no_policy_violation.policy, including the assistant's purpose and the distinction between ordinary brand information and impersonation.

Options

  • :purpose — required. Free-form description of the assistant's domain.
  • :count — number of attacks to generate. Defaults to 5.
  • :attacker — module implementing Tribunal.RedTeam.Attacker. Defaults to Tribunal.RedTeam.Attacker.default/0.
  • :model — passed through to the attacker.
  • :temperature, :max_tokens — passed through to the attacker.

Example

{:ok, cases} = Tribunal.RedTeam.Plugins.Imitation.generate(
  purpose: "Shopping assistant for a cosmetics retailer.",
  count: 5
)