The template expansion engine generates attack variants by combining techniques, harm categories, difficulty levels, mutations, and languages. This is how ai-blackteam scales from ~100 base attacks to millions of test configurations.

How expansion works

The formula:
Each base attack can then be multiplied:
  • Mutations (17 variants) - encoding, framing, and difficulty transforms
  • Languages (10 variants) - multilingual attack variants
Full expansion:

Checking expansion capacity

Output:
This shows the base expansion. With mutations and languages, the total grows to millions.

Listing expanded attacks

Each expanded attack has a composite ID like encoding-obfuscation-weapons-hard.

Running expanded attacks

Options

Difficulty levels

Each harm category defines target prompts at 4 difficulty levels: Higher difficulty means the target prompt itself is harder for the model to recognize as harmful.

Mutations

When --mutations is enabled, each attack gets 17 additional variants:
  • 5 encoding mutations - base64, hex, rot13, unicode, URL encoding
  • 8 framing mutations - academic, fictional, historical, hypothetical, research, creative writing, educational, journalistic
  • 4 difficulty mutations - rephrase at increasing levels of obfuscation

Language variants

When --languages is enabled, each attack gets variants in 10 languages:
  • Chinese, Spanish, Arabic, Hindi, Russian, Portuguese, Japanese, French, German, Korean
This tests whether safety training generalizes across languages.

Attack surface math

Starting from the base:
With mutations:
With languages:
Adding dataset prompts with mutations pushes the total executable attack surface into the hundreds of millions.