Skip to content

Load agent identity from CODEX_AGENT_IDENTITY#18180

Open
efrazer-oai wants to merge 1 commit intoefrazer/codex/agent-identity-only-startupfrom
efrazer/codex/agent-identity-env
Open

Load agent identity from CODEX_AGENT_IDENTITY#18180
efrazer-oai wants to merge 1 commit intoefrazer/codex/agent-identity-only-startupfrom
efrazer/codex/agent-identity-env

Conversation

@efrazer-oai
Copy link
Copy Markdown
Contributor

@efrazer-oai efrazer-oai commented Apr 16, 2026

Stack

  1. Accept JWT agent identity auth input #18176 - Accept JWT agent identity auth input
  2. Enable agent identity for tokenless startup auth #18177 - Enable agent identity for tokenless startup auth
  3. Load agent identity from CODEX_AGENT_IDENTITY #18180 - Load agent identity from CODEX_AGENT_IDENTITY

What changed

Auth loading can now read CODEX_AGENT_IDENTITY when env auth is enabled.

The env var contains the same agent identity JWT accepted by auth.json in #18176. CodexAuth::from_agent_identity_jwt(...) turns that JWT into ephemeral tokenless ChatGPT auth with one stored agent identity record.

CODEX_API_KEY still wins if both env vars are set.

Validation

  • cd codex-rs && just fmt
  • cd codex-rs && cargo check -p codex-login -p codex-core
  • cd codex-rs && cargo test -p codex-login agent_identity
  • cd codex-rs && cargo test -p codex-login load_auth_reads_agent_identity_from_env
  • cd codex-rs && cargo test -p codex-login enforce_login_restrictions
  • cd codex-rs && just fix -p codex-login

@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from ae82643 to 90f493c Compare April 16, 2026 22:23
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from f4651cb to ab99a2c Compare April 16, 2026 22:25
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from 90f493c to 4f088d5 Compare April 16, 2026 23:36
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from ab99a2c to 3901696 Compare April 16, 2026 23:36
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from 4f088d5 to 3317707 Compare April 17, 2026 19:06
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from 3901696 to 25c98e9 Compare April 17, 2026 19:07
@efrazer-oai efrazer-oai marked this pull request as ready for review April 17, 2026 19:14
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from 3317707 to 3e92738 Compare April 17, 2026 19:15
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch 2 times, most recently from 0ba8937 to 365f848 Compare April 17, 2026 19:36
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from 3e92738 to 4783c5f Compare April 17, 2026 19:36
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from 365f848 to dff3e19 Compare April 20, 2026 16:34
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch 2 times, most recently from e8cde66 to ee7a12a Compare April 20, 2026 16:58
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from dff3e19 to d6ac9d8 Compare April 20, 2026 16:58
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-only-startup branch from ee7a12a to 5512954 Compare April 20, 2026 17:03
@efrazer-oai efrazer-oai force-pushed the efrazer/codex/agent-identity-env branch from d6ac9d8 to ae61659 Compare April 20, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant