Red Team Multi-Input LLM Applications
Real-world AI apps combine multiple fields (user_id + message + context) into one LLM request. Single-input testing misses vulnerabilities that emerge from field interactions. Multi-input mode generates coordinated adversarial content across all variables simultaneously, uncovering authorization bypass + prompt injection combos.
Use this skill when
- Testing apps that accept user identity alongside prompts (
user_id+message) - Testing form submissions with multiple fields sent to an AI backend
- Testing RAG with user context (retrieved content + user query + user role)
- Testing role-based access (different users should see different data)
- Testing typed DOCX/PDF/image upload workflows with indirect prompt injection
- Testing authorization bypass + prompt injection combos across fields
- Testing role confusion attacks (mismatched identity and message)
Do not use this skill when
- Testing a single-prompt LLM app → use
promptfoo-redteam-llm - Testing RAG systems without user identity fields → use
promptfoo-redteam-rag - Testing agents with tools/state → use
promptfoo-redteam-agents - Testing vision/audio models with a single image input → use
promptfoo-redteam-multimodal - Testing guardrails → use
promptfoo-redteam-guardrails
🛡️ Edge cases (mandatory handling)
- Adding a synthetic
promptinput — multi-input mode auto-builds__promptJSON from your inputs; do NOT setredteam.injectVar, add a syntheticpromptinput, or rewrite your target to use{{prompt}}just to make multi-input work. - Hyphenated variable names — must match
[a-zA-Z_][a-zA-Z0-9_]*;my-varfails, usemy_var.123invalidalso fails. - Excluded plugins — multi-input mode automatically skips
ascii-smuggling,cca,cross-session-leak,special-token-injection,system-prompt-override, and dataset-backed plugins (beavertails,harmbench,xstest). Don't rely on these in multi-input mode. - Vague input descriptions — better descriptions generate more targeted attacks. "The user making the request" is better than "user input".
indirectInjectionVarfor document uploads — when usingindirect-prompt-injectionwith typed DOCX/PDF inputs, setindirectInjectionVarto point at the untrusted input field (e.g.document), not the question field.- Benign companion fields — set
config.benign: truefor fields that should remain natural (e.g. the question about an uploaded document).
🎯 Core workflow
- Identify inputs — load
references/inputs.mdto map your app's real input fields to multi-input variables. - Configure target — load
references/target-config.mdfor HTTP and custom provider configs withinputs:. - Select plugins — load
references/plugins.mdfor BOLA/BFLA/RBAC + hijacking + policy + indirect-prompt-injection. - Typed uploads (if applicable) — load
references/typed-uploads.mdfor DOCX/PDF/image upload workflows. - Role contexts — load
references/contexts.mdfor testing different user roles. - Run + review —
npx promptfoo@latest redteam run -c config.yaml+redteam report. - Checklist — run
references/checklist.mdend-to-end before declaring done.
🎯 Core principles (summary)
inputs:on the target activates multi-input mode — each key becomes a variable that plugins generate adversarial content for.__promptis auto-built — Promptfoo combines all inputs into a JSON string in__prompt; do NOT setinjectVaror add a syntheticpromptinput.- Coordination is the attack — both fields contain adversarial content that works together (spoofed
vendor_id+ injecteddescription). - BOLA/BFLA/RBAC are the best multi-input plugins — they test identity/action field interactions.
- Variable names must match
[a-zA-Z_][a-zA-Z0-9_]*— no hyphens, no leading numbers. - Typed uploads —
type: docx|pdf|imagewithinjectionPlacementsfor indirect prompt injection in documents.
📦 Best plugins for multi-input
| Plugin | Why |
|---|---|
bola |
Tests if user A can access user B's data via identity field manipulation |
bfla |
Tests if user can access functions beyond their role |
rbac |
Tests role-based access control across identity + action fields |
hijacking |
Tests goal hijacking via message field injection |
policy |
Custom rules for domain-specific authorization |
indirect-prompt-injection |
For document uploads — set indirectInjectionVar to the untrusted field |
References
references/inputs.md— identifying app inputs, variable naming rules,__promptstructurereferences/target-config.md— HTTP and custom provider configs withinputs:, plugin-level input overridesreferences/plugins.md— best multi-input plugins, excluded plugins, plugin-level configreferences/typed-uploads.md— DOCX/PDF/image typed inputs,injectionPlacements, benign companion fieldsreferences/contexts.md— role-based testing withredteam.contextsreferences/checklist.md— pre-flight, inputs, plugins, typed uploads, contexts checklist