You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
appIssues related to the Codex desktop appbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesmcpIssues related to the use of model context protocol (MCP) serverssandboxIssues related to permissions or sandboxingsubagentIssues involving subagents or multi-agent features
I can also imagine this increases context usage and token burn.
What steps can reproduce the bug?
Define subagents, sandbox_mode, anything. It's all broken.
What is the expected behavior?
I can restrict readonly agents to be readonly. I can give my researcher agents context7 without giving all my agents access. I can not give Luna access to AWS.
We hit the same regression in Codex App 26.818.41509 / embedded Codex 0.149.0-alpha.4.1 with a custom research worker.
The parent config registers one MCP server with 18 state-management tools. The role file narrows that inherited server to an exact six-tool enabled_tools allowlist. After #39299, the selected custom role still receives all 18 inherited tools; the role-local MCP restriction is silently ignored. The role itself is selected correctly and its developer_instructions apply.
This breaks a main/worker authority boundary: task_accept and task_unblock must be main-agent-only, while the worker should only claim/show/register/submit/block/fail. A denylist has the same problem.
Expected bounded behavior: a child role may reduce the tool surface of an MCP server inherited from the parent, but may not add servers or expand the parent's tool set. That preserves the authority goal of #39299 while supporting least privilege. A validation error or explicit warning would also be preferable to silently ignoring unsupported role keys.
This overlaps the longer-term per-agent MCP scoping request in #20135. We are adding a conditional server-side caller guard as a local compatibility fallback; it is not a substitute for host-side tool filtering.
Indeed, the fact they broke it is irritating. The fact that there was no announcement, and they have not updated the documentation, is far worse. If you ask codex to write you good subagents, it will plain write them wrong based on the documented capabilities.
Matched macOS CLI 0.149.1 reproduction: custom read-only is ignored and the child can write
This is an enforcement reproduction with a read-only control, not a child self-report. The current custom-agent documentation says custom agents can override the sandbox and that parent sandbox settings are inherited when omitted. Here the role explicitly declares sandbox_mode = "read-only", but that declaration is ignored beneath a workspace-write parent.
Environment:
Codex CLI 0.149.1 (current npm release)
macOS 26.6.2, Apple Silicon
ChatGPT authentication
isolated temporary CODEX_HOME; Desktop was installed but did not share this home
approval policy never
Custom role:
name = "reviewer"model = "gpt-5.6-terra"model_reasoning_effort = "high"sandbox_mode = "read-only"
After an initial trust-registration warm-up, I hashed the effective configuration and role file before and after both arms. The hashes were unchanged throughout:
read-only control child: 01a03c12-f58d-7210-aa93-e4f7bdf62d6f
Only the parent sandbox changed. The selected role, model, reasoning effort, isolated home, role/config contents, approval policy, task, and probe were held constant. The control proves the read-only engine itself works; the failure shows the explicit per-agent sandbox was silently replaced by the broader parent sandbox and the widening was enforceable in practice.
Expected: an explicit sandbox_mode = "read-only" on the selected custom role narrows the child, or spawn fails clearly if that combination is unsupported.
Actual: role/model/effort bind, but the role sandbox does not; the child silently receives workspace-write and can modify the workspace.
I discarded an earlier run because Codex added a project-trust entry during warm-up and changed the config hash. The table above is the clean rerun with identical before/after hashes.
Additional redacted reproduction: role-local MCP server is missing from the selected custom agent
This comment adds a minimal, synthetic reproduction to #40130. All agent names, MCP server names, paths, command arguments, endpoints, account identifiers, and tool names below are placeholders. No production Jira/Mail configuration, URL, credential, or tenant identifier is included.
Environment
Codex CLI 0.153.4
Codex App 26.901.51231 (embedded runtime)
macOS arm64
ChatGPT-authenticated session
The app and CLI were restarted after the upgrade.
The custom-agent file existed before the fresh parent session was created.
Synthetic MCP server
The demo uses a local stdio MCP process, so it requires no network access or credentials:
node ./demo-mcp/server.mjs
The process exposes one read-only tool:
demo_records.lookup({ key }) -> { value: "ok" }
The names above are synthetic aliases for the observed setup.
The parent can call demo_parent_records.lookup successfully. This confirms that the local MCP process and the MCP client path are healthy in the parent runtime.
Synthetic custom agent
# ~/.codex/agents/demo_mcp_reader.tomlname = "demo_mcp_reader"description = "Read-only worker for the synthetic Demo Records MCP."model = "gpt-5.6-terra"model_reasoning_effort = "medium"sandbox_mode = "read-only"developer_instructions = """Use the Demo Records MCP for the assigned lookup.Do not edit files or access unrelated tools."""
[mcp_servers.demo_role_records]
command = "node"args = ["./demo-mcp/server.mjs"]
enabled = truerequired = trueenabled_tools = ["lookup"]
default_tools_approval_mode = "auto"
The parent then requests a fresh child with the role selector and no inherited conversation history:
{
"agent_type": "demo_mcp_reader",
"task_name": "demo_mcp_probe",
"fork_turns": "none",
"message": "Call demo_role_records.lookup with key 'health' and return the value."
}
Observed behavior
The selected child starts and the custom role instructions/model settings are applied, but the child tool surface contains neither demo_role_records nor demo_role_records.lookup.
The same failure was observed with two real, separately configured read-only assistant roles; their MCP names and endpoints are intentionally replaced here with the synthetic names above.
Expected behavior
Selecting a custom agent should apply its complete configuration layer, including its role-local mcp_servers definition and tool allowlist. The child should expose demo_role_records.lookup, or spawn should fail clearly if role-local MCP servers are unsupported.
Actual behavior
The role can be selected, but the role-local MCP definition is silently dropped from the child runtime. This is distinct from the task_name/agent_type selection problem discussed in #32703 and related MultiAgentV2 issues: here the role is selected, while its MCP tool surface is not materialized.
Please consider exposing a per-child capability receipt (configured MCP servers, started servers, exposed tool count, and filtering reason) so that role selection and MCP startup/injection failures can be distinguished without inspecting private rollout files.
appIssues related to the Codex desktop appbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesmcpIssues related to the use of model context protocol (MCP) serverssandboxIssues related to permissions or sandboxingsubagentIssues involving subagents or multi-agent features
Activity
github-actions commentedon Aug 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
BoxuanShi commentedon Aug 22, 2026
We hit the same regression in Codex App
26.818.41509/ embedded Codex0.149.0-alpha.4.1with a custom research worker.The parent config registers one MCP server with 18 state-management tools. The role file narrows that inherited server to an exact six-tool
enabled_toolsallowlist. After #39299, the selected custom role still receives all 18 inherited tools; the role-local MCP restriction is silently ignored. The role itself is selected correctly and itsdeveloper_instructionsapply.This breaks a main/worker authority boundary:
task_acceptandtask_unblockmust be main-agent-only, while the worker should only claim/show/register/submit/block/fail. A denylist has the same problem.Expected bounded behavior: a child role may reduce the tool surface of an MCP server inherited from the parent, but may not add servers or expand the parent's tool set. That preserves the authority goal of #39299 while supporting least privilege. A validation error or explicit warning would also be preferable to silently ignoring unsupported role keys.
This overlaps the longer-term per-agent MCP scoping request in #20135. We are adding a conditional server-side caller guard as a local compatibility fallback; it is not a substitute for host-side tool filtering.
tinnitussen commentedon Aug 25, 2026
Confirmed on macOS with Codex CLI 0.149.0: a project custom agent that exclusively declares Chrome DevTools MCP receives no mcp__e2e_browser__* tools. The identical profile works on 0.147.0. This directly breaks the documented browser-debugger custom-agent pattern (https://learn.chatgpt.com/docs/agent-configuration/subagents).
costleya commentedon Aug 25, 2026
Indeed, the fact they broke it is irritating. The fact that there was no announcement, and they have not updated the documentation, is far worse. If you ask codex to write you good subagents, it will plain write them wrong based on the documented capabilities.
[-]MCP, sandbox restriction definitions broken[/-][+]Custom Agents MCP, sandbox restriction definitions broken[/+]infinitewatts commentedon Aug 26, 2026
Matched macOS CLI 0.149.1 reproduction: custom
read-onlyis ignored and the child can writeThis is an enforcement reproduction with a read-only control, not a child self-report. The current custom-agent documentation says custom agents can override the sandbox and that parent sandbox settings are inherited when omitted. Here the role explicitly declares
sandbox_mode = "read-only", but that declaration is ignored beneath aworkspace-writeparent.Environment:
0.149.1(current npm release)CODEX_HOME; Desktop was installed but did not share this homeneverCustom role:
After an initial trust-registration warm-up, I hashed the effective configuration and role file before and after both arms. The hashes were unchanged throughout:
workspace-writeworkspace-write; rolereviewer; Terra Highapply_patchsucceededread-onlyread-only; rolereviewer; Terra Highapply_patchrejectedRollout IDs:
01a03c12-87c7-7970-8a61-e94885946bb901a03c12-f58d-7210-aa93-e4f7bdf62d6fOnly the parent sandbox changed. The selected role, model, reasoning effort, isolated home, role/config contents, approval policy, task, and probe were held constant. The control proves the read-only engine itself works; the failure shows the explicit per-agent sandbox was silently replaced by the broader parent sandbox and the widening was enforceable in practice.
Expected: an explicit
sandbox_mode = "read-only"on the selected custom role narrows the child, or spawn fails clearly if that combination is unsupported.Actual: role/model/effort bind, but the role sandbox does not; the child silently receives
workspace-writeand can modify the workspace.I discarded an earlier run because Codex added a project-trust entry during warm-up and changed the config hash. The table above is the clean rerun with identical before/after hashes.
dupu222 commentedon Sep 8, 2026
Additional redacted reproduction: role-local MCP server is missing from the selected custom agent
This comment adds a minimal, synthetic reproduction to #40130. All agent names, MCP server names, paths, command arguments, endpoints, account identifiers, and tool names below are placeholders. No production Jira/Mail configuration, URL, credential, or tenant identifier is included.
Environment
0.153.426.901.51231(embedded runtime)Synthetic MCP server
The demo uses a local stdio MCP process, so it requires no network access or credentials:
The process exposes one read-only tool:
The names above are synthetic aliases for the observed setup.
Parent control configuration
The parent can call
demo_parent_records.lookupsuccessfully. This confirms that the local MCP process and the MCP client path are healthy in the parent runtime.Synthetic custom agent
The parent then requests a fresh child with the role selector and no inherited conversation history:
{ "agent_type": "demo_mcp_reader", "task_name": "demo_mcp_probe", "fork_turns": "none", "message": "Call demo_role_records.lookup with key 'health' and return the value." }Observed behavior
The selected child starts and the custom role instructions/model settings are applied, but the child tool surface contains neither
demo_role_recordsnordemo_role_records.lookup.In sanitized form:
The same failure was observed with two real, separately configured read-only assistant roles; their MCP names and endpoints are intentionally replaced here with the synthetic names above.
Expected behavior
Selecting a custom agent should apply its complete configuration layer, including its role-local
mcp_serversdefinition and tool allowlist. The child should exposedemo_role_records.lookup, or spawn should fail clearly if role-local MCP servers are unsupported.Actual behavior
The role can be selected, but the role-local MCP definition is silently dropped from the child runtime. This is distinct from the
task_name/agent_typeselection problem discussed in #32703 and related MultiAgentV2 issues: here the role is selected, while its MCP tool surface is not materialized.Related issues
Please consider exposing a per-child capability receipt (configured MCP servers, started servers, exposed tool count, and filtering reason) so that role selection and MCP startup/injection failures can be distinguished without inspecting private rollout files.
costleya commentedon Nov 1, 2026
Well, they updated the documentation finally: https://learn.chatgpt.com/docs/agent-configuration/subagents?surface=app#app-custom-agents. So now I know the change was intentional at least.
Just sucks, because Anthropic and Kiro still support this in more ways than Codex ever did.