38:26Harshil Agrawal explains why AI-generated code should be treated as untrusted code: it can be wrong, expose secrets, or follow malicious instructions, and it often runs with the application's privileges. He recommends capability-based security: deny access by default and grant only the specific capabilities the code needs. Use V8 isolates for fast, constrained tasks such as tool calls and data transformations; use containers when code needs files, processes, package installation, or a development server. He closes with safeguards including per-user isolation, restricted networking, resource limits, keeping secrets outside sandboxes, cleanup, logging, and input validation.
