Skip to content

117. Steer runtime interface and in-sandbox delivery ​

Date: 2026-11-02

Status ​

Accepted

Companion decisions:

  • ADR 0119 (proposed): when a steer happens and which records it carries.
  • Steer envelope v1 (proposed with ADR 0119): the steer files and the message format.

Context ​

ADR 0119 (proposed) decides that a running sandbox cycle takes in admitted entity updates. This ADR decides how the message reaches the agent and what a runtime implements to be steerable.

Two constraints shape it:

  • The sandbox. The runner reaches a running sandbox only through exec and upload. An exec gets its own stdin, not the stdin of the agent process already running.
  • The runtimes differ. Claude Code and pi can take a message into a live session. Codex exec cannot.

This ADR aims to give every runtime one interface for steering, with a transport that needs no new sandbox operation for live runtimes.

Options ​

OptionWhy not chosen
Restart the agent with the update added to its promptThrows away the turn in progress and the session history; Codex resume also drops the turn but keeps the history
upload a file and hope the agent noticesNothing tells a live session that a file arrived
Write to the agent's stdin through execAn exec has no handle on the running process's stdin
A mailbox the agent's stdin already tails (chosen)—

Decision ​

We adopt an optional runtime.Steerer capability, fed through an in-sandbox mailbox, to let any runtime become steerable by implementing two methods.

Interface ​

Method or fieldContract
RunParams.SteerableAsks a Steerer runtime to keep its session open. A runtime that is not a Steerer ignores it, and its command line is unchanged
Steer(ctx, msg)Delivers one envelope (steer envelope v1, proposed with ADR 0119) and returns once the runtime has observed its acknowledgement, or an error
Settle(ctx)Closes the session to further steers; Run returns after Settle and the agent's current turn

The message carries the envelope bytes, the steer sequence number, and the admitted record keys. The runtime does not build or change the envelope.

Runtimes ​

RuntimeSteerableDelivery
Claude CodeYesStream-JSON input on stdin, fed by the mailbox
piYesRPC mode on stdin, fed by the mailbox
CodexYesInterrupt and resume (below)
OpenCodeNoDeclares itself not steerable
dummy, dummy-playbackNoDeclare themselves not steerable

Mailbox ​

  • A live runtime starts the agent with stdin connected to an in-sandbox feeder that tails a mailbox file from its first line. The opening prompt and every later steer use the same channel.
  • Steer appends one envelope to the mailbox through exec.
  • The mailbox sits in a runner-owned directory that the agent cannot write, under the same immutability rule as the steer directory. If that cannot be enforced, the runtime reports itself not steerable for the cycle.
  • The mailbox is a transport, not the security boundary. Admission and filtering happen on the host before anything is written, and the envelope holds no record text. A process running as the agent's user that reaches the agent's input some other way, such as its stdin, can inject only what the agent could already say to itself.

Codex interrupt and resume ​

Codex exec has no live channel, so the runner stops and starts the sandbox and resumes the same session with the envelope as the next prompt. If the restarted sandbox reaches an Error phase (NVIDIA/OpenShell#3776, #3308), the steer is lost and the cycle fails closed.

Caller obligations ​

The runner, not the runtime, owns these rules:

  • Write lock. Steer and Settle are called with the runner's sandbox write lock held, so they cannot race the credential refreshers. The release check runs under the same hold (ADR 0119, proposed).
  • Acknowledgement. A steer counts as delivered only when the runtime sees the agent take in that specific message, matched by its identity rather than by counting. Claude Code replays user messages and echoes the text; pi acknowledges the RPC id; Codex acknowledges by resuming the session with it.
  • Budget. A steer starts only when the remaining time, bounded by the forge token's life, covers a full turn and the ADR 0144 reserve for publication and cleanup.
  • Cap. steer.max_steers bounds steers per cycle.

Forge scope ​

Forge-neutral. The interface is runtime-level and does not call a forge. Steering is reached only where ADR 0119 supports it, which is GitHub on GitHub Actions. GitLab and Forgejo runs never call Steer, because ADR 0119 wires no running-cycle signal source there.

Consequences ​

  • A runtime becomes steerable by implementing two methods, with no per-runtime branching in the runner beyond the capability check.
  • Live runtimes need no new sandbox operation. The Codex path costs a sandbox stop, start, and session resume per steer, and re-runs per-process guards on each resume.
  • A Codex resume reads a session store the agent controls, which widens the prompt-injection surface. Tools stay gated by ADR 0090.
  • On pi the acknowledgement proves delivery of an RPC id, not of the exact text.

Open questions ​

  • Can an OpenShell exec write the mailbox as a user other than the agent, so the mailbox directory can be agent-immutable on every runtime?
  • Do the agent definitions need a sandbox variable that says steering is active, or is the envelope's opening line enough for them to recognize a steer?