Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bug: Codex seats can write hive/bin (no way to make it read-only); suggest a named Codex permission profile

Aperta
#784 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend, security

Direzione di ricerca

Start at the Codex seat spawn options (autoModeFlag/autoFlag) and codexWritableRootsToml, then trace how per-seat .codex/config.toml is generated. Check both regular and temp/worker seats. Done means Codex seats can write to the configured hive paths while hive/bin stays read-only, with the named permission profile selected without -s.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: Munder Difflin 0.5.7 (macOS, Apple Silicon), Codex CLI 0.163.0

What happens

Codex agents (seats) can write to everything under <harnessHome>/hive/, including hive/bin/. Files in hive/bin/ (e.g. hive-node, the hook scripts) are executed by things that run outside the agent sandbox (hooks, background services). So any Codex seat can replace an executable that later runs unsandboxed.

Claude Code seats can be fenced off with sandbox.filesystem.denyWrite (plus an Edit(...) deny rule). There is no equivalent for Codex seats, because the generated config only uses the legacy sandbox.

Evidence
  • The generated per-seat <agent>/.codex/config.toml has [sandbox_workspace_write].writable_roots including the project, the agent folder, the entire hive, and the palace. No named permission profile.
  • Seats are spawned with -a never -s workspace-write (autoModeFlag/autoFlag), and codexWritableRootsToml only emits legacy writable_roots.
  • Retest from a Codex seat (2026-10-24): open(O_CREAT|O_EXCL) on hive/bin/.probe succeeded, then unlinked. Write allowed.
Expected

A way to keep hive/bin (and other app-owned executable paths) read-only for Codex seats while the rest of the hive stays writable.

Suggested fix (supported by Codex 0.163.0)

Emit a named permission profile instead of the legacy sandbox, and select it without -s:

approval_policy = "never"
default_permissions = "hive_guarded"

[permissions.hive_guarded]
extends = ":workspace"

[permissions.hive_guarded.filesystem]
"<project>" = "write"
"<harnessHome>/hive" = "write"
"<harnessHome>/hive/bin" = "read"
"<harnessHome>/palace" = "write"

Drop sandbox_mode / [sandbox_workspace_write] for that mode (they should not be mixed with a named profile), keep -a never, and omit -s workspace-write. References: Codex config schema and permissions compiler at rust-v0.163.0 (codex-rs/core/config.schema.json, codex-rs/core/src/config/permissions.rs), and https://developers.openai.com/codex/config-reference/.

Ideally the read-only list is configurable (some users protect more app-owned paths), and temp/worker Codex seats get the same profile.

Workaround we use for now

A file-hash watcher on hive/bin that alerts on any change. Detection only, not prevention.

Related: #687, #688 (other requests about the generated seat sandbox settings).

Lingua principale
TypeScript
Stelle
8.5k
Fork
1.2k
Merge medio
11h 56m
PR unite (30g)
69

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarnessMD/munder-difflin

Tutte le issue di HarnessMD/munder-difflin

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.