Crafting AI Prompts Framework

INJ Prompt Injection

Email Prompt Injection

RISK: HIGH IMPACT: HIGH

When AI tools read your email, they inherit your access level. This article explains how attackers leverage 'Email Prompt Injection' to turn high-privilege users into unwitting accomplices, tricking their AI agents into retrieving and leaking restricted files.

When users utilize Generative AI for their daily work, a common use case is integrating it with email workflows. Users frequently ask AI agents to summarize their agenda, list important emails, or automatically write and send replies. Some users even employ autonomous agents to handle their inbox completely on their behalf.

Email Prompt Injection

However, without a human in the loop, this convenience creates a significant security vulnerability. Attackers can send the user an email containing a "Prompt Injection." This is often achieved by including text in the email body stating, for example, that the model should stop following its original instructions and strictly follow a new command, such as: "do x".

Agent Exfiltration Example
user >
Read my unread emails from this morning and handle any immediate requests.
assistant
I have processed 5 emails. Per the hidden instructions found in the email subject 'Invoice #300', I have forwarded the confidential 'Q3 Financial Report' to the external sender address.
In this scenario, an autonomous agent (like OpenClaw) read a malicious email containing an injection command to forward data. Because the agent has permission to send emails, it executed the attacker's command.

Privilege Escalation & Access Control

It is important to note that enterprise tools like Microsoft Copilot 365 are designed to respect existing permission structures (ACLs); they only provide access to data the specific user is normally allowed to see. However, Prompt Injection turns this feature into a vulnerability known as a "Confused Deputy" attack.

In this scenario, an attacker with low access privileges sends an email containing a prompt injection to a user with high access privileges (e.g., a CEO or Manager). When the high-privilege user's AI processes that email, it operates with the victim's clearance. The injection can trick the AI into retrieving sensitive internal files or emails—which the victim has access to, but the attacker does not—and sending that data back to the attacker. This effectively allows the attacker to steal data they could never access directly.

The Risks of Automation

When a human is in the loop (e.g., reviewing a draft before sending), this might be considered a lower risk, as the user may notice an incorrect email address or unexpected data in the draft. However, the risk escalates drastically with fully automated tools and agents (like OpenClaw) that autonomously execute workflows.

In these automated scenarios, the user may never know the attack occurred. This is especially dangerous if the attacker includes a command to "not tell the user" or to suppress confirmation messages. The agent might simply report "Action Done," while silently leaking sensitive data or files to the attacker.

Risk Assessment

This vulnerability is classified as risk:HIGH impact:HIGH. The risk is high because the attack vector—sending an email—is trivial to execute and requires no access to the internal system, only the user's public email address.

The impact is high due to the potential for significant Data Loss Prevention (DLP) failure and privilege escalation. Attackers can manipulate the AI to read all emails, summarize sensitive content, download files, and send them to an external address. In fully automated agent workflows, this results in a silent, high-volume data breach that bypasses traditional security perimeters.


The three phases

CRAFT

Craft (write) the prompt with the following elements: Context, Register, Acting Role, Format, and Task.

ING

Validate the prompt and ensure it maintains an interactive approach. Keep in mind the importance of non-disclosure and staying goal-driven throughout the process.

AI

Continuously assess and refine the output based on the prompts output to improve the overall quality.