Gateway to Probe Command Contract v0
Scope
Defines the minimum command contract that Gateway uses to send authorized intents to Probe in AIOS v0. This page covers the common command envelope, the v0 command set, payload expectations, Probe-side validation, and the boundary between platform commands and DevBox-internal coding-tool activity.Terminology
- Gateway: the sole control-plane authority for desired state, routing intent, approval, and lifecycle decisions.
- Probe: the host-side data-plane runtime that executes authorized commands against local Worker Sandbox and channel resources.
- Lease epoch: the fencing token that invalidates stale commands.
- Desired version: monotonically increasing desired-state revision issued by Gateway.
Normative Spec
Command Principles
Gateway-issued commands MUST follow these rules in v0:- Gateway is the only authoritative command source.
- Every command MUST be constrained by
lease_epoch. - Probe MUST execute authorized intent only and MUST NOT invent new desired state.
- Probe MUST treat
command_idas an idempotency key.
Common Command Envelope
All Gateway-to-Probe commands MUST include:command_idcommand_typeresource_idsession_iddesired_versionlease_epochdeadlinereasonpayload
approval_refsnapshot_ref
Field Rules
command_idMUST be unique for idempotent execution tracking.command_typeMUST be one of the supported v0 command enums.resource_idMUST identify the local runtime target such as DevBox, Worker Sandbox, or runtime unit.desired_versionMUST be used by Probe to reject stale desired-state mutations.lease_epochMUST be used for fencing stale commands.deadlineMUST be enforced by Probe; expired commands MUST NOT execute.approval_refMAY appear for platform-level risky actions, but MUST NOT be used for DevBox-internal Codex, Claude Code, or OpenCode command approval.
v0 Command Set
Probe MUST support these v0 command types:AllocateBindWorkloadStartSessionAttachChannelDetachChannelUpdateDesiredStateCheckpointDrainTerminateRevokeLease
Channel Command Rules
AttachChannelandDetachChannelMUST only target top-level channel typesssh_remoteordialog.- When
channel_type=ssh_remote,remote_modeMUST be present and MUST be eitheride_primaryorterminal_fallback. dialog.targetMAY be any supported v0 target such ascodex,claude_code,opencode,wechat, ortelegram.
Probe Validation Rules
Before execution, Probe MUST validate:lease_epochmatches the currently valid lease.desired_versionis not older than the local known version.deadlinehas not expired.command_idhas not already been completed for the same effective intent.approval_refexists when the action requires platform-level approval.- Requested channels and modes are declared in Probe capability.
Approval and Authority Boundary
- Platform-level risky actions MAY require
approval_ref. - DevBox-internal coding-tool commands remain outside AIOS secondary approval.
- Scheduler-triggered execution MUST still materialize through this contract before Probe acts.
Examples
Error & Recovery
- Stale
lease_epoch: Probe MUST reject the command and fence execution. - Older
desired_version: Probe MUST reject as stale intent. - Expired
deadline: Probe MUST reject without side effects. - Unsupported
channel_typeorremote_mode: Probe MUST reject as capability mismatch. - Duplicate
command_id: Probe MUST treat as idempotent replay and avoid duplicate mutation.
Security & Audit
- Commands MUST be auditable through metadata with
command_id,reason,lease_epoch, and correlation fields. - Gateway remains the sole authority for desired state and approval decisions.
- Probe validation is local enforcement, not policy authorship.
- Commands MUST NOT be used to backdoor approval for DevBox-internal coding-tool operations.
Status
Current status:draft
Source discussions:
docs/maintainers/conversation-records/agent-platform/2026-03-24-gateway-to-probe-command-contract-v0-draft.mddocs/maintainers/conversation-records/agent-platform/2026-03-24-p0-freeze-result-accepted.mddocs/maintainers/conversation-records/agent-platform/2026-03-24-p1-freeze-result-accepted.md
Changelog
- 2026-03-24: Initial formal v0 contract created from frozen discussion draft.