What happened
sandbox.ExecContext / ExecStreamReader run openshell sandbox exec … -- sh -c <command> and wire no stdin at all, so every caller that needs to hand text to a process in the sandbox builds it into the command string:
The text never reaches the agent CLI's own argv, which is what those comments were guarding against, but it is in the intermediate sh -c argv: readable in /proc inside the sandbox by the sandbox user, and included in OpenShell's host-side command preview (first ~120 chars). The text is attacker-influenced (PR bodies, comments, commit messages, validation failures), so it is worth keeping out of both.
Inside the sandbox the reader is the agent itself, which is the intended recipient, so this is not a privilege boundary today. It becomes one as soon as a second, less-trusted process shares a sandbox, and the log preview is a disclosure regardless.
Proposed change
Add an optional stdin payload to the sandbox exec helpers (the OpenShell exec request already carries a stdin field) and use it for:
- the codex prompt (
- sentinel already reads stdin)
- the steer mailbox write, which becomes
cat >> <mailbox> with the line on stdin
Then the "never argv" claim in ADR 0101 and in the codex runtime comments is true as written.
Validation criteria
ps//proc inside the sandbox during a run shows no prompt or steer text in any command line, and an OpenShell command preview for those execs contains none either.
Refs #6959, ADR 0101.
What happened
sandbox.ExecContext/ExecStreamReaderrunopenshell sandbox exec … -- sh -c <command>and wire no stdin at all, so every caller that needs to hand text to a process in the sandbox builds it into the command string:internal/runtime/codex_run.go—printf '%s' <quoted prompt> | codex exec … -internal/runtime/steer_session.go—printf '%s\n' <quoted line> >> <mailbox>for the steer mailbox (feat(dispatch)!: steer the agent run already in flight on work-item updates #6959)The text never reaches the agent CLI's own argv, which is what those comments were guarding against, but it is in the intermediate
sh -cargv: readable in/procinside the sandbox by the sandbox user, and included in OpenShell's host-side command preview (first ~120 chars). The text is attacker-influenced (PR bodies, comments, commit messages, validation failures), so it is worth keeping out of both.Inside the sandbox the reader is the agent itself, which is the intended recipient, so this is not a privilege boundary today. It becomes one as soon as a second, less-trusted process shares a sandbox, and the log preview is a disclosure regardless.
Proposed change
Add an optional stdin payload to the sandbox exec helpers (the OpenShell exec request already carries a stdin field) and use it for:
-sentinel already reads stdin)cat >> <mailbox>with the line on stdinThen the "never argv" claim in ADR 0101 and in the codex runtime comments is true as written.
Validation criteria
ps//procinside the sandbox during a run shows no prompt or steer text in any command line, and an OpenShell command preview for those execs contains none either.Refs #6959, ADR 0101.