Agents interview question · Most asked
Design an AI agent that resolves customer support tickets using internal tools. How do you keep it safe?
Design Asked in Native AI Engineer · Forward Deployed Engineer (FDE) interviews
Summary
Give the agent narrow, well-described tools (look up order, issue refund up to a limit, create a ticket), run it in a loop with clear stop conditions, require human approval for risky actions, and log every step. Safety comes from least-privilege tools, validation in the tools themselves (not in the prompt), limits on cost and steps, and evaluation on realistic tickets before and after release.
Longer Answer
- Tools: typed inputs, server-side permission checks per customer, idempotency for actions, clear errors the model can recover from.
- Policy: refunds above a threshold, account changes and anything irreversible go to a human queue.
- Prompt injection: ticket text and retrieved documents are untrusted; they can't grant permissions or change instructions; tools enforce rules regardless of what the model asks.
- Limits: maximum steps, tokens and spend per ticket; timeouts; fallback to a human.
- Observability: traces of every model call and tool call; dashboards for resolution rate, escalations, errors and cost.
- Evaluation: a set of historical tickets with expected outcomes, run on every prompt or model change.
Key Points
- Narrow tools with server-side checks.
- Human approval for risky actions.
- Treat all external text as untrusted.
- Step, token and cost limits.
- Trace everything; evaluate on real tickets.
Explanation
What interviewers look for
Enforcing safety in code and process rather than trusting the prompt.
More Agents questions
- Agents leaf: What is structured function calling?
- Agents leaf: How do you sandbox tool execution?
- Agents leaf: How do you prevent infinite tool loops?
- Agents leaf: How do you evaluate agent task success?
- Agents leaf: How should tool schemas be designed?
- How do you stop an agent from looping forever or running up a huge bill?
- Agents leaf: What is the ReAct pattern?
- Agents leaf: When should you avoid agents?