fix(codex): keep Cookbook off bearer APIs - #5808
Open
RaresKeY wants to merge 3 commits into
Open
Conversation
RaresKeY
marked this pull request as ready for review
July 28, 2026 16:57
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This replaces #5679, which GitHub closed during the repository transfer and fork-network separation. The branch has been rebuilt on the current dev history; the implementation scope is unchanged.
Keep Cookbook model installation, launch, host control, task logs, saved commands, and deployment credentials inside the existing trusted, operator-controlled in-app/admin boundary. The duplicate external-integration
/api/codex/cookbook/*family now fails closed for bearer and internal-tool identities before state, configuration, credential, filesystem, network, SSH, tmux, process, or endpoint access.The obsolete Cookbook token scopes and shipped Codex/Claude bearer commands are removed. Existing token rows are not rewritten; any legacy Cookbook scope strings simply become inert. Generic chat/model APIs, configured inference endpoints, unrelated Codex/Claude tools, and existing trusted in-app/admin Cookbook/model routes remain unchanged.
Target branch
dev, notmain.Linked Issue
Fixes #5676
Part of #5674
Depends on #5678. After that mounted-path fix merges, this branch should be
rebased to use its shared application-route-path helper without changing the
Cookbook boundary.
Type of Change
Checklist
dev.How to Test
python -m pytest -q tests/test_codex_cookbook_admin_gate.py tests/test_api_token_routes.py tests/test_codex_ssh_host_validation.py tests/test_cors_preflight.py. The isolated focused run passes all 115 tests./api/codex/cookbook/*route receive the same non-enumerating403before any mocked state, credential, network, shell, process, or endpoint operation is reached.cookbook:readandcookbook:launchare absent from the token profiles/API and both token-management interfaces, and attempts to mint them are rejected./api/model/*routes.python -m pytest -q. The isolated full suite completes with 4,737 passing and 5 skipped tests. Its 12 failures exactly match the clean current-devrunner baseline: the omitted.env.example, one offline URL-join check, two backup-recovery checks, and eight offline web-fetch checks.Visual / UI changes — REQUIRED if you touched anything that renders
The API-token forms no longer show the two retired Cookbook scope options. No
layout, styling, component, or model-management UI changes are included.
Screenshots / clips
Pending interactive verification. The visible change is limited to removal of
the
cookbook:readandcookbook:launchchoices from both existing API-tokenforms.