Inbox & communication

12 of 20 Prompt Injections Worked on His n8n Email Bot, Then 0 of 60: Let Code Make the Decisions, Not the Model

  • Level Advanced
  • Setup1–3 hrs (estimated)
  • Evidence Strong evidence
  • CostNot stated in source
  • No-codeNo
n8nSource-linked

What did they do with n8n?

He built an n8n workflow where a small local model reads customer emails and decides priority, refunds and replies, then attacked it with 20 injection emails, 3 runs each. 12 of 20 worked on the plain version (35 of 60 runs), and the usual 'don't follow instructions in the email' prompt made it slightly worse (13 of 20). Taking every decision away from the model fixed it: the model only fills in a form, and a code step strips hidden HTML, keeps secrets out of the prompt and decides what happens. That got 0 of 60. The cost: only 19 of 36 normal emails were answered automatically, down from 31.

How it went

dev.to post by crzy_undefinedundefined (Oct 28, 2026): 20 injection emails × 3 runs per version; naive 35/60, prompt-hardened 38/60, decisions in code 0/60; normal emails auto-answered fell from 31/36 to 19/36. Small local model tested. He tested a small 1.8B model only. Bigger models resist more, but the lesson about code making the decisions still holds

Worth knowing

  • dev.to post by crzy_undefinedundefined (Oct 28, 2026): 20 injection emails × 3 runs per version; naive 35/60, prompt-hardened 38/60, decisions in code 0/60; normal emails auto-answered fell from 31/36 to 19/36. Small local model tested.
  • He tested a small 1.8B model only. Bigger models resist more, but the lesson about code making the decisions still holds.

Prompt

Cleaned version rewritten from the source — not a direct quote.

Review my email automation that reads customer emails with AI. List every place where the model's output directly triggers an action (refund, priority, sending a reply). Rewrite it so the model only returns allowlisted fields and a draft reply, and plain code decides actions. Strip hidden HTML before the model sees the email, keep secrets out of the prompt, check links and money promises in drafts, and send anything risky to me for approval.

Recommended

Try it in Grok Bot

Same rule for a Grok Bot reading your inbox: have it draft, and never let an email's text approve a refund, payment or reply without you.

  1. Copy the prompt (button below).
  2. Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
  3. Connect the listed tools (Email) as connectors when Grok Bot asks.
  4. If the task repeats, ask: "Make this a daily routine."

Alternatives: the same prompt works in n8n, Claude, ChatGPT Agent, OpenClaw.

Set it up

Tools: Email · Stack: n8n

  1. Read the original source for full context.
  2. Connect the tools your agent needs.
  3. Paste the prompt and replace [bracketed] placeholders.
  4. Run once manually and check the output before scheduling it.

Generic suggested steps, not from the source.

Evidence

dev.to post by crzy_undefinedundefined (Oct 28, 2026): 20 injection emails × 3 runs per version; naive 35/60, prompt-hardened 38/60, decisions in code 0/60; normal emails auto-answered fell from 31/36 to 19/36. Small local model tested. He tested a small 1.8B model only. Bigger models resist more, but the lesson about code making the decisions still holds (as of 2026-10-28)

Source: Web · 2026-10-28 · Verified by us: not yet · Report broken or outdated

Get 3 new AI agent workflows every morning

Three real agent workflows in your inbox each morning, with one prompt to try today. No hype.

Related use cases

Inbox & communicationX · 2026-10

Ask your bot for a security review of an email that passed every check

An email from noreply@x.ai landed in a Tesla engineer's inbox. It passed SPF, DKIM and DMARC (the checks that confirm who sent an email) and showed the blue check, but something felt off, so he asked his Grok Bot to do a security review. It found a hidden phishing link, explained why every safety check had passed, and wrote a report to xAI with a proposed fix. He then had it add a security routine that checks his email for anything phishy going forward.

  • Level Beginner
  • Setup~30 min*
  • Evidence Strong evidence
Grok BotSource-linkedBeginner-friendly
MarketingWeb · 2026-10

118 of 120 AI Social Posts Were Bad and 93 Forgot the Link: An n8n Test, and Why Code Checks Still Missed False Numbers

He built a blog-post-to-5-platforms social workflow in n8n two ways and ran both on 8 posts, 3 times each. The one-prompt version produced 118 bad posts out of 120, and 93 left out the blog link. The version with code-checked rules marked 77 posts ready and sent 43 to a human, and none of the 77 failed an independent checker. But when he read them, 10 of 21 in the first round got the blog post wrong, including saying churn rose from 6.1% to 4.3%. His conclusion: code can check format, not truth.

  • Level Intermediate
  • Setup1–3 hrs*
  • Evidence Strong evidence
n8nSource-linked
Inbox & communicationReddit · 2026-10

Mailbox 99.98% Full, Down to 67% Overnight With Every Original Kept: An HVAC Owner's Work Mail Grok Bot

His Work Mail bot owns his company inbox. A watcher wakes it within about a minute of every new email; it reads each one in full, files it into one of about 100 job folders and routes it to the specialist bot that owns it, saving returned submittals and drawings to that job's Dropbox folder. It knows shop rules like who never gets cc'd. One night it rescued a mailbox that was 99.98% full by emptying trash, then backing up and stripping old attachments, bringing it down to 67% with every original kept.

  • Level Intermediate
  • Setup1–3 hrs*
  • Evidence Strong evidence
Grok BotSource-linked