Support ChatGPT Sites repositories as ephemeral Codex cloud workspaces
Component
Codex cloud environments + ChatGPT Sites source repositories
Problem
ChatGPT Sites can materialize and edit its managed canonical repository, then save a Sites version tied to a commit. Codex cloud environments currently start from connected GitHub repositories. There is no sanctioned way to attach a Sites-managed repository to a temporary Codex workspace without exporting a short-lived repository credential or creating a competing mirror.
Passing a Sites repository credential through model context, prompts, environment configuration, tracker records, or logs is not an acceptable bridge. A GitHub mirror also breaks Sites-as-source-of-truth workflows.
Requested platform capability
Expose opaque, audited Sites-bound workspace operations:
sites.create_codex_workspace(
project_id,
expected_base_commit_or_version,
permissions = [source_read, source_write],
ttl,
task_id,
task_revision,
durable_lane_identity,
exact_file_lock,
idempotency_key
) -> { workspace_handle, base_commit, expires_at, audit_receipt_id }
The platform should create an ephemeral environment from the canonical Sites repository and inject the least-privilege repository lease outside model context. The lease and repository coordinates must be non-exportable and unavailable to prompts, logs, task records, and generated artifacts.
sites.finalize_codex_workspace(
workspace_handle,
expected_base_commit,
proposed_head_commit,
task_id,
task_revision,
verification_receipt_digest
) -> { commit_sha, sites_version_id, version_number, artifact_digest, audit_receipt_id }
Finalization should:
- reject canonical base divergence instead of merging or force-pushing;
- enforce the exact file lock and clean/diff boundary;
- publish with the platform-held lease;
- build and save an immutable Sites version tied to the resulting commit;
- return non-sensitive commit/version/artifact proof;
- revoke the lease and destroy the environment;
- not deploy production (deployment remains a separate approval gate).
A third operation is needed for fail-closed cleanup:
sites.abort_codex_workspace(workspace_handle, reason, idempotency_key)
-> { lease_revoked, workspace_destroyed, audit_receipt_id }
Abort should be automatic on expiry, cancellation, failed verification, task-revision drift, base-CAS failure, or finalize failure.
Security and acceptance requirements
- Sites remains the sole source repository.
- No raw credential or reusable token is returned to the model or caller.
- Workspace handles are opaque, scoped, expiring, revocable, and task-bound.
- Every create/finalize/abort transition is immutable and auditable.
- Exact base commit, task revision, durable identity, and file lock are server-validated.
- Replays are idempotent; mismatched fingerprints conflict.
- Successful finalize returns commit-bound and Sites-version-bound proof.
- Failed or abandoned work cannot leave a usable lease or persistent workspace.
This would allow tracked Codex cloud implementation against Sites-managed source without weakening either product's security boundary.
2 Comments
Uh... kind regards or Codex i suppose. lol. I'm just trying to get my desktop codex agent to be able to edit my @sites without having to do weird local repo work on my desktop...
Additional prerequisite: credential-free canonical-state reads
A separate bootstrap case exposed a prerequisite for the workspace flow: before creating a task-bound workspace, an orchestrator may need to verify the canonical task revision, lane, and file lock stored by a Sites-hosted application.
Today the Sites control plane can inspect project/version provenance, but it does not expose a credential-free read operation for either a bound D1 database or an owner-authenticated read-only site route. Passing an owner bearer, cookie, or repository credential through model context is not acceptable.
Either of these first-party operations would close the gap:
Requirements:
Or, for database-backed applications:
This should accept a pre-registered named query rather than agent-supplied raw SQL, execute read-only, enforce project/binding scope and limits, and expose no database credential.
This read seam is not a substitute for the proposed workspace broker. It is a prerequisite for binding
create_codex_workspaceto fresh canonical task revision/lane/lock state without requiring a browser session or secret-bearing workaround.