Skip to content

Red-team strategy

Few-Shot Injection

few-shot-injection

Creates a few-shot pattern with escalating examples that lead to the actual payload

YAML config

evalguard.config.yaml
redteam:
  strategies:
    - few-shot-injection

CLI

bash
# "few-shot-injection" is layered onto attacks during red-team scans.
# List every available encoding/obfuscation strategy:
evalguard list strategies
Combine with attack plugins to generate adversarial payloads. The strategy wraps each base payload before it's sent to your target, testing whether the model decodes / unwraps the transform and follows the embedded instruction.

Threat-model fit

The Few-Shot Injection strategy effectively probes threat models focused on prompt injection and manipulation of AI systems. By providing a series of escalating examples, it tests the model's ability to discern between benign and malicious instructions, revealing vulnerabilities in its response generation.

LLM-generated (llm-gpt-4o) · 2026-05-23