All jobs / AI engineer / AI Safety & Guardrails
AI engineer interview question · 0–1 years
What is a guardrail in an LLM application, and where does it sit?
The strongest answer
A check outside the model that enforces policy the prompt cannot guarantee — on the input before the call and on the output before it reaches a user or a tool — written as code or a separate classifier
Why it works
Exactly — the prompt asks, the guardrail checks. Because it runs outside the model, it still works on the day the model ignores its instructions.
What a good answer covers
- The prompt asks; the guardrail checks.
- Check input before the model call.
- Check output before users or tools.
- Keep the policy in code you own.
Answers that fall short
- Close, but not the strongest: A filter that scans the model’s answer for banned words before the answer is shown to the user
That is one guardrail. The idea is wider: input checks, output checks, schema and business-rule validation, and checks before a tool runs. - Weak: The rules in the system prompt that tell the model which topics to avoid; the model enforces them on itself
Prompt rules shape behaviour but guarantee nothing; a guardrail is what holds when the model does not follow them. - Red flag: Something the model vendor already builds in, so an application team does not need to add any of its own
The vendor’s safety training covers general harms, not your product’s policy. Relying on it alone means nobody owns what your app says.
Who gets asked this
More AI Safety & Guardrails questions
- Your assistant gets a question it has no information to answer. What should happen, and how do you get that…
- A health-information assistant was tightened after a complaint. It now refuses ordinary questions about…
- How do you make sure the assistant cannot commit the company to things that are not true?
- Your output content filter is a separate classifier call, and your answers stream to the user. What happens…
- What do you build, and what do you refuse to leave to the model?
- Your organisation is about to launch an LLM feature that summarises and ranks CVs for recruiters. A…