AI Security Interview Prep
Prompt injection, RAG security, agent security and governance questions from AI security interviews, with model answers.
Explain the Threat Model, Not Just the Model
Strong answers name assets, boundaries, controls and evidence. Prompts do not grant permissions. State assumptions and adapt examples to your experience.
1. What makes an LLM application’s attack surface different from a conventional web application?
Model answer: LLM apps add untrusted natural-language and retrieved content to familiar identity, API, database and dependency risks. I map data flows and ensure generated text cannot bypass server-side authorization or output validation.
What interviewers look for:
- Maps the model and surrounding application surfaces.
- Separates model behavior from trusted authorization.
2. How do you use OWASP Top 10 for LLM Applications in a security review?
Model answer: I use the current OWASP LLM Top 10 as a risk taxonomy, mapping applicable categories—such as prompt injection, disclosure, supply chain, poisoning, improper output handling and excessive agency—to controls and tests. It is not certification.
What interviewers look for:
- Uses current OWASP terminology and verifies the source.
- Maps relevant risks to controls and evidence.
3. What is prompt injection, and why is a prompt-only fix insufficient?
Model answer: Prompt injection is untrusted direct or retrieved content steering model behavior. Since model boundaries are imperfect, I limit context and tools, enforce access in code, validate output, confirm risky actions, monitor and test.
What interviewers look for:
- Explains direct and indirect untrusted inputs.
- Recommends layered controls, not a perfect filter.
4. How would you threat-model a campus knowledge assistant?
Model answer: For a campus assistant, I map learners, records, credentials and boundaries across browser, app, retrieval, provider and tools. I test cross-learner access and sensitive logging, assign controls and owners, record residual risk and reassess on changes.
What interviewers look for:
- Names assets, actors, boundaries and impact.
- Includes test evidence, ownership and reassessment.
Protect Context Before It Reaches the Model
5. How do you prevent cross-tenant data leakage in RAG?
Model answer: Apply authorization using authenticated principal and trusted metadata before context reaches the model. Test synthetic tenants across retrieval, reranking and caches; a prompt and response are not access controls.
What interviewers look for:
- Enforces access before prompt construction.
- Tests tenants, caches and alternate retrieval paths.
6. What would you log for an AI security incident?
Model answer: Log request ID, timestamp, environment, model config, policy and tool decisions, validation outcome and latency; exclude secrets and raw content by default. Govern any necessary sample with purpose, access and retention limits.
What interviewers look for:
- Balances investigation with privacy and retention.
- Uses correlation IDs and protected, minimal evidence.
7. How do you handle personal data in prompts and outputs?
Model answer: Minimize fields before provider transfer; redaction is imperfect and pseudonyms may be linkable. Restrict logs, review provider handling, validate output and enforce access in code. For India, consult current DPDP materials with a privacy or legal owner.
What interviewers look for:
- Prioritizes minimization and layered privacy controls.
- Avoids unsupported legal claims or guarantees.
8. Why is generated output considered untrusted input?
Model answer: Output can be false, malformed or unsafe for its destination. Parse a strict schema, validate semantics, encode for rendering, parameterize database calls and recheck identity and authorization before actions.
What interviewers look for:
- Distinguishes parsing from truth and authorization.
- Names context-appropriate output handling.
Limit What the Model Can Cause
9. How do you secure an agent that can call business tools?
Model answer: Expose narrow tools with validated arguments. The server authenticates users and checks ownership and policy, with confirmations, bounds, idempotency and audit where needed; the model proposes, the service authorizes.
What interviewers look for:
- Uses least privilege and server-side authorization.
- Bounds actions and accounts for retries and audit.
10. What is excessive agency, and how would you reduce it?
Model answer: Excessive agency is more autonomy or permission than a task needs. Remove unnecessary tools, separate read and write, use least privilege and approvals for high-impact actions, and test that denials have no side effects.
What interviewers look for:
- Treats autonomy as a permission design choice.
- Separates read/write capability and tests denial.
11. How would you assess a third-party model or dataset?
Model answer: Review source, revision, publisher, license, dependencies and data provenance; evaluate in isolation with synthetic tests. Verify the deployed digest from trusted approval, noting a hash does not establish safety; plan updates and rollback.
What interviewers look for:
- Covers provenance, evaluation and update lifecycle.
- Distinguishes artifact identity from behavioral trust.
12. What is data or model poisoning?
Model answer: Poisoning manipulates training examples or artifacts to change behavior. Protect sources, labels, revisions and evaluation data. Distinguish poisoned training from malicious retrieved content; use MITRE ATLAS to structure testable threat hypotheses.
What interviewers look for:
- Separates training-data, artifact and retrieval risks.
- Uses provenance and independent evaluation.
Demonstrate Evidence and Ownership
13. How would you conduct an AI red-team exercise?
Model answer: Get written authorization, scope, accounts, window, prohibited actions and stop conditions. Use synthetic cases to test retrieval, tools, privacy and output; minimize evidence, report safely, remediate and add regression tests.
What interviewers look for:
- Starts with written scope and synthetic data.
- Includes remediation, minimal evidence and retesting.
14. What role do automated AI security scanners play?
Model answer: Scanners broaden coverage but produce false positives and miss application-specific issues. Check data handling and scope, treat findings as hypotheses, validate safely and add deterministic tests; scores are not certification.
What interviewers look for:
- Understands scanner limits and authorized scope.
- Validates findings and adds repeatable checks.
15. How would you use the NIST AI RMF in a security program?
Model answer: Govern defines accountability, Map identifies context, Measure evaluates risk and Manage prioritizes action. Apply iteratively with evidence and owners; NIST AI RMF is voluntary guidance, not compliance certification.
What interviewers look for:
- Accurately explains all four NIST AI RMF functions.
- Treats the framework as guidance, not certification.
16. How do you respond to a suspected sensitive-data disclosure?
Model answer: Follow incident process to confirm, contain, preserve minimal evidence, scope impact and coordinate security, privacy and legal owners. Recover, verify controls and add regressions; notification decisions follow approved policy and current requirements.
What interviewers look for:
- Covers containment, evidence and appropriate escalation.
- Includes recovery and avoids unsupported claims.
Show That Controls Live in Application Code
These examples illustrate selected controls; production systems need reviewed security controls.
from pydantic import BaseModel, ConfigDict, Field, ValidationError
class Answer(BaseModel):
model_config = ConfigDict(extra="forbid")
text: str = Field(min_length=1, max_length=1000)
category: str = Field(pattern="^(delivery|billing|other)$")
def parse_model_output(raw: str) -> Answer:
try:
return Answer.model_validate_json(raw)
except ValidationError as error:
raise ValueError("Invalid assistant response") from error
candidate = '{"text":"Your delivery is being checked.","category":"delivery"}'
print(parse_model_output(candidate).category)Parsing checks shape, not truth or access. Use authenticated identity and source-of-truth data for those checks.
from dataclasses import dataclass
@dataclass(frozen=True)
class RefundRequest:
order_id: str
requested_by: str
amount_minor_units: int
def can_refund(
request: RefundRequest,
authenticated_user: str,
order_owner: str,
approved: bool,
limit_minor_units: int,
) -> bool:
return (
request.requested_by == authenticated_user
and order_owner == authenticated_user
and approved
and 0 <= request.amount_minor_units <= limit_minor_units
)
request = RefundRequest("order-demo", "user-demo", 2500)
print(can_refund(request, "user-demo", "user-demo", False, 10000))A denied action must have no side effect. Record a minimal protected event and obtain approval through a trusted user interaction.
from dataclasses import asdict, dataclass
import json
@dataclass(frozen=True)
class Event:
request_id: str
event_type: str
policy_result: str
component: str
def serialize(event: Event) -> str:
# Keep prompts, secrets and personal details out of routine events.
return json.dumps(asdict(event), separators=(",", ":"))
print(serialize(Event("req-demo", "tool_check", "denied", "refund")))| Claim | Evidence to describe |
|---|---|
| Secure retrieval | Authorization before prompt assembly; synthetic cross-tenant denial test |
| Validate output | Strict parsing, semantic checks, safe fallback and downstream authorization |
Common Interview Mistakes
Claiming prompt engineering eliminates prompt injection
Why: Natural-language instructions are not a hard authorization boundary.
Fix: Describe layered controls and enforce permissions in trusted services.
Saying a scanner or framework guarantees security
Why: Tools and frameworks organize work but cannot prove every system property.
Fix: Explain what was tested, what evidence exists and what residual risk remains.
Treating valid JSON as a safe action
Why: A schema checks structure, not ownership, truth or user approval.
Fix: Add semantic validation, authenticated identity and server-side authorization.
Giving a generic answer without assumptions
Why: The best control depends on data sensitivity, autonomy, users and impact.
Fix: Clarify scope, state assumptions and describe how you would verify the unknowns.
Practice a Structured Security Answer
Practice
Run a mock AI security interview
- Choose four questions above and answer each in two minutes using asset, boundary, control, evidence and residual risk.
- Sketch a RAG assistant data flow and mark where tenant authorization must be enforced.
- Review a hypothetical model-release record and list missing provenance, evaluation and rollback details.
- Explain how you would contain a blocked-but-repeated tool request without logging raw conversation content.
- Ask a peer to challenge one assumption and revise your answer with a concrete verification step.
Hint: Share only accurate, authorized examples; explain how you would test controls you have not implemented.
Communicate Security as Engineering
🎯 Key Takeaways
- ✓Strong AI security answers follow the system’s data flow and identify trust boundaries.
- ✓Prompts guide model behavior; application code enforces identity, authorization and business rules.
- ✓OWASP LLM risks and MITRE ATLAS provide useful, evolving references—not guarantees or permissions.
- ✓NIST AI RMF organizes risk work through Govern, Map, Measure and Manage.
- ✓Use synthetic cases, minimal evidence and authorized environments for testing.
- ✓Describe trade-offs, owners, validation evidence and residual risk; never overstate compliance or certainty.
Next
What comes next
You have completed AI Security & LLM Security. Continue with Cybersecurity to strengthen the foundational skills behind secure AI engineering.
Next course · Cybersecurity →HELP US IMPROVE
How was this lesson?
Your note is shared with the Chaduvuko team for review. Please don’t include personal or sensitive information.
Spotted a mistake or something unclear? Suggest a fix on GitHub or email us. Select the text first and it is quoted for you.
Discussion
0Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.
