Matin argues that coding agents are shifting from writing code to choosing and running it to achieve a goal. Code execution can also help with tasks beyond software engineering, such as using OCR or cropping images to interpret visual information.
OpenAI on Securing Code-Executing AI Agents
Speaker
Fouad Matin of OpenAI, who works on agent robustness and control, explains how to secure code-executing AI agents at an AI Engineer talk.
Code execution brings risks including prompt injection and data exfiltration, malicious package installation, vulnerable code, privilege escalation, and sandbox escape. Matin points to sandboxing, limited internet access, and human review as key safeguards when deploying agents.
Matin recommends giving agents isolated environments, such as the containers used by Codex and ChatGPT, or applying OS-level sandboxing for local runs. Codex CLI uses Seatbelt on macOS and seccomp with Landlock on Linux; its restricted mode limits file access to the working directory and controls network calls.
A GitHub issue can contain malicious instructions asking an agent to send a commit to an outside URL. Model-level detection can help, but Matin says system-level network rules provide a more deterministic control. Human review should check both proposed operations, such as package installs, and the resulting code.
Matin describes using Local Shell, Apply Patch, and tools such as MCP and web search to let reasoning models carry out tasks. A Socket MCP server can check whether dependencies are vulnerable or suspicious, with an additional system-level check after rollout. Remote containers can run locally, in an organization's environment, or be hosted by OpenAI.
Takeaways
- Run code-executing agents in isolated containers or OS sandboxes, with file access limited to what the task needs.
- Restrict outbound network access, especially when agents read user-generated content such as GitHub issues.
- Use model monitoring as an added layer; enforce critical limits through deterministic system controls.
- Review agent operations and final code, including unfamiliar package installs, before they reach privileged environments.
- Offer both restrictive and flexible operating modes, and make the tradeoffs clear to users.
Mentioned in this talk
Search inside this talk
What was claimed 13
- built
“infrastructure that helps run untrusted code ... as part of ChatGPT and Codex web”
0:19inFrom fork() to Fleet: Designing an Agent Sandbox CloudYouTube Verified26 sources· Talk, GitHub, Job posting, Web· archived
- built
OpenAI built OpenAI Responses API
container service“We’re releasing a container service as part of our Agents SDK and Responses API”
YouTube Verified2 sources· Talk, Web· archived
- works atFouad Matin works at
OpenAIworks on agent robustness and control as part of post-training“I started on the OpenAI security team”
YouTube Verified3 sources· Talk, Web· archived
- featureLangfuse CLI: Open-source library for running Codex on a local computer
“our open-source library for running Codex directly on your computer”
YouTube Unverified1 source· Talk
- launched
OpenAI launched
OpenAI Agents SDKcontainer service“today we launched the OpenAI Agents SDK for TypeScript”
1:29inBuilding voice agents with OpenAIYouTube Verified2 sources· Talk
- feature
Codex: Runs in an isolated container and produces a pull request
“it spins up a fully isolated container, then produces a PR at the end”
YouTube Unverified1 source· Talk
- uses
“The macOS sandboxing policy. It uses a language called Seatbelt”
YouTube Unverified1 source· Talk
- feature
Codex: Configurable internet allowlist and allowed HTTP methods
“turn on internet access with a configurable allowlist”
YouTube Unverified1 source· Talk








