AI Academy · Book
Engineering Managers · Module 05 · Chapter 008

Securing AI Features Your Team Ships

An AI feature reads text it did not write and can act on what it reads. That opens attack paths a conventional review never looks for: planted instructions, leaked data and tools that can do too much. No filter closes them. A manager can still make the team draw a threat model, cap what a fooled feature can reach and prove the limits with tests before release.

≈ 15 min read

After this chapter you can

  • Draw a one-page threat model listing every source of untrusted text, what the model can see afterward and what it can do or send.
  • Spot any row where untrusted text, private reach and a way out are all open, and close at least one leg.
  • Place each tool on the permission ladder, using the asker's credentials, narrow scopes and confirmation for side effects.
  • Judge a proposed defense by what happens on the day it fails, preferring containment to detection.
  • Set a pre-release attack-test gate with zero tolerance for leaks and unconfirmed writes, and time a switch-off rehearsal.

On 14 August 2024, a security firm named PromptArmor told Slack about a problem in Slack AI, the assistant that answers questions from a workspace’s messages. In the researchers’ scenario, a user keeps an API key in a private channel, and an attacker with an account in the same workspace posts a crafted message in a public channel where the attacker is the only member. When the victim later asked Slack AI a question, the assistant pulled in both messages and, following the attacker’s text, produced a link that carried the key to a server the attacker controlled1. As the researchers describe it, no login was broken; the assistant read a sentence and obeyed it.

That is your question as the manager of a team that ships such features: what can go wrong when someone manipulates our feature, and what must the team do before release? Prompt injection has no structural fix, so the safe stance is to limit what a fooled system can reach. This chapter turns that stance into work you can assign, review and gate on.

Four attack paths your reviews probably miss

A conventional security review asks who can call the system and what the code does with their input. An AI feature adds a second input channel: every piece of text the model reads, whether a user typed it or a document, web page, ticket or email supplied it. The OWASP Top 10 for LLM Applications, a community list, names ten risks2. Four of them cover most of what an engineering manager needs to staff.

Prompt injection (LLM01 in the list) means that text in the input changes what the model does. It comes in two kinds. In the direct kind, the user types the attack. In the indirect kind, the instruction sits inside content the feature fetches. The indirect kind is the one that surprises teams, because the attacker never touches the feature. Greshake and colleagues demonstrated it in 2023 against Bing’s GPT-4 powered chat and code-completion engines, as well as applications they built themselves3. Slack AI, above, is an indirect case.

Sensitive information disclosure (LLM02) is the model or feature revealing data it should not: another user’s documents, a system prompt full of internal rules, personal data from training or retrieval. Excessive agency (LLM06) is a feature holding more tools, permissions or autonomy than the task needs, so that one manipulated step becomes a real action. Data and model poisoning (LLM04) is bad content planted in the training data, the fine-tuning set or the retrieval index, so that the feature misbehaves later and for everyone.

A table of four attack paths, prompt injection, information disclosure, excessive agency and poisoning, with how each enters, what it yields and where the team stops it.Attack pathHow it entersWhat the attacker getsWhere the team stops itPrompt injectionTyped by a user, or hidden in a page,file, ticket or email the feature readsThe model follows theattacker's instructionLimit what the model can reachand send; do not rely on a filterInformationdisclosureA question that pulls data across auser or tenant boundaryDocuments, keys or personal dataEnforce access where data isfetched, per userExcessiveagencyA manipulated or mistakentool callActions in real systemsFewest tools, narrow scopes,confirmation for side effectsPoisoningPlanted content in the index, theexamples or a dependencyLasting, quiet misbehaviorControl who can write to sources;test after every refresh
Figure 5.8.1 Four of the OWASP LLM Top 10 risks that a design review should cover; the controls are the chapter’s synthesis, not OWASP’s wording.

The OWASP list is a community document, not a measure of how often each risk occurs; NIST’s taxonomy of adversarial machine learning attacks4 is a second shared vocabulary. Neither tells you which risk is yours.

A threat model your team can finish in an hour

For an AI feature, a one-hour version fits on a page and answers three questions in order.

  1. What untrusted text can reach the model? List every source: user messages, uploaded files, retrieved documents, web pages, tool outputs, emails, tickets, even another team’s database fields. If an outsider can write to it, it is untrusted.
  2. What can the model see that the person on the other end should not? Private documents, other tenants’ data, secrets in the system prompt, internal URLs.
  3. What can the model do or send? Every tool, every outbound request, every link or image it can render, every message it can post.

A data-theft attack of this kind needs all three: instruction, prize and exit. Simon Willison named this combination the lethal trifecta in 20255, and Slack AI, as described below, had all three. Removing any one breaks the chain, and the third is often the easiest to remove. The trifecta describes data theft, not every harm: a feature that acts on outside text without seeing anything private can still do damage through the actions it holds.

An attack needs untrusted text, private reach and a way out; removing any one of the three breaks the chain.Untrusted textOutsiders can write to whatit readsPrivate reachIt can see data the askermay notWay outIt can send, post, call or actRemove any one leg and the attack chain breaks
Figure 5.8.2 A review heuristic for where to cut a design, drawn from practitioner writing (Willison’s lethal trifecta), not a proof of safety.

Write the answers as a table: source, who can write to it, what the model can see when it reads it, and what it can do next. Any row where all three answers are “yes” gets a control or a redesign before release.

Permissions are the control that holds

Prompt-based defenses (“ignore any instructions in the document”) are requests, not enforcement. The UK National Cyber Security Centre wrote in December 2025 that a language model makes no distinction between data and instructions, that prompt injection may never be mitigated the way SQL injection was, and that teams should reduce the risk and the impact, for example by constraining what the system can do6. Plan for a successful manipulation and shrink what it can do. That puts the weight on tool permission design, which is ordinary engineering and something you can review.

  • Act with the asker’s rights, not a service account’s. If the feature fetches documents or calls an API on behalf of a user, the call should carry that user’s credentials, so the worst case is what that user could already do. A shared all-access account turns every user into the most privileged one.
  • Give each tool the narrowest scope. A tool that reads one table is not the same as one that runs queries. A tool that drafts an email is not the same as one that sends it.
  • Separate read from write. Read-only tools can be broad. Write tools, tools that spend money, send messages or change records, are few, named, and individually justified.
  • Put a person in front of side effects. Any action that is hard to undo needs a confirmation that shows the human exactly what will happen, in terms they can check, not the model’s description of it.
  • Close the exit routes. Restrict outbound requests to an allow-list of domains. Decide whether the interface may render links or images from model output, since a link or image address can carry data out. Strip or neutralize them where they are not needed.
  • Treat model output as untrusted input to everything downstream. If output goes into a query, a shell, a web page or another agent, validate and escape it as you would user input. OWASP calls this improper output handling (LLM05).
  • Cap consumption. Limits on tokens, calls and spend per user protect the budget and slow an attacker (OWASP LLM10).
Four permission levels from read-only to drafting, acting with confirmation and acting alone, with each level needing more evidence than the one below.Read-onlySearch, look up, summarizeDraftA person approves itAct with confirmationRuns after a specific yesAct aloneReversible, low impact only
Figure 5.8.3 Each rung needs more evidence than the one below; a feature should sit on the lowest rung that does the job.

Ask which rung the feature is on and which its job needs; the gap is the risk.

What defenses to expect, and what to distrust

Teams will propose input filters, “guard” models that classify prompts, hardened system prompts and output scanners. They are reasonable layers. They are not controls you can approve on their own, for a simple reason: they are probabilistic checks on a problem whose attacker keeps trying. A filter’s published catch rate on known attacks need not carry over to the next attack: in a 2025 study, Nasr and colleagues applied adaptive attacks to 12 published defenses and reported success rates above 90 percent for most, against mostly near-zero rates originally reported7. That is one study of the defenses it chose, and it does not show that every filter fails. When a proposal leans on one, ask what happens on the day it fails.

Good answers describe containment: the feature cannot reach that data, send that message or act without a person. Weak answers describe detection (“we would see it in the logs”), which comes after the damage.

Two further habits belong in the design. First, keep trusted instructions and untrusted content apart in the code and label retrieved content as data; this does not stop injection but eases review. Second, control the write side of your sources. If anyone in the company or outside it can edit a page that your retrieval index ingests, that page is an input to your feature, and poisoning is a path. Name an owner for each source and record who may write to it.

Test it before release, with a gate

A threat model that is never tested stays a document. Treat security tests like any other evaluation: a fixed set of attack cases, run on every change, with a pass criterion that blocks release.

Build the attack set from published examples, your own threat-model rows, user or red-team reports, and real incidents from other teams. Each case states the planted text, where it enters, and what counts as success for the attacker (for example, a secret appearing in output, a tool call that should not occur, or an outbound request to an unlisted domain). Because outputs vary, run each case several times and count any success as a failure of the gate. The set grows; it never shrinks.

A pre-release security gate with six checks, from the threat model to attack tests, tool scopes, cross-user probes, exit routes and a rehearsed switch-off.CheckEvidence to bringIllustrative thresholdThreat modelOne page, every untrusted source listed withits ownerNo row with all three legs openAttack testsRun on the release candidate, 5 runs per case0 successful attacks in 60 casesTool scopesList of tools with read or write, and credentials usedEvery write tool behind confirmationCross-userprobesQueries from user A for user B's data0 leaks in 30 probesExit routesAllow-list of outbound domains, link and imagerendering decisionUnlisted domain requests blockedRollback andswitch-offWho can disable a tool or the feature, and how fastUnder 15 minutes, rehearsed once
Figure 5.8.4 An illustrative pre-release security gate; set your own counts and thresholds, and keep a zero-tolerance line for leaks and unconfirmed writes.

A clean run of 60 attack cases shows only that those 60 did not succeed. Say so in the review, and keep adding cases.

Case: the assistant that read a public channel

Return to Slack AI. The timeline below is as reported by the researchers (PromptArmor), not independently audited. PromptArmor published its write-up in August 2024 and reported that it had disclosed the issue on 14 August, the same day Slack extended the assistant to include files from channels and direct messages, which the researchers said widened the attack surface1. On 19 August, according to the researchers, Slack concluded that public-channel messages are visible to workspace members and called this intended behavior. The Register then reported Salesforce, Slack’s parent, saying it had investigated a scenario in which, under very limited and specific circumstances, a malicious actor with an existing account in the same workspace could phish users for sensitive data, had deployed a patch, and had no evidence of unauthorized access to customer data8.

In the 2024 Slack AI case, a key in a private channel and a planted message in a public channel were read together, and a rendered link carried the key out.Private channelVictim stores anAPI keyPublic channelAttacker posts acrafted messageOne questionBoth messagesenter the contextLink renderedThe key leaves ina clickableaddressAs the researchers described it; Salesforce said it deployed a patch
Figure 5.8.5 The attack path as the researchers described it; the vendor’s patch details were not published in the sources used here.

Read the case against the three legs. Untrusted text: anyone in the workspace could write a public message. Private reach: the assistant could search the victim’s private channels as the victim. Way out: the assistant could render a link that transmitted data. Two points follow for a manager. First, each separate decision was defensible: public messages are searchable, the assistant answers as the user, links are a normal output. The risk lived in the combination, which only a threat model across the whole feature shows. Second, a design can match its specification and still be exploitable, as the reported “intended behavior” reply shows. The case leaves open how many workspaces were affected or whether anyone exploited it.

A team-sized worked example

The team in this scenario is imagined, and no number here comes from a real system. A team of eight builds an assistant for a support organization. It reads incoming customer emails, searches the knowledge base and past tickets, drafts replies, and can issue refunds up to a limit through an internal payments tool.

The tech lead fills in the threat-model table. Customer emails are untrusted, and anyone on the internet can write one. Past tickets contain customer text too. The knowledge base is written by 40 staff. The assistant can see all tickets for the region, and its refund tool uses a shared service account that can refund any amount. Replies are rendered in an interface that loads images from any address. Three legs are open in a single row: untrusted email text, private ticket history, and an image link that can carry data out.

The lead reviews the four changes the team agrees on, each one closing a leg or narrowing what a fooled assistant can do. Tickets are fetched with the support agent’s own credentials, so the assistant sees only what that agent could open. The refund tool becomes a draft: it prepares a refund, and the agent confirms on a screen that shows the amount, the customer and the reason. The confirmed refund is executed with that agent’s own payments rights, not the shared service account, which is retired for this tool, and the payments system enforces a cap of 50 euros per refund (an invented limit), not the prompt. Image loading is restricted to the company’s own domain.

In an illustrative support assistant, a threat-model review turned open attack legs into closed ones by narrowing credentials, confirmation, a refund cap and image domains.BEFORE THE REVIEWShared service account,refunds of any size, imagesfrom any address, all regionaltickets visibleThree legs open in one flowAFTER THE REVIEWAsker's own rights, confirmedrefund drafts under theagent's rights, 50 euro cap,company-domain images onlyEach flow has at least one leg closedvs
Figure 5.8.6 Illustrative composite: the same feature before and after a one-hour threat model and four permission changes.

The gate (starting defaults: 60 cases, 5 runs each) runs: planted refund instructions in emails, hidden text in a ticket, a request to include another customer’s address. Two cases succeed on the first run, both against the image rule, because a second template still loads remote images. The team fixes it and reruns. The release passes at 0 successes in 60 cases, plus 0 leaks in 30 cross-customer probes (all counts here are illustrative starting defaults). The lead records the result as “60 cases, not zero risk” and adds a standing task: each new customer complaint about odd behavior becomes a new test case within a week.

What this means for engineering managers

Monday action: ask the owner of any shipped AI feature that reads outside text for its one-page threat model, and send back any row with all three legs open.

Threat-model row (copy per source):
Source of text: ______  Who can write to it: ______
What the model can see after reading it: ______
What it can do or send next (tools, links, images, outbound calls): ______
All three legs open? yes / no -> control or redesign: ______
Credentials the tools use: ______  Write tools behind confirmation: ______
Attack set owner: ______  Escalation if no security engineer: ______
Attack set: ___ cases x ___ runs (illustrative gate: 0 successes); cross-user probes: ___ (0 leaks)
Switch-off owner: ______  rehearsed in ___ minutes (illustrative target under 15)

Check yourself

  1. A hardened system prompt that tells the model to ignore instructions found in documents is enough to stop prompt injection.
  2. An attacker must be able to talk to the feature directly to manipulate it.
  3. Using the asker’s own credentials for tool calls limits the damage of a manipulated step.
  4. If every individual design decision was reasonable, the feature is safe.
  5. Zero successes in 60 attack cases proves the feature is secure.
  6. Rendering links and images from model output can be a route for data to leave.

Reflection

What comes next

A feature that passes the security gate is ready to leave the building, but not to go to everyone at once. The next chapter, Releasing AI Features: Shadow, Canary and Rollback, covers how to expose it in steps, pin its versions and take it back when the signals turn.

Laws referenced

EU AI Act · EU

Regulation (EU) 2024/1689, as amended by Regulation (EU) 2026/1744

Risk-based rules. Prohibited practices include social scoring, untargeted scraping of facial images, and emotion recognition in workplaces and schools (with narrow exceptions). High-risk systems (Annex III: biometrics, safety components of critical infrastructure such as energy, water and traffic, employment and worker management, credit, education, essential services, law enforcement, migration, justice) need risk management, data governance, documentation, logging, human oversight, human oversight that keeps people able to understand the system, notice automation bias (over-reliance on its output), override it or stop it (Art. 14(4)), appropriate accuracy, robustness and cybersecurity (Art. 15), automatic logging of events (Art. 12), a provider quality-management system (Art. 17) and conformity assessment. An Annex III system is not high-risk if it poses no significant risk of harm, for example a narrow procedural or preparatory task that does not replace human assessment; systems that profile people are always high-risk, and a provider relying on this exception must document it and register (Art. 6(3)). Deployers of high-risk AI must use it as instructed, assign competent human oversight, monitor its operation, keep logs for at least six months and report serious incidents (Art. 26); employers must inform workers' representatives (Art. 26(7)). Public bodies, private providers of public services, and deployers of credit-scoring or life and health insurance pricing systems must carry out a fundamental-rights impact assessment before first use (Art. 27). Providers must run post-market monitoring (Art. 72). A deployer that puts its name on a high-risk system, substantially modifies it, or changes its purpose so that it becomes high-risk takes on the provider's obligations (Art. 25(1)). A substantial modification (Art. 3(23)) of a high-risk system needs a new conformity assessment, unless the change was pre-determined and documented at the first assessment, as with planned continuous learning (Art. 43(4)). Providers of general-purpose AI models (from 2 Aug 2025) must keep technical documentation, have a policy to comply with EU copyright law including text-and-data-mining opt-outs, and publish a sufficiently detailed summary of training content (Art. 53). Research, testing and development before a system is placed on the market or put into service is outside the Act, except testing in real-world conditions (Art. 2(8)). Since the 2026 Omnibus, the Art. 4 AI-literacy duty is an obligation of effort (take measures to support literacy), not of result. Fines reach EUR 35 million or 7% of global turnover for prohibited practices.

  • 2024-08-01 — Entered into force
  • 2025-02-02 — Prohibited practices (Art. 5) and the AI-literacy duty (Art. 4) apply
  • 2026-07-27 — Omnibus softens Art. 4: providers and deployers must take measures to support AI literacy; no specific level must be guaranteed
  • 2025-08-02 — General-purpose AI model obligations apply; governance and penalties regime in place
  • 2026-08-02 — Transparency duties (Art. 50) apply: disclose AI interaction, label synthetic and deepfake content (marking for generative systems already on the market: 2 Dec 2026)
  • 2027-12-02 — High-risk obligations for Annex III systems (e.g. hiring, credit, education, essential services) - moved from 2 Aug 2026 by the 2026 Omnibus
  • 2028-08-02 — High-risk obligations for AI in products regulated under Annex I

Last verified 2026-10-06 · official text

General Data Protection Regulation · EU

Regulation (EU) 2016/679

Personal data is any information relating to an identified or identifiable person, directly or indirectly, including by an identifier such as an online ID (Art. 4(1)). Lawful basis and purpose limitation (Arts. 5-6); processing special-category data, including biometric data used to identify a person, health data and data revealing ethnicity, is prohibited unless a specific exception applies (Art. 9); data protection by design and by default (Art. 25); processors such as AI vendors may act only under a written contract with required terms and sufficient guarantees (Art. 28); transparency to data subjects (Arts. 13-14); right not to be subject to a decision based solely on automated processing with legal or similarly significant effects (Art. 22); breach notification to the supervisory authority within 72 hours (Art. 33) and to individuals without undue delay when the risk is high (Art. 34); data protection impact assessment for high-risk processing (Art. 35). Fines up to EUR 20 million or 4% of global turnover.

  • 2018-05-25 — Applies

Last verified 2026-10-08 · official text

References

  1. PromptArmor. Data Exfiltration from Slack AI via indirect prompt injection. PromptArmor blog (Substack). 2024.
  2. OWASP Foundation. OWASP Top 10 for LLM Applications 2025. OWASP GenAI Security Project. 2024.
  3. Kai Greshake et al. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. AISec '23 (arXiv:2302.12173). 2023.
  4. National Institute of Standards and Technology. Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations, NIST AI 100-2 E2025. NIST. 2025.
  5. Simon Willison. The lethal trifecta for AI agents: private data, untrusted content, and external communication. simonwillison.net. 2025.
  6. Dave Chismon (UK National Cyber Security Centre). Prompt injection is not SQL injection (it may be worse). NCSC blog. 2025.
  7. Milad Nasr, Nicholas Carlini et al. (OpenAI, Anthropic, Google DeepMind). The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections. arXiv:2510.09023. 2025.
  8. The Register. Slack AI can leak private data via prompt injection. The Register. 2024.

Further reading

Sources last verified 2026-10-12.