Prompt Regression Mutator
Generate deterministic adversarial variants of a prompt for regression suites — seeded, labelled and exportable as JSONL.
No model calls. Variants are inert text; your eval harness decides how to run them. Same seed, prompt and settings always produce the same set.
Prompt & settings
1 line · 137 bytesVariants
Generate variants to begin
The original is always included as id 0 for a baseline.
Paste a prompt, choose a seed, variant count, intensity and mutation categories, and get a reproducible suite of adversarial variants. Mutations cover casing, whitespace noise (including CRLF and NBSP), punctuation changes, benign filler injection, homoglyph substitutions and character typos. The original is always included as id 0; every record carries the seed, generator version, original-prompt hash and mutation labels for attribution. Placeholders like {{var}} can be protected so eval templates stay intact. Export strict JSONL with one JSON object per line — no comment header — or a JSON array, inspect a character-level diff with invisible characters made visible, and re-import JSONL sets. Everything runs locally with no model calls.
- Regression suite: The same settings regenerate the same 20 labelled variants on any machine, so eval results stay comparable.
- Protected template: The mutation changes prose but leaves {{user_message}} byte-identical for the harness.
- JSONL export: Strict one-object-per-line output can be consumed directly by readline → json.loads loops.
Examples
Baseline included
A two-sentence system promptid 0 unchanged, ids 1–20 mutatedDrift is measured against the baseline record, never against an implicit original.
Homoglyph variant
system → ѕуѕtemmutations: ["homoglyph"]Tests whether filters and tokenizers normalize look-alike characters before matching.
Filler insertion
Answer. Be concise.Answer. Please respond in French. Be concise.A benign distractor at a sentence boundary checks instruction-following stability.
Protected template
Use {{context}} only{{context}} unchanged in every variantSegments matching {{...}} are spliced back verbatim after each transform.
About this tool
The Prompt Regression Mutator turns one prompt into a labeled family of deterministic variants for robustness testing. A seeded PRNG selects one to three mutation categories per variant — casing, whitespace, punctuation, benign filler, unicode homoglyphs and typos — and applies string-only transforms, so no model is called and nothing is executed.
The original prompt is always emitted as baseline id 0. Each subsequent record carries its id, the shared seed, the applied mutation labels and the mutated prompt. Because every variant derives its own PRNG stream from seed and id, adding variants never changes earlier ones, and the same inputs produce byte-identical output on every machine.
A character-level diff highlights the selected variant against the baseline, the JSONL export drops straight into an eval harness, and template placeholders such as {{context}} are protected by default so harness interpolation keeps working.
What this tool does not do
- Mutations are surface-level string transforms, not paraphrases or semantic rewrites.
- Unicode homoglyphs are not NFC-normalized automatically; a harness that normalizes text may erase this category.
- The character diff uses a word-level fallback above four million LCS cells, so very large prompts get coarser diff spans.
How to use this tool
Paste a prompt
Enter up to 50 kB of prompt text. Load the system-prompt example to see placeholders detected and protected.
Set the seed and size
Choose a seed, a variant count from 1 to 50 and an intensity of one to three mutations per variant.
Pick categories
Enable only the mutation families relevant to your risk: casing, whitespace, punctuation, filler, homoglyphs or typos.
Inspect and export
Select a variant row to see its diff, then copy its prompt or download the full labeled JSONL set for your harness.
Use cases
Model upgrade checks
Replay the same seeded variant set after a provider update to spot behavior drift.
Eval suite authoring
Generate adversarial inputs with attribution labels so failures can be traced to a mutation family.
Sensitivity research
Measure how small surface changes affect output while keeping every variant reproducible.
JSONL record shape
| Field | Meaning |
|---|---|
| id | 0 for the unmodified baseline, otherwise the variant number |
| seed | Seed string shared by the set, for reproducibility |
| mutations | Applied mutation category labels, in application order |
| prompt | The mutated prompt text to send through your harness |
One JSON object per line with LF separators; import the same format to inspect a set from a colleague.
Common mistakes
Mistake:Changing the seed between runs and comparing results.
Fix:Keep seed, prompt and settings together; only then is a difference attributable to the model or prompt change.
Mistake:Letting mutations rewrite harness templates.
Fix:Leave placeholder protection on so {{variable}} spans survive every transform.
Mistake:Treating severity of a mutation as a test verdict.
Fix:The tool produces inputs only; your harness decides whether a variant passed or failed.
Frequently asked questions
Why mutate prompts deliberately?
Small surface changes — casing, whitespace, a distractor sentence, a look-alike character — can expose brittle prompts before your users do. Running a labeled variant set after each prompt or model change turns accidental discovery into a repeatable regression check, and the mutation labels tell you which class of change caused a failure.
Is the output deterministic?
Yes. The seed is hashed with xmur3 and drives a mulberry32 PRNG; each variant gets its own stream derived from seed and id. The same seed, prompt, settings and category selection produce byte-identical JSONL on any JavaScript engine, and changing the count never rewrites earlier variants.
What mutations are applied?
Casing (upper, lower, title or mixed), whitespace (double spaces, trailing spaces, tabs, CRLF, leading newline), punctuation (period removal, exclamation swap, quotes, em dash), benign filler sentences, unicode homoglyphs and zero-width/NBSP insertion, and small typos such as transposing or dropping a character in one word.
How do I use the JSONL in my eval harness?
Each line is an object with id, seed, mutations and prompt. Send the prompt field through your harness, record the result against the id, and group failures by the mutations labels. Baseline id 0 gives you the unmodified comparison point.
Are homoglyphs reversible?
Not automatically. The tool substitutes Cyrillic and Greek look-alikes for Latin letters but does not NFC-normalize them, because normalization would erase the exact condition being tested. If your pipeline normalizes input, you can enable that in your own harness before running the variant.
Can protected placeholders still be mutated?
No while placeholder protection is enabled: spans matching {{...}} are split out and spliced back unchanged after each transform. Turn the protection off only if you intentionally want to perturb template syntax as part of the test.
Related tools
Agent Tool Flowchart Builder
Design agentic tool-call DAGs with decision branches and bounded loops. Validates reachability, cycle handling, and emits clean Mermaid flowcharts — fully in your browser.
AI Agent Memory & Buffer Simulator
Compare sliding window, summary buffer, and vector memory strategies
AI API Client SDK Generator
Generate typed API client SDK files from OpenAPI specifications or cURL requests
AI Code Explainer
Explain code snippets with grounded cloud AI
AI Code Security Auditor
Scan source code for high-confidence OWASP Top 10 vulnerabilities
AI Code Translator
Translate code into idiomatic implementations in another language