Skip to main content

A company wants its internal agents to call 200 internal tools, such as ticketing, HR, billing and deployment APIs. Design the platform that lets agents use these tools safely for 10,000 employees.

System design · Pro 3

Short answer

Clarify which actions are read and which are write, and who is accountable. Build a tool registry with typed schemas, a gateway that checks the user's own permissions on every call, least-privilege scoped credentials, human approval for risky writes, sandboxed execution, budgets and rate limits, full audit logs, and defences against prompt injection from tool results.

Deeper answer

Requirements: list the tools, classify each as read, reversible write or irreversible write, and decide that the agent acts with the calling user's rights and never more. Success is tasks completed with no unauthorised action, plus a full record of who did what.

Parts: a registry holds each tool's schema, owner, risk level and version. Agents see only the few tools relevant to the task, because 200 descriptions in context hurt tool selection. Every call goes through a gateway that validates arguments, checks permissions in code with a short-lived token scoped to the user, applies rate limits and budgets, and writes an audit log. Risky writes pause for human approval with a clear preview. Code execution runs in a sandbox with no open network.

Risks: tool results and documents can carry injected instructions, so treat them as data, and limit what an agent that has read untrusted content may do next. Trade-off: more approvals mean more safety but slower work, so tie approval to risk level. What breaks first is tool selection quality and unclear tool ownership. Measure task success, approval rate, blocked calls and cost per task.

What a strong answer covers

Answer it out loud in the mock interview about 3 min

Follow-ups to expect

Common mistakes

Learn it

Permissions and sandboxing

Practice System design questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.