Pattern · Safety
Least privilege and sandboxing
Give each tool the narrowest access, and run generated code in a locked-down sandbox.
Say it in the interview
I would give each tool its own narrow role, with read-only views and row filters for data, and run generated code in a container with no network, no secrets and hard CPU and time limits, so the worst case stays small.
When to use it
- Agents that query data or run code
- Tools that touch production systems
How it works
- Agent → Query tool (read-only role, row filters)
- Agent → Code runner (container, no network, no secrets, CPU and time caps)
- Agent → No delete tool, no shell on the host
- Code runner (container, no network, no secrets, CPU and time caps) → Only charts and CSVs come out
Trade-offs
- Limits the blast radius of any failure
- More setup per tool
Pitfalls interviewers probe
- One admin key shared by every tool
- A sandbox with network access