AI Red Teaming delivers file attacks as base64-encoded data inside the JSON request
body. For n8n targets, the file is included in a files array
element alongside the MIME type. Your n8n workflow must decode this data and extract
text before passing it to the AI model.
AI Red Teaming
→ POST {"chatInput": "...", "sessionId": "...",
"files": [{"mime_type": "application/pdf", "data": "<base64>"}]}
→ n8n Webhook node
→ IF node (check: $json.body.files has items)
→ Convert to File (Move Base64 String to File; Base64 Input Field: body.files[0].data)
→ Extract From File (Extract From PDF; Input Binary Field: data)
→ AI Agent node (prompt contains the extracted document text)
→ Respond to Webhook node
The IF node checking for file presence is required. Without it, text-only attacks
(which send an empty files array) cause the Convert to File node
to error and the target fails validation. During target creation, AI Red Teaming
sends a small benign PDF to probe whether the workflow handles files correctly and
sets the target's file-capability flag accordingly. A target that fails the file
probe is still saved and runs text-only attacks.
Known limits for n8n file attacks:
- File attacks are not available in multi-turn scans. AI Red Teaming skips
file prompts during multi-turn attacks. An n8n target with multi-turn enabled
runs text-only attacks regardless of whether file support is configured.
- Self-hosted instances may lack binary nodes. Administrators can exclude
n8n nodes via the NODES_EXCLUDE environment variable. If the
Convert to File or Extract From File nodes are excluded, the target fails the
file probe and runs text-only.
Deployment
Considerations
The
following behaviors are specific to your n8n deployment type and affect how you
configure and run AI Red Teaming scans.
For n8n Cloud targets, configure a rate
limit on the target in AI Red Teaming. When your plan's concurrency limit is exceeded,
n8n Cloud queues requests rather than returning a 429 error.
The
queued requests add latency that can exceed the 100-second edge timeout and cause
attacks to fail. AI Red Teaming defaults the target request timeout to 90 seconds, which
stays under the Cloud cap, but rate limiting prevents the queue from building up in the
first place.
If you are on the n8n Cloud free
tier, monitor your execution quota before running large scans. Each attack message
consumes one execution, and an extensive red teaming scan can exhaust the monthly
quota quickly. Exceeding the limit pauses workflow executions until the next billing
cycle, interrupting in-progress scans. Consider upgrading your plan or scheduling
scans to stay within your monthly allowance.