Skip to content

feat: enforce scoped Codex task reads - #724

Open
kilhyeonjun wants to merge 5 commits into
openai:mainfrom
kilhyeonjun:feat/scoped-codex-read-roots
Open

feat: enforce scoped Codex task reads#724
kilhyeonjun wants to merge 5 commits into
openai:mainfrom
kilhyeonjun:feat/scoped-codex-read-roots

Conversation

@kilhyeonjun

Copy link
Copy Markdown

Summary

  • add repeatable --read-root <directory> support for Codex task and rescue flows
  • enforce request-scoped permission profiles across foreground, background, and resumed tasks
  • fail closed for invalid roots, unsupported runtimes, and unapproved temp/workspace access
  • document the option and add regression coverage

Verification

  • npm test (97 passed)
  • npm run build
  • node scripts/bump-version.mjs --check 1.0.11
  • claude plugin validate plugins/codex
  • git diff --check

@kilhyeonjun
kilhyeonjun requested a review from a team September 4, 2026 01:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22dac7a6e1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +88 to +90
(options.readRoots?.length ?? 0) > 0 &&
/default_permissions|permission profiles?|unknown field.*config|invalid.*permissions/i.test(message)
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject runtimes that silently ignore permission profiles

When this runs against Codex older than 0.138, thread/start can succeed while ignoring the unrecognized default_permissions and permissions keys; codex app-server --help documents --strict-config as the option that errors on unrecognized fields, while SpawnedCodexAppServerClient launches without it. This catch is therefore never reached, sandbox has been omitted, and a task advertised as confined can receive the runtime's default full-read access. Check a runtime capability/version before starting or verify that the response selected claude_companion_scoped.

Useful? React with 👍 / 👎.

throw new Error("Choose either --resume/--resume-last or --fresh.");
}
const write = Boolean(options.write);
const readRoots = (options["read-root"] ?? []).map((readRoot) => resolveReadRoot(cwd, readRoot));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve quoted empty roots through raw parsing

When the helper uses its documented single-raw-argument invocation, an input such as --read-root "" src inspect is tokenized by splitRawArgumentString without the quoted empty token. If src is an existing directory, this line consequently validates src as the root and runs with inspect as the prompt instead of rejecting the empty root as promised. Preserve empty quoted tokens during raw tokenization or reject this form before parsing.

Useful? React with 👍 / 👎.

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