Skip to content

    AI Architect Case Files

    Case: Email Summariser Injection, Trust Boundaries

    A composite case on an email-summarising assistant: why text in a message can steer it, and how a tool-less step, output checks and approvals contain it.

    By Published 6 min read

    • ai-architect
    • case-file
    • industry-financial-services
    • pattern-trust-boundaries
    • failure-injection
    • kind-composite
    Share

    Composite scenario, not a real company. Assembled from common industry patterns; every number is illustrative and its assumptions are listed at the end.

    This case belongs to Security and Threat Modeling for AI Systems. For a sourced real-world example of the same class of failure, read EchoLeak. Defensive framing only: the examples below are placeholders, not working payloads.

    Context

    • A financial-services operations team receives about 6,000 emails a day in shared mailboxes: customer queries, supplier mail and messages from unknown senders.
    • An assistant summarises each email for the agent and suggests a next step, such as looking up an account or drafting a reply.
    • Version 1 puts the rules, the email text and three tools (account lookup, draft reply, send reply) into one prompt and runs with one shared service credential.

    Problem statement

    Question from the security review Finding
    Who wrote the text in the prompt? The firm wrote the rules; the sender wrote the email. The model sees both as one block of text
    What if the email contains a sentence addressed to the assistant? Example, non-functional: [sentence asking the assistant to reply to a third party]. Nothing in version 1 stops the model acting on it
    What can the summarising step do? Call any of three tools with the shared credential

    Goals (illustrative targets): zero tool calls caused by email content, and every outbound message approved by a person.

    Constraints

    • Anyone can send anything: plain text, HTML, long forwarded threads.
    • Agents expect a summary within 5 seconds.
    • Account lookups are personal data, so access must be attributable to an agent.
    • The model provider receives no credentials.

    Why the traditional approach fell short

    Keyword routing sorts mail by topic but cannot summarise it. Spam and malware filters judge volume, attachments and reputation; a polite paragraph aimed at an assistant looks like ordinary business mail to them. Manual reading is safe and slow: 6,000 emails at 90 seconds each is 150 hours a day. The model removes the reading cost and, in version 1, also removes the separation between "text to read" and "instructions to follow".

    Options considered

    Option Verdict
    A. No model: keyword routing, templates and people reading the mail (the simpler, non-AI option) Kept as the fallback for sensitive mailboxes, and as the right answer if the summary is not worth the control work
    B. Keep the design, add an injection classifier in front Rejected as the only control: a message that passes it still reaches a step that has tools
    C. Split the work: a summariser with no tools and a fixed output shape, actions proposed by rules and approved by a person Accepted: a steered model has nothing to act with

    Solution architecture

    Figure 1. Zones for the redesigned mail assistant

    flowchart LR accTitle: Redesigned email summariser with trust zones accDescr: An external sender's email enters the mail gateway, which tags it external. The summariser worker has no tools and calls the model through the model gateway. Its output goes through an output check; failures go to a quarantine queue and passes go to the Client app. Actions go from the Client app through the Approval service and Policy engine to the Tool server. Thick arrows cross a trust boundary. subgraph ZA["Zone A: untrusted"] S["External sender"] end subgraph ZB["Zone B: intake, no tools"] MG["Mail gateway: tag external, strip active content"] W["Worker: summariser"] OC["Output check: schema, URLs, length"] QU["Quarantine queue"] end subgraph ZC["Zone C: agent desk and actions"] CA["Client app"] AP["Approval service"] PE["Policy engine"] TS["Tool server"] end MGW["Model gateway"] LLM["LLM provider"] S ==>|"email"| MG MG ==>|"tagged email"| W W --> MGW ==> LLM W --> OC OC ==>|"pass: plain-text summary"| CA OC -->|"fail"| QU QU --> CA CA ==>|"agent approves"| AP AP --> PE PE ==>|"scoped credential"| TS

    How to read this: only Zone C can act, and it is reached from Zone B through a person.

    Figure 2. Runtime path in the fixed design

    sequenceDiagram accTitle: Email summarising with output check and approval accDescr: The mail gateway passes a tagged email to the worker, which asks the model for a fixed-shape summary through the model gateway. An output check validates it. If it passes, the Client app shows plain text and a rule table proposes an action that an agent approves; the Approval service asks the Policy engine, which allows a scoped credential for the Tool server. If it fails, the email goes to quarantine with a warning. autonumber participant M as Mail gateway participant W as Worker participant G as Model gateway participant L as LLM provider participant K as Output check participant C as Client app participant A as Approval service participant P as Policy engine participant T as Tool server M->>W: email tagged external W->>G: rules plus email in an untrusted block, no tools G->>L: model request L-->>G: summary, category, urgency G-->>W: fixed-shape answer W->>K: validate schema, URLs, length alt passes K-->>C: plain-text summary Note over C: A rule table maps category to a suggested action C->>A: agent approves the action A->>P: may this agent run it? P-->>A: allow plus short-lived scoped credential A->>T: run action else fails K-->>C: quarantined with a warning, original email shown end

    How to read this: the model's output is never an instruction to a tool; a rule table and a person sit between them.

    How AI solved it, step by step

    The stepper runs one hostile email through both designs.

    One hostile email, two designs (interactive when JavaScript is on)

    As designed

    1. Email arrives. A long thread ends with a sentence addressed to the assistant. In this illustration its content is a placeholder.
    2. One prompt. The worker puts the rules, the email text and three tools into the same prompt. Nothing marks the email as data.
    3. Model follows the text. The model treats the sentence as an instruction and requests the send-reply tool.
    4. Worker executes. The tool runs with the shared service credential. There is no policy check and no person.
    5. Message leaves. The agent sees an ordinary summary. The send is found, if at all, in an audit.

    With the fix

    1. Gateway tags and strips. The mail gateway marks the message external and removes hidden or active content.
    2. Marked, tool-less prompt. The email sits in a block marked untrusted and the model is told to summarise it. This step has no tools.
    3. Fixed-shape answer. The model returns a summary, a category and an urgency, nothing else.
    4. Output check. Schema valid, no URL off the allow-list, length within the cap. A failure goes to quarantine.
    5. Rules propose, a person approves. A table keyed on category suggests the action; the agent approves it.
    6. Policy and execution. The Policy engine checks, the Tool server runs with a 60-second scoped credential, and an audit event is written.

    Under the hood

    A model has no enforced boundary between instructions and data: both are tokens in one context. Marking the email as untrusted asks the model to behave; it is not a barrier. So the design assumes step 2 can be steered and limits what a steered step can do.

    Ask three questions of every step that reads untrusted text.

    Question Version 1 Fixed design
    What can it do? Call three tools Nothing: no tools
    What can it emit? Free text and tool arguments A fixed schema, shown as plain text
    What does its output trigger? Tool calls directly A rule table, then a person

    The mechanism and the attack steps are in Direct and indirect injection attack chains.

    What went wrong / failure modes

    Failure What the system does Why
    The model is steered into a misleading summary Shows the summary labelled as AI-written, with the original one click away; actions still need approval Limiting actions does not make wording trustworthy
    A steered category proposes the wrong action The approval screen shows the full action; the Policy engine limits what any agent can run A person and a policy both sit after the model
    The output check quarantines a legitimate email Shows the original email with a warning A false quarantine costs a minute; a missed attack costs more
    Approval fatigue Groups similar actions and samples approved ones for review Approvals only work if people read them
    Someone adds a tool to the summariser A configuration test fails the build if that step lists any tool Capability creep is the usual regression

    Results

    These are illustrative targets, not measurements.

    Target Value
    Tool calls caused by email content, in a 200-email adversarial test set 0 (structural: the step has no tools)
    Non-allow-listed URLs rendered to agents 0
    False quarantines at most 2% of 6,000 = 120 a day
    Actions needing approval 15% of 6,000 = 900 a day, about 7.5 hours of review at 30 seconds each
    Output check, added latency 20 ms

    Tradeoffs and when NOT to use this approach

    • Review time is a real cost: 900 approvals a day is nearly a full-time role.
    • The fix limits what a steered model can do. It does not stop a wrong summary.
    • It does not address malicious attachments.
    • If the team will not run an approval queue, use option A.

    Design rules extracted

    1. Give a step that reads untrusted text no tools.
    2. Fix the shape of its output and render it as plain text.
    3. Let code, not model output, choose which action is proposed.
    4. Put a person and the Policy engine between a proposal and an action.
    5. Test that the untrusted-text step stays tool-less.

    Assumptions

    • 6,000 emails a day; reading cost 6,000 x 90 s = 540,000 s = 150 hours.
    • 15% need an action review: 6,000 x 0.15 = 900; at 30 s each, 900 x 30 = 27,000 s = 7.5 hours.
    • 2% false quarantine: 6,000 x 0.02 = 120.
    • The 200-email test set, the 5 s summary budget, the 20 ms check, the 60 s credential and all names are invented for illustration.

    Last verified: 2026-10-22

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments