Worker execution capture
Retain and inspect ordered private worker observations alongside historical inputs.
Worker execution capture retains assistant messages and permitted detailed execution events separately from the existing activity summary. It is opt-in, organization-scoped, bounded and encrypted. Backend run state remains the authority for task success, failure and retries; a recorded model response does not prove a successful business action.
Enable only with explicit retention consent
HISTORY_CAPTURE_ENABLED must be enabled for the deployment, recovery mode must be off, and the organization’s independent run-input policy must explicitly select execution_events. Existing prompt, manifest or file consent and legacy connector policies do not enable transcripts. Use the existing history:capture run-configure operator command with the current expected policy revision; do not replace a policy without checking that revision.
An illustrative policy selection is:
{
"schemaVersion": 1,
"organizationId": "11111111-1111-4111-8111-111111111111",
"enabled": true,
"retentionDays": 30,
"content": ["prompt", "manifest", "hydrated_files", "execution_events"]
}This is a synthetic example, not automatic activation. Transcript consent covers permitted run-visible business content: assistant prose may itself quote provider information. Capture does not grant tool access. Input selections still govern retaining the prompt, manifest and context files. Credentials are redacted and private reasoning is excluded. Unsupported, oversized, unavailable or omitted content remains an explicit gap.
What the worker retains
The backend snapshots initial input under the selected policy. The worker records normalized emitted events in order, including intermediate assistant messages and updates, tool calls/results, command output, file changes, searches, plans, usage and terminal evidence. The Codex adapter preserves visible MCP content blocks for capture without changing existing chat or receipt output semantics.
Terminal usage also retains optional cache-write counts and the model identity, including whether that identity was configured or reported. Older captures without those optional fields remain readable. Subagent activity retains its normalized lifecycle and agent count; omitted private provider fields appear as capture gaps. Usage accounting and execution capture remain independent.
Coverage describes normalized worker-visible events, not a lossless provider HTTP transcript or all filesystem/network effects. Files supplied to a workspace are not proof that the agent read every file. Terminal output references do not preserve every intermediate file revision. Requested model/runtime settings are distinct from a provider-confirmed execution identity; unavailable build identity stays unknown.
Capture uses bounded immutable encrypted batches and a private run descriptor. Backend acknowledgement means the batch is committed. One worker process or host failure may lose the bounded unacknowledged tail. Terminal runs with unsealed capture are partial; missing final output is not fabricated. Capture failure does not change the run’s result or retry policy. New attempts have independent run IDs and cannot overwrite prior capture.
Inspect and download
These are trusted backend operator endpoints. Configure RUN_EXECUTION_CAPTURE_READ_TOKEN (or the local stack’s executionCaptureReadToken) as a distinct backend-only credential and keep it server-side. Readback is unavailable when it is missing or equals AGENT_SERVICE_TOKEN. Worker credentials and scoped agent capabilities are denied. The stack generator never provisions the read credential to agents. These are not ordinary frontend routes or oblivectl commands.
GET /organizations/{organizationId}/runs/{runId}/execution-captureThe response reports availability/coverage, backendRunStatus and snapshotSha256 for the accepted prefix. The transcript’s terminal harnessStatus describes the model invocation; the backend run can still fail during synchronization or completion validation. Capture seals before backend completion while its lease is valid, so a later completion rejection does not rewrite the sealed transcript; consult the backend run state/error too. Reads recheck current policy, organization, profile, task and integration authority, and do not extend retention or call providers.
GET /organizations/{organizationId}/runs/{runId}/execution-capture/download?snapshotSha256={digest}The download verifies retained object hashes and descriptor membership and returns JSONL with private/no-store caching. A changed prefix returns a conflict; inspect again rather than silently accepting different bytes. Treat the authorized download as sensitive business data. No caller supplies object-store paths and no public storage URL is returned.
Worker delivery uses /internal/runs/{runId}/execution-capture/start and /batches through its existing trusted service client and active lease. These endpoints neither start a task nor grant provider access. Retention is fixed at admission; policy/source revocation, expiry, corruption or missing content can prevent publication/readback.
Native Codex sessions
A finished live run can also keep Codex’s own session files, so its trajectory can be compared with replay runs in the same ATIF format. This is off by default. It needs all of:
- the organization’s run-input policy with
execution_events, so the run has an execution capture; HISTORY_CAPTURE_ENABLEDandCODEX_SESSION_CAPTURE_ENABLEDon the backend;CODEX_SESSION_CAPTURE_ENABLEDon the worker.
OBLIVE_RECOVERY_MODE stops it on either side.
The worker reads the files only after the run’s result is submitted, and never waits for them. It finds
the run’s root session and its sub-agents by their parent_thread_id, among session files written
since the run started, redacts credentials with replay’s redaction, and uploads each file to
PUT /internal/runs/{runId}/execution-capture/codex-sessions/{sessionId}. Each file is at most 32 MiB,
a run keeps at most 16, and the whole step stops after two minutes. A missing or oversized file, a
redaction or upload failure, or a timeout is logged as a gap and changes nothing else: the run’s
status, retries, timing and outputs are the same as with capture off. Codex’s launch and configuration
are unchanged.
The backend accepts a session only from the run’s own lease token, within 30 minutes of the run
finishing, for a sealed capture whose policy still includes execution_events. It redacts its own
credentials again, stores the file encrypted beside the capture, counts it against the daily capture
budget, and keeps it for the capture’s retention.
GET /organizations/{organizationId}/runs/{runId}/execution-capture/atifThis converts the retained sessions to ATIF-v1.8 when read, nests sub-agents under their parent, and
tags each trajectory extra.origin: live with extra.runId. Sessions that cannot be converted are
listed as gaps.
Link to business snapshots
A world snapshot’s retained-context requirement names a run ID. Use that identity to inspect its execution capture. Historical environment input, the resulting execution, and later evaluation labels are separate evidence. This feature does not insert post-cutoff messages/results into an earlier planning input or mutate frozen V3 membership.
Chat continues to retain its durable user/assistant message parts. Full native chat-turn execution capture is pending; this worker feature must not be described as full capture of every chat session. UI work, all-connector acquisition and real-account acceptance remain separate tasks.
Live acceptance
With an approved policy, run a small task that produces two assistant messages separated by a read-only tool call. Inspect/download the run and compare prompt/context, message order, tool content, final output and usage with the visible execution. Repeat with a failed and cancelled run. Test a second organization, policy/source revocation, a changed prefix, expiry and unavailable content. Verify encrypted storage and cleanup in the target deployment. Automated fixtures do not establish live-provider parity.