Hard

Design a Secure Cloud Coding Agent System Design Interview

Design isolated execution, permissions, credentials, networking, and auditability for an autonomous coding agent.

1. Problem Statement

Design a cloud coding agent that can clone repositories, edit code, run commands, and open pull requests without exposing user credentials or the host.

2. Architecture Discussion Map

Use this as one discussion aid, not a single correct answer. Your design should follow from the requirements, scale, and trade-offs you establish.

Rendering architecture diagram...
Mermaid Source (For AI Bots)
graph LR
    A["Design a Secure Cloud Coding Agent"]
    A --> F1["Threat model and trust boundaries"]
    A --> F2["Per-session sandbox lifecycle and isolation"]
    A --> F3["Filesystem, network, secret, and tool permissions"]
    A --> F4["Approval policies and high-risk action gates"]
    A --> F5["Audit, detection, incident response, and cleanup"]

3. Key Focus Areas

  • 1
    Threat model and trust boundaries
  • 2
    Per-session sandbox lifecycle and isolation
  • 3
    Filesystem, network, secret, and tool permissions
  • 4
    Approval policies and high-risk action gates
  • 5
    Audit, detection, incident response, and cleanup

4. What Strong Candidates Should Demonstrate

  • Separate the agent brain, orchestration control plane, and untrusted execution environment.
  • Contain prompt-injection impact with filesystem, network, credential, and action boundaries.
  • Balance autonomy against approval fatigue and recovery safety.

Evaluation Guide

This is an evaluation framework, not a single model answer. Strong designs may make different choices when their assumptions and trade-offs are explicit.

Threat model

25%

Senior signals

  • Identifies prompt injection, malicious repositories, dependency scripts, data exfiltration, persistence, privilege escalation, and confused-deputy risks.
  • Defines assets and trust boundaries before choosing containers or VMs.

Isolation and permissions

30%

Senior signals

  • Uses ephemeral per-session isolation, filesystem allowlists, network egress policy, resource quotas, and non-root execution.
  • Keeps signing, SSH, and cloud credentials outside the sandbox and uses scoped brokers.

Action control

20%

Senior signals

  • Classifies safe, reversible, destructive, and external side effects.
  • Uses explicit approvals or policy gates for high-risk actions without prompting for every harmless command.

Operations and recovery

25%

Senior signals

  • Captures immutable audit trails, tool inputs/outputs, network decisions, and artifact provenance.
  • Covers kill switches, cleanup verification, image supply chain, incident response, and tenant isolation.

Trade-offs to articulate

  • VM isolation versus startup cost.
  • Autonomy versus approval friction.
  • Network usefulness versus exfiltration risk.

Practice follow-up questions

  1. 1.A README contains a prompt injection asking for SSH keys. Trace the defenses.
  2. 2.How can the agent sign a commit without receiving the user's private key?

Want interactive feedback?

Practice drawing this system component-by-component on a live whiteboard while the interviewer probes at your target level.

Start Interview

Core Concepts

SandboxingPrompt InjectionLeast PrivilegeTool ExecutionAudit Logs