{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiaqctfnh6zb2ihgsalcqocnwgxbqsch4fcclz7edflze67yqa63wm",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mptjrkbpyzr2"
},
"path": "/t/how-to-curb-gpts-ambition-to-become-a-leader/1385720#post_6",
"publishedAt": "2026-07-04T16:15:15.000Z",
"site": "https://community.openai.com",
"tags": [
"developers.openai.com",
"When to use codex exec - Non-interactive mode – Codex | OpenAI Developers"
],
"textContent": "Hi!\n\nMy suggestion would be to look into `codex exec`.\n\nI have not encountered this specific issue yet because my setup works the other way around. I always assumed that the main agent passes in the instructions.\n\nOff the top of my head: if I did not want that behavior, I would create a tool that calls `codex exec` in the CLI without giving the spawning agent the option to pass instructions to the new agent.\n\nWe always have to pass an initial message to get the agent started, but that prompt could come from the tool rather than from the agent that spawns the other one.\n\nThe main agent would then be instructed to use the tool instead of spawning another agent directly, which should circumvent the issue you are running into.\n\ndevelopers.openai.com\n\n### When to use codex exec - Non-interactive mode – Codex | OpenAI Developers\n\nNon-interactive mode lets you run Codex from scripts (for example, continuous integration (CI) jobs) without opening the interactive TUI. You invoke it with codex exec. | Use `codex exec` to run Codex in scripts and CI",
"title": "How to Curb GPT's Ambition to Become a Leader"
}