All Questions
Agents And Tool Use medium

A data-analysis agent runs model-generated Python inside the same container as your API service. That container has database admin credentials in environment variables. A security review flags this as critical. What is the best mitigation?

  1. A Add a regex filter that blocks generated code containing os.environ, subprocess, or socket before it is executed in-process.
  2. B Execute generated code in an isolated sandbox with no production credentials, restricted network egress, and resource limits.
  3. C Ask the model to review its own generated code for dangerous operations before submitting it to the execution tool for real.
  4. D Run the code in-process but under a try/except wrapper with a timeout, so malicious or buggy code cannot crash the service.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions