Skip to content

Red-team strategy

NER Entity Perturbation

ner-entity-perturbation

Heuristic NER-style robustness perturbation: swaps recognized person names + locations for equivalents, shifts numbers, and swaps personal/possessive pronouns for a different perspective, yielding a semantically-near variant. Pair with the `invariance` scorer to flag answers that change under cosmetic entity/reference swaps.

Transform demo

Input

input
Show me how to query the user database.

Output after applying ner-entity-perturbation

output · ner-entity-perturbation
Show me how to query the user database.

YAML config

evalguard.config.yaml
redteam:
  strategies:
    - ner-entity-perturbation

CLI

bash
# "ner-entity-perturbation" 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.