Home / Role Guides / AI Security Engineer

AI Security Engineer Interview Questions (2026)

Questions modeled on recurring requirements in 76 security-titled postings at 35 companies, collected in August 2026. Of those 35 companies, 25 name agents, 17 name threat modeling, and 15 name prompt injection. These are keyword counts, not verified requirements. See how the postings were collected.

An AI security engineer protects products that use large language models and agents. You threat model the system, test it as an attacker, build the controls, and respond when a control fails. Job boards list the role under several titles: AI Security Engineer, Security Engineer for AI Security, AI Red Team Engineer, and Agent Security Engineer. The interview tests threat modeling for LLM systems, prompt injection defense, agent permissions, data protection, and standard application security.

Want scored practice for AI Security Engineer?

Vote for this practice track →

Preparing for an adjacent role?

1.What does an AI security engineer do, and how is the role different from an application security engineer?

What a strong answer covers: Give the split by what you protect. An application security engineer protects code, infrastructure, and data flows that behave the same way on each run. An AI security engineer does that work too, and adds a component that follows instructions found in its input and gives different output on each run. Name the new attack surface: the prompt, the retrieved content, the tools the model can call, the training data, and the model weights. Say that titles differ between companies. Some teams do red team work only, some build guardrails, and some review each AI launch. State which of those jobs this team does.

2.Threat model a customer support assistant that reads a knowledge base and can issue refunds through a tool.

What a strong answer covers: Draw the data flow first: user, application, model, retrieval, refund tool, and logs. Mark each trust boundary. Then list who can put text in front of the model: the user, the authors of the knowledge base, and any system that writes to a ticket. Treat all of that text as untrusted. Name the assets: customer data, money, and the company's reputation. Give the top threats in order: an injected instruction that causes a refund, a reply that shows another customer's data, and abuse that increases cost. For each threat, give one control and one test. End with the risk that stays after the controls.

3.Explain the difference between direct and indirect prompt injection. Which one is harder to stop, and why?

What a strong answer covers: In a direct injection, the user types the attack into the prompt. In an indirect injection, the attack is in content that the system reads for the user: a web page, an email, a document, or a tool result. The indirect type is harder to stop. The victim is not the attacker, the content arrives through a trusted channel, and the user does not see the text. State the root cause: the model reads instructions and data in one stream and cannot reliably tell them apart. A strong candidate says that no filter removes this risk, so the design must limit what an injected instruction can do.

4.An agent can read a user's email, browse the web, and send messages. Design the controls.

What a strong answer covers: Start with the dangerous combination: access to private data, exposure to untrusted content, and a way to send data out. An agent with all three can be told by a web page to send the user's email to an attacker. Remove one of the three where you can. Give the agent the user's own permissions and no more, with short-lived credentials for each task. Require the user's approval before an action that sends data out or cannot be undone. Restrict outbound destinations to an allowlist. Run code and browsing in a sandbox. Log each tool call with its inputs. Say which controls reduce the usefulness of the agent, and how you would decide that trade with the product team.

5.The product team says the system prompt tells the model to refuse harmful requests, so the feature is safe. How do you respond?

What a strong answer covers: Say that a system prompt is guidance for the model, not a security boundary. A user can often get the model to ignore the guidance, and can often get the model to print the prompt. Then give the rule: enforce each security decision in code outside the model. Check access rights in the application. Validate tool arguments on the server. Keep secrets and API keys out of the prompt. Keep the prompt instruction, because it reduces accidents, but do not count it as a control. Offer a short test to make the point: ask the team to give you an hour to attack the feature in a test environment.

6.A RAG system indexes documents with different access rights. How do you stop one user from seeing another user's data?

What a strong answer covers: Enforce access at retrieval time, in code, with the identity of the person who asks. Store the access metadata with each chunk, and filter the search by that metadata before the text reaches the model. Do not ask the model to hide restricted text. Keep the index in sync when rights change in the source system, and state how long a removed right can stay in the index. Separate tenants at the index level when the data is sensitive. Check the caches too, because a cached answer can cross users. Test with two accounts and a document that only one account can read.

6 questions read. Want these scored?

Vote for this practice track →One click, no account needed. Sign up free →

7.How do you plan and run a red team exercise against an LLM application?

What a strong answer covers: Agree on scope, goals, and rules before you start: which systems, which accounts, and what counts as a finding. Write the goals as harms to the business, for example data from another tenant, an action without approval, or content that breaks policy. Use manual testing first to find new attack paths, then automate the paths that work so you can measure a success rate. Run each attack several times, because the model's output changes between runs. Report each finding with the prompt, the success rate, the impact, and a fix. Turn the findings into regression tests that run on each model or prompt change.

8.An engineer wants to render model output as HTML and pass model-generated SQL to the database. What are the risks?

What a strong answer covers: Treat model output as untrusted input, the same as text from a user. An attacker who controls part of the prompt controls part of the output. Rendered HTML or Markdown can run script in the user's browser. An image link in the output can send data to an attacker's server when the browser loads the image. Generated SQL can read or delete data outside the user's scope. Give the standard fixes. Encode output for the context, and block or proxy external links and images. Use parameterized queries or a restricted query builder. Run the query with a read-only role limited to the user's data.

9.The team wants to fine-tune on customer conversations and download an open-weight model from a public hub. What do you check first?

What a strong answer covers: Split the answer into data and supply chain. For the data: confirm that the customer agreement permits training, remove personal data and secrets before training, and assume the model can repeat text from the training set. Ask who can query the fine-tuned model, because each of those users can extract what the model learned. For the downloaded model: verify the publisher, pin the exact version and hash, and prefer a weights format that cannot run code when loaded. Scan the files, and load them first in an isolated environment with no network access. Record the model, the data source, and the license in an inventory.

10.What do you log for an LLM application, and how do you detect an attack in production?

What a strong answer covers: Log enough to rebuild an incident: the user identity, the prompt, the retrieved document IDs, each tool call with arguments and result, the output, and the model version. Prompts contain personal data, so set access rules and a retention period for the logs. Then give the detection signals: a spike in refusals or guardrail blocks from one account, tool calls outside the normal pattern, and requests that try to read the system prompt. Add unusual token volume and outbound requests to new domains. Send the signals to the same on-call process as other security alerts. Say which signals give many false alarms and how you would tune them.

11.A user reports that the assistant showed another customer's order details. Run the incident response.

What a strong answer covers: Contain first. Turn off the feature or the affected path, and keep the logs. Then find the cause from evidence, not from guesses. Check the usual causes in order: a shared cache, a missing access filter in retrieval, a tool that ran with a service account, or session data mixed between requests. Measure the scope: which users, which data, and for how long. Bring in legal and privacy staff early, because a notice to customers can be required. Fix the cause, add a test that reproduces the leak, and write the review without blame. A candidate who starts by changing the prompt fails this question.

12.The team asks you to approve a customer-facing agent launch in two weeks. You found open risks. How do you decide, and how do you explain the decision?

What a strong answer covers: Rank the open risks by impact and by how easy the attack is, and separate the ones that block launch from the ones that can wait. Give the blockers in business terms: money moved without approval, or customer data shown to the wrong person. For each blocker, offer a path that keeps the date: remove one tool, add human approval for one action, or launch to a small group first. Put the accepted risks in writing with an owner and a date for each. Do not say only yes or no. The interviewer checks that you can protect users and still help the team release the product.