Elena' s AI Blog

I Gave My AI Agent the Keys to My Inbox — Then Tried to Break Into It Myself

24 Aug 2026 (updated: 07 Sep 2026) / 37 minutes to read

Elena Daehnhardt

Claude: a four-panel poster — building the email agent, realising it's a door to a stranger's text, the attack drill of four sample prompt-injection emails, and the edaehn-injection-defense guard logging attempts to /security and monitoring digest


TL;DR:
  • I built an AI email agent, then attacked it with hand-written **prompt injection** emails before trusting it with my real inbox.
  • All six attacks that actually reached the agent were flagged correctly — including a base64-encoded payload and two impersonation attempts. That is not a benchmark, and 6/6 does not mean a 100% detection rate; it means these six attacks did not fool this version of the system.
  • The one innocent control that reached judgment — a genuine `.gitignore` question that used the word "ignore" on purpose — was drafted normally and sent. The second control never arrived: a filename collision ate it first, after a silent `launchd` hang had already stopped the fetcher.

📚 This post is part of the "AI Safety" series

Series: AI Safety (Part 6 of 5)

Previous: Part 4 — The Digital Butler or Trojan Horse? A Privacy Playbook for Persistent AI Agents

Introduction

I am one week away from a proper holiday, the kind where I do not check email at all. So this week I have been working with Claude to build something to cover for me: an agent that reads the messages landing in my inbox and my “Ask Elena” form, works out whether they deserve a reply, and drafts one in my voice while I am away.

Halfway through building it, I stopped typing and just looked at what I had made. This agent reads text written by literally anyone who can find my contact form. It hands that text to a large language model. That model can write files to my computer, and in one pipeline it can look up which of my own blog posts to cite. I had built a door, and I had propped it open, and I was about to leave the country.

So before I let this thing anywhere near a stranger’s email, I decided to become the stranger first.


The Experiment: Thirteen Messages, Three Questions

I gave the defence thirteen messages: eleven attacks and two innocent controls. I wanted to know three things:

  1. Would malicious instructions be detected?
  2. Would innocent messages still get through?
  3. Would every message actually reach the defence?

That third question became wonderfully important later.

You've hit a Deep Dive tutorial.

I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):

Already a subscriber? Use the magic link from your last newsletter, or reset your password.

New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2026) 'I Gave My AI Agent the Keys to My Inbox — Then Tried to Break Into It Myself', daehnhardt.com, 24 August 2026. Available at: https://daehnhardt.com/blog/2026/08/24/i-gave-my-ai-agent-the-keys-to-my-inbox/
All Posts