Skip to content
Changelog

CodexAgent takes its permission policy as sandbox_mode

October 16, 20261 min read

Agno's CodexAgent hands sandbox_mode to Codex as its sandbox thread setting, which frees sandbox= for a provider such as DockerSandbox. Both can sit on one agent, a permission policy for Codex and a computer to run it in.

from agno.agents.codex import CodexAgent
 
agent = CodexAgent(name="Codex", sandbox_mode="read-only")

Code that still passes the string keeps working. We built the agent both ways on both releases.

# real output
Before:  CodexAgent(name="Codex", sandbox_mode="read-only")
         TypeError: CodexAgent.__init__() got an unexpected keyword argument 'sandbox_mode'
Now:     CodexAgent(name="Codex", sandbox="read-only")
         DeprecationWarning: CodexAgent(sandbox=<str>) is deprecated; use sandbox_mode. sandbox= now takes a Sandbox.
         sandbox_mode = 'read-only' | sandbox = None

See the cookbook, and learn more about running Codex in the documentation.

Frequently asked questions

Pass sandbox_mode="read-only", "workspace-write" or "full-access". Leave it unset and the thread uses the Codex default.

Yes. Agno moves the string into sandbox_mode, leaves sandbox empty and raises a DeprecationWarning when the agent is built.

A sandbox provider such as DockerSandbox, which runs the whole Codex process in an isolated computer per session.

Shipped around the same time