TechSchool
Home / Interview questions / AI engineering / Safety, Security and Responsible AI

Safety, Security and Responsible AI Interview Questions

Short answers to 10 safety, security and responsible ai interview questions.

Questions and answers (10)

Answers are written in plain English and reviewed for technical accuracy. Each answer states the point first, then the reason.

1. What is prompt injection (direct and indirect), and what is your layered defence?

Prompt injection is an attack where text in the input makes the model follow the attacker's instruction instead of yours. Direct injection comes from the user. Indirect injection hides the instruction in content the model reads, such as a web page or a document. A layered defence uses input checks, a clear instruction hierarchy, least-privilege tools and output checks. No single layer stops every attack, so you need all of them.

2. Walk me through the OWASP Top 10 for LLM applications and which ones actually bite in practice.

The OWASP Top 10 for LLM applications lists the main risks for LLM systems. It covers prompt injection, insecure output handling, training data poisoning, model denial of service, and supply chain. It also covers sensitive information disclosure, insecure plugin design, excessive agency, overreliance and model theft. In practice, prompt injection, insecure output handling and excessive agency cause the most real incidents. Sensitive information disclosure also causes many incidents because prompts and logs leak data.

3. What is the difference between jailbreaking and adversarial prompting?

Jailbreaking aims to make the model break its own safety rules. Adversarial prompting aims to make the model fail a task, for example by adding text that causes a wrong answer. Jailbreaking targets the policy. Adversarial prompting targets accuracy. A single odd suffix can change a classifier output, and that is an adversarial attack, not a jailbreak.

4. Design guardrails for a consumer-facing assistant. Input filters, output filters, or both?

You need both input filters and output filters. Input filters block known bad requests and reduce cost. Output filters catch unsafe or wrong content that passes the model. Output filters add latency, so run cheap checks first and deep checks only on risky output.

5. What is Constitutional AI and how does it differ from RLHF? What is RLAIF?

Constitutional AI trains a model to critique and revise its own answers against a written set of principles. RLHF uses human preference labels to train a reward model. Constitutional AI replaces most human labels with AI feedback, and that method is RLAIF. RLAIF is cheaper and faster, but it inherits the biases of the judge model.

6. How do you prevent an agent with tool access from exfiltrating data via a malicious web page?

Treat all web content as untrusted data and never as instructions. Run the agent with least privilege and give it no direct network egress. Send fetched pages through a separate reader that strips instructions and returns only facts. Log every tool call and block any call that sends data to an unknown host.

7. How do you handle PII in prompts, logs and training data?

Detect and remove PII before the data reaches the prompt, the log or the training set. Use a tokenizer-based detector plus regex rules for names, emails and account numbers. Store logs with PII masked and keep the raw data in a restricted store with a short retention time. For training data, keep a record of consent and run a PII scan on every batch.

8. What is mechanistic interpretability and why do labs invest in it?

Mechanistic interpretability studies the internal circuits of a model to explain why it produces an output. Labs invest because it can find safety failures before deployment and can support debugging. It also helps with model editing and with trust from regulators. The cost is high, because one small circuit can need many experiments to confirm.

9. How would you audit a deployed model for differential performance across user groups?

Measure the model metric for each user group on a held-out set. Compare the gaps between the groups. Also check the data balance and the tokenizer behaviour for each group. A common target is a gap below 2 points between groups. Retest after each model or data change.

10. Design a red-teaming programme for a model you are about to release.

Run a red-team programme with fixed attack categories, a fixed test set, and a fixed severity scale. The team writes prompts for each category and records the model response and the harm level. Set a release gate, for example a block on any high-severity failure. Repeat the test after each fix.

Related lessons
Ai security Ai ethics Ai agent intro Ai transformer