Skip to content

Interview question · Security Foundations & Threat Modeling

Threat-model a customer-support chatbot that answers from a knowledge base and can look up orders.

The order lookup is the whole interview. Candidates who spend ten minutes on jailbreaks and two on authorization have it backwards.

mediumEssentialNewPreparation tags: Amazon, Google, MicrosoftUpdated Nov 2026

TL;DR: Draw the flow: customer, chat service, context assembler, model, knowledge base, order tool, renderer. The top risks are order data for the wrong customer (authorization must use the session's customer ID in code, never an ID the model supplies), injected instructions from the customer or from knowledge-base content steering the bot, unsafe rendering of its replies, and cost abuse. Prompt instructions and classifiers lower rates; the order tool's ownership check is what holds the boundary.

How to approach it

Ask three questions first: are customers signed in when they chat, who can edit the knowledge base, and can the bot take actions beyond lookup (refunds, address changes)? The answers change the threat model more than anything about the model itself. Then sketch the data flow and say you will start with the order tool, because it is where the bot touches data that belongs to one customer.

A strong answer

FIG · THREAT-MODEL A CUSTOMER-SUPPORT CHATBOT THAT ANSWERS FROM A
Support chatbot: where trust changes

Customer

Signed in

Chat service

Holds the session

Model

Order tool

Checks ownership

Orders DB

Also in the picture

Knowledge base

  • Staff-edited
1/2

The model asks, the tool decides

The model may request order 4412 because a customer asked or because injected text told it to. The tool ignores who asked and checks the order against the session's customer ID.

Assets and adversaries. Assets: customers' order and personal data, the company's brand (what the bot says), and model spend. Adversaries: a signed-in customer trying to see other people's orders or extract policy exceptions; anyone who can influence knowledge-base content; and anyone who can script the chat endpoint.

Threats, by boundary.

BoundaryThreatControl that holdsControl that helps
Model to order toolBot fetches another customer's order (asked directly or via injection)Tool takes the customer ID from the authenticated session, not from model arguments; checks ownership on every callPrompt instructions to stay on topic
Customer to modelDirect injection to extract the system prompt or make policy promises ("approve my refund")Nothing secret in the prompt; actions like refunds go through policy code, not the model's say-soInput classifiers, refusal training
Knowledge base to modelA poisoned or careless article steers answersEdit permissions and review on the knowledge base; content provenanceInjection detection on retrieved text
Model to rendererReply contains markup or a link that leaks dataRender as text or sanitised Markdown; no external imagesOutput filtering
Customer to serviceScripted abuse runs up model costPer-user rate and token limitsBot detection
LogsTranscripts hold personal data with broad accessRedaction, retention limits, restricted access

What would change the answer. If the bot can issue refunds, the refund tool needs its own limits and a policy check in code, and large refunds need human approval shown from the call's parameters. If anonymous visitors can chat, the order tool must require verification before any lookup.

What interviewers probe next

  • "Customers ask for orders by number. Can't the model pass the number through?" It can pass the number; it must not be trusted to pick the customer. The tool resolves the order and checks it belongs to the session's customer.
  • "How would you test this before launch?" Automated cases that request other customers' orders through direct and injected prompts and expect denial from the tool, plus a red team pass on refunds and policy promises.
  • "Legal says the bot must never promise refunds. How?" Any commitment comes from policy code; the model's text is labelled informational, and an output check catches promise language as a backstop.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A bank launches a chatbot that answers account questions and can look up recent transactions for the logged-in customer.

  1. Start here

    What does the flow look like?

How it's scored

Weak: Focuses on jailbreaks and content filters; lets the model pass the customer identifier to the order tool.

Hire: Puts ownership checks in the tool using the session identity, covers injection from both the customer and the knowledge base, and limits cost.

Strong Hire: Separates holding controls from helping ones, covers rendering and logs, and shows how the model changes when refunds or anonymous chat are added.

Common mistakes

  • Trusting a customer ID that came from the model's tool arguments.
  • Treating knowledge-base content as trusted because staff wrote it.
  • Putting discount codes or internal policies in the system prompt.
  • Ignoring transcript storage as a data store with its own risks.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.