KatInterview

Build a Controlled Enterprise Agent System with State and Guardrails

System DesignModel answer
MediumModel answerSystem Designagentsplatform-architecturesecurity

Last updated

Design a platform that executes agent tasks safely in enterprise environments, balancing model autonomy with workflow constraints and permission checks.

You are building a platform that runs agent-based tasks for enterprise customers. The platform must handle requests that retrieve internal data and perform actions on business records, all while maintaining security boundaries and acceptable response times.

Your system needs to support both structured sequences with known validation rules and exploratory tasks where the model determines the next step. Some operations read information, others modify enterprise state, and certain changes require human approval before execution.

Design the platform's architecture and explain your approach to the following areas:

Request Processing and State Management

Describe how requests enter the system, how execution state persists across steps, and how you maintain the user's identity and permissions throughout a run. Walk through a scenario where the system retrieves data and then proposes updating a business record.

Task Execution Strategy

Explain when you would use a fixed workflow versus letting the model choose actions dynamically. Show how your platform supports both patterns and prevents unbounded loops or unproductive exploration.

Security and Approval Controls

Detail how the platform handles untrusted content (including instructions embedded in retrieved documents), enforces permission boundaries at tool execution time, and manages approval workflows for high-impact actions. Distinguish between checks the model performs and enforcement the platform guarantees.

Response Time Optimization

Break down where time is spent during execution and propose concrete improvements. Identify opportunities for parallelism, caching, and optimization while preserving correctness. Explain how deadlines and cancellation work when external approvals or long-running tools are involved.

Assumptions

State your assumptions about workload characteristics, failure modes, and scale before proposing specific implementation choices. You are not expected to invent service-level targets, but should justify architectural decisions based on reasonable enterprise platform requirements.

Hints

Hint 1

Think about what state must survive a crash and what can be reconstructed or safely retried

Hint 2

Consider who decides each action—the model, a predefined graph, or a human—and where those decisions happen

Hint 3

Separate data retrieval from authority; retrieved content should never grant permissions to execute tools