codexapi 0.12.10__tar.gz → 0.12.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {codexapi-0.12.10/src/codexapi.egg-info → codexapi-0.12.11}/PKG-INFO +16 -7
  2. {codexapi-0.12.10 → codexapi-0.12.11}/README.md +15 -6
  3. {codexapi-0.12.10 → codexapi-0.12.11}/pyproject.toml +1 -1
  4. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/__init__.py +1 -1
  5. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/agent.py +10 -8
  6. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/async_agent.py +2 -6
  7. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/cli.py +9 -8
  8. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/lead.py +1 -1
  9. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/task.py +1 -1
  10. {codexapi-0.12.10 → codexapi-0.12.11/src/codexapi.egg-info}/PKG-INFO +16 -7
  11. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_agent_backend.py +19 -0
  12. {codexapi-0.12.10 → codexapi-0.12.11}/LICENSE +0 -0
  13. {codexapi-0.12.10 → codexapi-0.12.11}/setup.cfg +0 -0
  14. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/__main__.py +0 -0
  15. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/agents.py +0 -0
  16. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/foreach.py +0 -0
  17. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/gh_integration.py +0 -0
  18. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/pushover.py +0 -0
  19. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/ralph.py +0 -0
  20. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/rate_limits.py +0 -0
  21. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/science.py +0 -0
  22. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/taskfile.py +0 -0
  23. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi/welfare.py +0 -0
  24. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi.egg-info/SOURCES.txt +0 -0
  25. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi.egg-info/dependency_links.txt +0 -0
  26. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi.egg-info/entry_points.txt +0 -0
  27. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi.egg-info/requires.txt +0 -0
  28. {codexapi-0.12.10 → codexapi-0.12.11}/src/codexapi.egg-info/top_level.txt +0 -0
  29. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_agents.py +0 -0
  30. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_async_agent.py +0 -0
  31. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_rate_limits.py +0 -0
  32. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_science.py +0 -0
  33. {codexapi-0.12.10 → codexapi-0.12.11}/tests/test_task_progress.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codexapi
3
- Version: 0.12.10
3
+ Version: 0.12.11
4
4
  Summary: Minimal Python API for running the Codex CLI.
5
5
  License: MIT
6
6
  Keywords: codex,agent,cli,openai
@@ -157,7 +157,8 @@ Resume a session and print the thread/session id to stderr:
157
157
  codexapi run --thread-id THREAD_ID --print-thread-id "Continue where we left off."
158
158
  ```
159
159
 
160
- Use `--no-yolo` to disable `--yolo` (Codex uses `--full-auto`).
160
+ Use `--no-yolo` to keep unattended operation with Codex auto approvals, without
161
+ forcing a sandbox policy.
161
162
  Use `--include-thinking` to return all agent messages joined together for `codexapi run` (Codex only).
162
163
 
163
164
  Lead mode periodically checks in on a long-running agent session with the
@@ -305,7 +306,8 @@ codexapi ralph --cancel --cwd /path/to/project
305
306
  ```
306
307
 
307
308
  Science mode wraps a short task in a science prompt and runs it through the
308
- Ralph loop. It defaults to `--yolo` and expects progress notes in `SCIENCE.md`.
309
+ Ralph loop. It defaults to dangerous no-sandbox automation and expects progress
310
+ notes in `SCIENCE.md`.
309
311
  Each iteration appends the agent output to `LOGBOOK.md` and the runner extracts
310
312
  any improved figures of merit for optional notifications. You can also set
311
313
  `--max-duration` to stop after the current iteration once a time limit is hit.
@@ -345,7 +347,9 @@ items are filtered out.
345
347
 
346
348
  - `prompt` (str): prompt to send to the agent backend.
347
349
  - `cwd` (str | PathLike | None): working directory for the agent session.
348
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
350
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
351
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
352
+ sandbox policy.
349
353
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
350
354
  - `include_thinking` (bool): when true, return all agent messages joined.
351
355
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
@@ -360,7 +364,9 @@ the same conversation and returns only the agent's message.
360
364
 
361
365
  - `__call__(prompt) -> str`: send a prompt to the agent backend and return the message.
362
366
  - `thread_id -> str | None`: expose the underlying session id once created.
363
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
367
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
368
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
369
+ sandbox policy.
364
370
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
365
371
  - `welfare` (bool): when true, append welfare stop instructions to each prompt
366
372
  and raise `WelfareStop` if the agent outputs `MAKE IT STOP`.
@@ -443,7 +449,9 @@ Runs a task file over a list of items, updating the list file in place.
443
449
  - `task_file` (str | PathLike): YAML task file (must include `prompt`).
444
450
  - `n` (int | None): limit parallelism to N (default: run all items in parallel).
445
451
  - `cwd` (str | PathLike | None): working directory for the agent session.
446
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
452
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
453
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
454
+ sandbox policy.
447
455
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
448
456
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
449
457
  - `fast` (bool): enable Codex fast mode (defaults to normal mode).
@@ -465,7 +473,8 @@ Simple result object returned by `foreach()`.
465
473
  `fast=True` / `--fast` also passes `service_tier=fast` and `features.fast_mode=true`.
466
474
  - Cursor backend uses `cursor agent --print --output-format json --trust` and parses the JSON result.
467
475
  - `include_thinking=True` only affects Codex; Cursor returns a single result string.
468
- - Passes `--yolo` by default (Codex uses `--full-auto` when disabled).
476
+ - Uses dangerous no-sandbox automation by default. For Codex, `yolo=False`
477
+ uses auto approvals without forcing a sandbox policy.
469
478
  - Raises `RuntimeError` if the backend exits non-zero or returns no agent message.
470
479
 
471
480
  ## Configuration
@@ -142,7 +142,8 @@ Resume a session and print the thread/session id to stderr:
142
142
  codexapi run --thread-id THREAD_ID --print-thread-id "Continue where we left off."
143
143
  ```
144
144
 
145
- Use `--no-yolo` to disable `--yolo` (Codex uses `--full-auto`).
145
+ Use `--no-yolo` to keep unattended operation with Codex auto approvals, without
146
+ forcing a sandbox policy.
146
147
  Use `--include-thinking` to return all agent messages joined together for `codexapi run` (Codex only).
147
148
 
148
149
  Lead mode periodically checks in on a long-running agent session with the
@@ -290,7 +291,8 @@ codexapi ralph --cancel --cwd /path/to/project
290
291
  ```
291
292
 
292
293
  Science mode wraps a short task in a science prompt and runs it through the
293
- Ralph loop. It defaults to `--yolo` and expects progress notes in `SCIENCE.md`.
294
+ Ralph loop. It defaults to dangerous no-sandbox automation and expects progress
295
+ notes in `SCIENCE.md`.
294
296
  Each iteration appends the agent output to `LOGBOOK.md` and the runner extracts
295
297
  any improved figures of merit for optional notifications. You can also set
296
298
  `--max-duration` to stop after the current iteration once a time limit is hit.
@@ -330,7 +332,9 @@ items are filtered out.
330
332
 
331
333
  - `prompt` (str): prompt to send to the agent backend.
332
334
  - `cwd` (str | PathLike | None): working directory for the agent session.
333
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
335
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
336
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
337
+ sandbox policy.
334
338
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
335
339
  - `include_thinking` (bool): when true, return all agent messages joined.
336
340
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
@@ -345,7 +349,9 @@ the same conversation and returns only the agent's message.
345
349
 
346
350
  - `__call__(prompt) -> str`: send a prompt to the agent backend and return the message.
347
351
  - `thread_id -> str | None`: expose the underlying session id once created.
348
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
352
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
353
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
354
+ sandbox policy.
349
355
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
350
356
  - `welfare` (bool): when true, append welfare stop instructions to each prompt
351
357
  and raise `WelfareStop` if the agent outputs `MAKE IT STOP`.
@@ -428,7 +434,9 @@ Runs a task file over a list of items, updating the list file in place.
428
434
  - `task_file` (str | PathLike): YAML task file (must include `prompt`).
429
435
  - `n` (int | None): limit parallelism to N (default: run all items in parallel).
430
436
  - `cwd` (str | PathLike | None): working directory for the agent session.
431
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
437
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
438
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
439
+ sandbox policy.
432
440
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
433
441
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
434
442
  - `fast` (bool): enable Codex fast mode (defaults to normal mode).
@@ -450,7 +458,8 @@ Simple result object returned by `foreach()`.
450
458
  `fast=True` / `--fast` also passes `service_tier=fast` and `features.fast_mode=true`.
451
459
  - Cursor backend uses `cursor agent --print --output-format json --trust` and parses the JSON result.
452
460
  - `include_thinking=True` only affects Codex; Cursor returns a single result string.
453
- - Passes `--yolo` by default (Codex uses `--full-auto` when disabled).
461
+ - Uses dangerous no-sandbox automation by default. For Codex, `yolo=False`
462
+ uses auto approvals without forcing a sandbox policy.
454
463
  - Raises `RuntimeError` if the backend exits non-zero or returns no agent message.
455
464
 
456
465
  ## Configuration
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codexapi"
7
- version = "0.12.10"
7
+ version = "0.12.11"
8
8
  description = "Minimal Python API for running the Codex CLI."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -30,4 +30,4 @@ __all__ = [
30
30
  "task_result",
31
31
  "lead",
32
32
  ]
33
- __version__ = "0.12.10"
33
+ __version__ = "0.12.11"
@@ -67,7 +67,7 @@ def agent(
67
67
  Args:
68
68
  prompt: The user prompt to send to the agent backend.
69
69
  cwd: Optional working directory for the agent session.
70
- yolo: Whether to pass --yolo to the agent backend.
70
+ yolo: Whether to use the backend's most permissive unattended mode.
71
71
  flags: Additional raw CLI flags to pass to the agent backend.
72
72
  include_thinking: When true, return all agent messages joined together.
73
73
  backend: Agent backend to use ("codex" or "cursor").
@@ -131,7 +131,7 @@ class Agent:
131
131
 
132
132
  Args:
133
133
  cwd: Optional working directory for the agent session.
134
- yolo: Whether to pass --yolo to the agent backend.
134
+ yolo: Whether to use the backend's most permissive unattended mode.
135
135
  thread_id: Optional thread/session id to resume from the first call.
136
136
  flags: Additional raw CLI flags to pass to the agent backend.
137
137
  welfare: When true, append welfare stop instructions to each prompt
@@ -235,18 +235,13 @@ def _run_codex(
235
235
  thinking=None,
236
236
  ):
237
237
  """Invoke the Codex CLI and return the message plus thread id (if any)."""
238
- command = [
239
- _CODEX_BIN,
238
+ command = [_CODEX_BIN] + _codex_automation_flags(yolo) + [
240
239
  "exec",
241
240
  "--json",
242
241
  "--color",
243
242
  "never",
244
243
  "--skip-git-repo-check",
245
244
  ]
246
- if yolo:
247
- command.append("--yolo")
248
- else:
249
- command.append("--full-auto")
250
245
  command.extend(_codex_fast_config(fast))
251
246
  command.extend(_agent_config_flag_parts("codex", model, thinking))
252
247
  if flags:
@@ -276,6 +271,13 @@ def _run_codex(
276
271
  return _parse_jsonl(result.stdout, include_thinking)
277
272
 
278
273
 
274
+ def _codex_automation_flags(yolo):
275
+ """Return current Codex CLI flags for unattended operation."""
276
+ if yolo:
277
+ return ["--dangerously-bypass-approvals-and-sandbox"]
278
+ return ["--ask-for-approval", "never"]
279
+
280
+
279
281
  def _codex_fast_config(fast):
280
282
  """Return Codex config flags for normal or fast mode."""
281
283
  if fast:
@@ -13,6 +13,7 @@ import uuid
13
13
  from .agent import (
14
14
  _CODEX_BIN,
15
15
  _agent_config_flag_parts,
16
+ _codex_automation_flags,
16
17
  _codex_fast_config,
17
18
  _cursor_command_prefix,
18
19
  _ensure_backend_available,
@@ -386,18 +387,13 @@ def _build_command(backend, cwd, yolo, flags, fast=False, model=None, thinking=N
386
387
 
387
388
 
388
389
  def _build_codex_command(cwd, yolo, flags, fast=False, model=None, thinking=None):
389
- command = [
390
- _CODEX_BIN,
390
+ command = [_CODEX_BIN] + _codex_automation_flags(yolo) + [
391
391
  "exec",
392
392
  "--json",
393
393
  "--color",
394
394
  "never",
395
395
  "--skip-git-repo-check",
396
396
  ]
397
- if yolo:
398
- command.append("--yolo")
399
- else:
400
- command.append("--full-auto")
401
397
  command.extend(_codex_fast_config(fast))
402
398
  command.extend(_agent_config_flag_parts("codex", model, thinking))
403
399
  if flags:
@@ -1439,7 +1439,8 @@ def main(argv=None):
1439
1439
  science_help = (
1440
1440
  "Science mode (science command):\n"
1441
1441
  " Wraps your short task in a science prompt and runs it via the Ralph loop.\n"
1442
- " Default uses --yolo. Use --no-yolo to disable it.\n"
1442
+ " Default uses dangerous no-sandbox automation. "
1443
+ "Use --no-yolo for auto approvals without forcing sandbox policy.\n"
1443
1444
  " Optional --max-duration stops before starting the next iteration once\n"
1444
1445
  " the duration limit is reached (e.g. 90m, 2h, 45s; default unit is minutes).\n"
1445
1446
  )
@@ -1479,7 +1480,7 @@ def main(argv=None):
1479
1480
  "--no-yolo",
1480
1481
  action="store_false",
1481
1482
  dest="yolo",
1482
- help="Disable --yolo (Codex uses --full-auto).",
1483
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1483
1484
  )
1484
1485
  run_parser.add_argument(
1485
1486
  "--flags",
@@ -1535,7 +1536,7 @@ def main(argv=None):
1535
1536
  "--no-yolo",
1536
1537
  action="store_false",
1537
1538
  dest="yolo",
1538
- help="Disable --yolo (Codex uses --full-auto).",
1539
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1539
1540
  )
1540
1541
  lead_parser.add_argument(
1541
1542
  "--flags",
@@ -1604,7 +1605,7 @@ def main(argv=None):
1604
1605
  "--no-yolo",
1605
1606
  action="store_false",
1606
1607
  dest="yolo",
1607
- help="Disable --yolo (Codex uses --full-auto).",
1608
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1608
1609
  )
1609
1610
  agent_start.add_argument(
1610
1611
  "--flags",
@@ -1837,7 +1838,7 @@ def main(argv=None):
1837
1838
  "--no-yolo",
1838
1839
  action="store_false",
1839
1840
  dest="yolo",
1840
- help="Disable --yolo (Codex uses --full-auto).",
1841
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1841
1842
  )
1842
1843
  task_parser.add_argument(
1843
1844
  "--flags",
@@ -1911,7 +1912,7 @@ def main(argv=None):
1911
1912
  "--no-yolo",
1912
1913
  action="store_false",
1913
1914
  dest="yolo",
1914
- help="Disable --yolo (Codex uses --full-auto).",
1915
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1915
1916
  )
1916
1917
  ralph_parser.add_argument(
1917
1918
  "--flags",
@@ -1982,7 +1983,7 @@ def main(argv=None):
1982
1983
  "--no-yolo",
1983
1984
  action="store_false",
1984
1985
  dest="yolo",
1985
- help="Disable --yolo (Codex uses --full-auto).",
1986
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
1986
1987
  )
1987
1988
  science_parser.add_argument(
1988
1989
  "--flags",
@@ -2033,7 +2034,7 @@ def main(argv=None):
2033
2034
  "--no-yolo",
2034
2035
  action="store_false",
2035
2036
  dest="yolo",
2036
- help="Disable --yolo (Codex uses --full-auto).",
2037
+ help="Use auto approvals instead of dangerous no-sandbox automation.",
2037
2038
  )
2038
2039
  foreach_parser.add_argument(
2039
2040
  "--flags",
@@ -91,7 +91,7 @@ def lead(
91
91
  minutes: Check-in interval in whole minutes (>= 0).
92
92
  prompt: The original instruction prompt.
93
93
  cwd: Optional working directory for the agent session.
94
- yolo: Whether to pass --yolo to the agent backend.
94
+ yolo: Whether to use the backend's most permissive unattended mode.
95
95
  flags: Additional raw CLI flags to pass to the agent backend.
96
96
  leadbook: Optional path to the leadbook file. Set to False to disable.
97
97
  backend: Agent backend to use ("codex" or "cursor").
@@ -275,7 +275,7 @@ def task(
275
275
  a string check prompt. The string "None" skips verification.
276
276
  max_iterations: Maximum number of task iterations (0 means unlimited).
277
277
  cwd: Optional working directory for the agent session.
278
- yolo: Whether to pass --yolo to the agent backend.
278
+ yolo: Whether to use the backend's most permissive unattended mode.
279
279
  flags: Additional raw CLI flags to pass to the agent backend.
280
280
  progress: Whether to show a tqdm progress bar with status updates.
281
281
  set_up: Optional setup prompt to run before the task.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codexapi
3
- Version: 0.12.10
3
+ Version: 0.12.11
4
4
  Summary: Minimal Python API for running the Codex CLI.
5
5
  License: MIT
6
6
  Keywords: codex,agent,cli,openai
@@ -157,7 +157,8 @@ Resume a session and print the thread/session id to stderr:
157
157
  codexapi run --thread-id THREAD_ID --print-thread-id "Continue where we left off."
158
158
  ```
159
159
 
160
- Use `--no-yolo` to disable `--yolo` (Codex uses `--full-auto`).
160
+ Use `--no-yolo` to keep unattended operation with Codex auto approvals, without
161
+ forcing a sandbox policy.
161
162
  Use `--include-thinking` to return all agent messages joined together for `codexapi run` (Codex only).
162
163
 
163
164
  Lead mode periodically checks in on a long-running agent session with the
@@ -305,7 +306,8 @@ codexapi ralph --cancel --cwd /path/to/project
305
306
  ```
306
307
 
307
308
  Science mode wraps a short task in a science prompt and runs it through the
308
- Ralph loop. It defaults to `--yolo` and expects progress notes in `SCIENCE.md`.
309
+ Ralph loop. It defaults to dangerous no-sandbox automation and expects progress
310
+ notes in `SCIENCE.md`.
309
311
  Each iteration appends the agent output to `LOGBOOK.md` and the runner extracts
310
312
  any improved figures of merit for optional notifications. You can also set
311
313
  `--max-duration` to stop after the current iteration once a time limit is hit.
@@ -345,7 +347,9 @@ items are filtered out.
345
347
 
346
348
  - `prompt` (str): prompt to send to the agent backend.
347
349
  - `cwd` (str | PathLike | None): working directory for the agent session.
348
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
350
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
351
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
352
+ sandbox policy.
349
353
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
350
354
  - `include_thinking` (bool): when true, return all agent messages joined.
351
355
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
@@ -360,7 +364,9 @@ the same conversation and returns only the agent's message.
360
364
 
361
365
  - `__call__(prompt) -> str`: send a prompt to the agent backend and return the message.
362
366
  - `thread_id -> str | None`: expose the underlying session id once created.
363
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
367
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
368
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
369
+ sandbox policy.
364
370
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
365
371
  - `welfare` (bool): when true, append welfare stop instructions to each prompt
366
372
  and raise `WelfareStop` if the agent outputs `MAKE IT STOP`.
@@ -443,7 +449,9 @@ Runs a task file over a list of items, updating the list file in place.
443
449
  - `task_file` (str | PathLike): YAML task file (must include `prompt`).
444
450
  - `n` (int | None): limit parallelism to N (default: run all items in parallel).
445
451
  - `cwd` (str | PathLike | None): working directory for the agent session.
446
- - `yolo` (bool): pass `--yolo` when true (defaults to true).
452
+ - `yolo` (bool): use the backend's most permissive unattended mode when true
453
+ (defaults to true). For Codex, `False` uses auto approvals without forcing a
454
+ sandbox policy.
447
455
  - `flags` (str | None): extra CLI flags to pass to the agent backend.
448
456
  - `backend` (str | None): `codex` or `cursor` (defaults to `CODEXAPI_BACKEND` or `codex`).
449
457
  - `fast` (bool): enable Codex fast mode (defaults to normal mode).
@@ -465,7 +473,8 @@ Simple result object returned by `foreach()`.
465
473
  `fast=True` / `--fast` also passes `service_tier=fast` and `features.fast_mode=true`.
466
474
  - Cursor backend uses `cursor agent --print --output-format json --trust` and parses the JSON result.
467
475
  - `include_thinking=True` only affects Codex; Cursor returns a single result string.
468
- - Passes `--yolo` by default (Codex uses `--full-auto` when disabled).
476
+ - Uses dangerous no-sandbox automation by default. For Codex, `yolo=False`
477
+ uses auto approvals without forcing a sandbox policy.
469
478
  - Raises `RuntimeError` if the backend exits non-zero or returns no agent message.
470
479
 
471
480
  ## Configuration
@@ -30,6 +30,25 @@ class AgentBackendTests(unittest.TestCase):
30
30
  self.assertIn("features.fast_mode=false", command)
31
31
  self.assertNotIn("service_tier=fast", command)
32
32
 
33
+ def test_async_codex_command_uses_documented_yolo_flags(self):
34
+ command = _build_codex_command(None, True, None)
35
+ exec_index = command.index("exec")
36
+ self.assertIn("--dangerously-bypass-approvals-and-sandbox", command)
37
+ self.assertLess(
38
+ command.index("--dangerously-bypass-approvals-and-sandbox"),
39
+ exec_index,
40
+ )
41
+ self.assertGreater(command.index("--json"), exec_index)
42
+ self.assertNotIn("--yolo", command)
43
+
44
+ def test_async_codex_command_no_yolo_uses_auto_approval_mode(self):
45
+ command = _build_codex_command(None, False, None)
46
+ exec_index = command.index("exec")
47
+ self.assertLess(command.index("--ask-for-approval"), exec_index)
48
+ self.assertIn("never", command)
49
+ self.assertNotIn("--sandbox", command)
50
+ self.assertNotIn("--full-auto", command)
51
+
33
52
  def test_async_codex_command_can_enable_fast_mode(self):
34
53
  command = _build_codex_command(None, True, None, fast=True)
35
54
  self.assertIn("service_tier=fast", command)
File without changes
File without changes