Skip to content

fix(codex): keep Cookbook off bearer APIs - #5808

Open
RaresKeY wants to merge 3 commits into
odysseus-dev:devfrom
RaresKeY:fix/cookbook-bearer-boundary
Open

fix(codex): keep Cookbook off bearer APIs#5808
RaresKeY wants to merge 3 commits into
odysseus-dev:devfrom
RaresKeY:fix/cookbook-bearer-boundary

Conversation

@RaresKeY

Copy link
Copy Markdown
Member

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

  • This PR targets dev, not main.

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

  • Bug fix (restores a coherent authorization boundary)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (retires the advertised Cookbook bearer scopes)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev.
  • My changes are limited to the Cookbook bearer boundary, scope catalog/UI, shipped integration wording, and focused regressions.
  • I ran the full app interactively. This remains a draft until maintainer review and deployment-level verification are complete.

How to Test

  1. Run 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.
  2. Verify bearer and internal-tool requests to every /api/codex/cookbook/* route receive the same non-enumerating 403 before any mocked state, credential, network, shell, process, or endpoint operation is reached.
  3. Verify cookbook:read and cookbook:launch are absent from the token profiles/API and both token-management interfaces, and attempts to mint them are rejected.
  4. Verify the Codex and Claude bundles no longer expose Cookbook administration commands.
  5. Verify existing trusted in-app/admin callers can still use the Cookbook and direct /api/model/* routes.
  6. Run 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-dev runner 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.

  • Screenshot or short clip of the change in the running app, attached below. This remains pending while the PR is a draft.
  • Style match: this only removes two existing scope options and adds no visual values, classes, icons, spacing, or typography.
  • No new component patterns. No component is added or replaced.
  • I am not an LLM agent submitting a bulk PR. The focused issue Codex Cookbook bearer routes have an inconsistent admin boundary #5676 was opened first and this is not represented as a human-authored interactive verification.

Screenshots / clips

Pending interactive verification. The visible change is limited to removal of
the cookbook:read and cookbook:launch choices from both existing API-token
forms.

@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Jul 28, 2026
@RaresKeY
RaresKeY marked this pull request as ready for review July 28, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex Cookbook bearer routes have an inconsistent admin boundary

1 participant