Principle:Promptfoo Promptfoo Strategy Application
| Knowledge Sources | |
|---|---|
| Domains | Security_Testing, Adversarial_ML |
| Last Updated | 2026-02-14 08:00 GMT |
Overview
A transformation pipeline mechanism that applies encoding, jailbreaking, and evasion strategies to base adversarial test cases.
Description
Strategy Application transforms base test cases (generated by plugins) into more sophisticated attacks by applying evasion techniques. Strategies include encoding schemes (Base64, ROT13, leetspeak, hex), jailbreak templates, multi-turn escalation (GOAT, crescendo), and composite approaches.
Each strategy takes existing test cases and produces new variants with the attack payload transformed. This multiplicative approach means N plugins x M strategies can produce NxM attack variants, dramatically increasing test coverage.
Usage
Use this principle after plugin-based test generation to amplify attack diversity. Strategy selection is configured via the `strategies:` array in red team config.
Theoretical Basis
Pseudo-code Logic:
1. For each strategy in config:
a. Load strategy module (built-in or file://)
b. Apply strategy.action(testCases, injectVar, config)
c. Track requested vs. generated counts
2. Combine original (if basic strategy enabled) + strategy-transformed tests
3. Return combined test cases with strategy metadata