[codex] request desktop attestation from app#20619
Merged
Merged
Conversation
7066710 to
d428f83
Compare
Contributor
Author
|
Addressed in 3cbcba1: websocket handshake headers now go through the same scoped |
3cbcba1 to
698e598
Compare
Contributor
Author
|
Just did a rebase and resolved some conflicts. Need to double check it does not break anything. (Reply by Codex) |
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
pakrym-oai
reviewed
May 6, 2026
Co-authored-by: Codex <noreply@openai.com>
aa60c6e to
a996616
Compare
pakrym-oai
reviewed
May 8, 2026
pakrym-oai
reviewed
May 8, 2026
pakrym-oai
reviewed
May 8, 2026
pakrym-oai
reviewed
May 8, 2026
Collaborator
pakrym-oai
left a comment
There was a problem hiding this comment.
Let's try and drop uses_chatgpt_auth from ApiProvider. ApiProvider is an abstraction that should know about details of the provider implementation.
euroelessar
approved these changes
May 8, 2026
pakrym-oai
reviewed
May 8, 2026
pakrym-oai
approved these changes
May 8, 2026
Contributor
Author
|
🙏 @euroelessar @pakrym-oai it's green now. taking a last pass and then merging it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TL;DR: teaches
codex-rs/ app-server to request a desktop-provided attestation token and attach it asx-oai-attestationon the scoped ChatGPT Codex request paths.Details
This PR teaches the Codex app-server runtime how to request and attach an attestation token. It does not generate DeviceCheck tokens directly; instead, it relies on the connected desktop app to advertise that it can generate attestation and then asks that app for a fresh header value when needed.
The flow is:
initialize, the app can advertise that it supportsrequestAttestation.attestation/generateto the app.x-oai-attestationon the scoped outbound requests.The code in this repo is mostly protocol and runtime plumbing: it adds the app-server request/response shape, introduces an attestation provider in core, wires that provider into Responses / compaction / realtime setup paths, and covers the intended scoping with tests. The signed macOS DeviceCheck generation remains owned by the desktop app PR.
Related PR
Validation
Tests run
Also ran:
E2E DeviceCheck validation
First validated the signed desktop app boundary directly: launched a packaged signed
Codex.app, sentattestation/generate, decoded the returnedv1.attestation header, and validated the extracted DeviceCheck token withpersonal/jm/verify_devicecheck_token.pyusing bundle IDcom.openai.codex. Apple returnedstatus_code: 200andis_ok: true.Then ran the fuller app + app-server flow. The packaged
Codex.applaunched a current-branch app-server viaCODEX_CLI_PATH, and a local MITM proxy intercepted outboundchatgpt.comtraffic. The app-server requestedattestation/generatefrom the real Electron app process, and the intercepted/backend-api/codex/responsestraffic includedx-oai-attestationon both routes:The captured header decoded to a DeviceCheck token that also validated with Apple for
com.openai.codex(status_code: 200,is_ok: true, team2DC432GLL2).