AI Engineering · LLM applications that ship
What guardrails belong around an LLM feature?
Short answer
Guardrails are layered checks on input, retrieval, generation and actions: policy filters, permission checks, output validation and approval gates. They belong in code, not only in the prompt.
A guardrail is any control that prevents the system from doing something harmful or out of policy. Prompts can express intent, but they are not enforcement. Real guardrails validate inputs, constrain what the model can access, check outputs and block risky actions.
- Input: length limits, rate limits, blocked content and prompt-injection heuristics.
- Retrieval: permission-aware filtering and source allowlists.
- Generation: schema validation, groundedness checks and PII detection.
- Action: tool allowlists, spend limits and human approval for irreversible steps.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Which guardrail would you add first to a customer-facing assistant?
- 2How do you handle false positives from a safety filter?
- 3Why is a prompt instruction not a sufficient guardrail?
Say it in the interview
I layer guardrails across the request. On input I rate-limit and screen for abuse. Retrieval is permission-aware. On output I validate the schema and check groundedness and PII. For actions I use tool allowlists, spend caps and human approval where the action is irreversible. The prompt expresses policy, but the enforcement lives in code, because a model can be persuaded and a permission check cannot.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live AI Engineering mock interview and get scored feedback on depth, clarity and confidence.