Skip to content

feat(codex): add read-only local storage mounts - #5575

Merged
markstuart-oai merged 3 commits into
feat/codex-harnessfrom
markstuart/native-storage-mounts
Nov 7, 2026
Merged

markstuart-oai merged 3 commits into
feat/codex-harnessfrom
markstuart/native-storage-mounts

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Agent tools need read access to directories that the caller manages outside their workspace. Add LocalStorageMount and the mounts option on Environment.local for explicit, read-only local_bind mounts on Linux.

Mounts use the existing permission profile and sandbox process lifecycle. Initial support requires canonical directory paths with identical source and destination. Validation rejects writable mounts, remapping, overlaps with writable or private paths, and unsupported executors. Preflight also rejects existing hard links shared with writable grants. Mounted trees may contain regular files, directories, and symlink entries; validation rejects special files such as named pipes and sockets. It fails if it cannot finish the required directory inspection. Restore checks the complete permission profile, and sessions reject writable-root replacement while mounts are active. The caller retains ownership of the storage. Applications must keep source paths and file topology stable for the session.

Add a guide and example, update the generated native API snapshot, and extend installed-wheel Linux qualification. Tests cover enforcement, restore with reordered mount declarations, cancellation, and preservation of caller storage.

Test plan

  • The required verification script passed formatting, lint, mypy, and Pyright. The parallel suite passed 5,260 tests with 184 skips; the serial suite passed 53 tests.
  • Native compilation and source qualification passed after integrating the current base. The focused local suite passed 36 mount tests, with two explicit outer-sandbox isolation skips.
  • The FIFO and socket regressions reproduced helper startup before the guard and passed after it. Hard-link regressions cover both the working directory and additional writable roots.
  • Strict Linux qualification passed all 38 mount tests without skips, plus 89 canonical-storage tests. Installed-package qualification passed on Linux, macOS, and Windows.
  • All current-head checks finished: 31 passed and 27 were intentionally skipped by the provider. Tests, native-branch qualification, and CodeQL passed.
  • Two independent implementation reviews passed on the final source. The API snapshot reproduces byte for byte through its owning generator.

Issue number

None linked.

Checks

  • I've added new tests, if relevant
  • I've run the applicable checks in AGENTS.md, including .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all required PR checks pass
  • I've completed the review required by AGENTS.md

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 7, 2026 05:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T06:24:32.141527Z 87f639a Manual request
🔒 Security Review ✅ Completed 2026-11-07T06:26:40.882882Z 87f639a Manual request

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 7c32cabdcd

ℹ️ 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 thread packages/codex/rust/environment.rs Resolved
Comment thread packages/codex/rust/environment.rs Resolved

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for the existing cross-grant hard-link finding, independently confirmed against this commit. Mount validation checks directory overlap, but mounted file identities can still be writable through another granted root. Please reject those aliases before admitting the mount, with regression coverage preserving caller-owned data. Existing discussion: #5575 (comment)

Reviewed declaration capture, native preflight and permission construction, private-state exclusions, writable-root replacement, restore policy receipts, cancellation, and caller-owned storage preservation. No additional actionable findings.

Native-only package qualification passed on Linux, macOS, and Windows; regular native snapshots and Rust CodeQL remain in progress. Static review only; I did not run candidate code or tests.

Comment thread packages/codex/rust/environment.rs Resolved
Comment thread packages/codex/rust/environment.rs Resolved
@markstuart-oai
markstuart-oai force-pushed the markstuart/native-storage-mounts branch from 7c32cab to 87f639a Compare November 7, 2026 06:17

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The hard-link blocker is fixed: preflight inspects mounted trees, compares multiply-linked file identities against canonical cwd/additional writable grants, and fails closed on required inspection errors. It also rejects FIFO/socket/device entries without opening them or following symlinks. Public-session regressions cover rejection before helper/model effects and caller-data preservation. The rebased prior feature patch is equivalent apart from its API baseline SHA.

Coordinator and independent static re-review found no additional actionable issue. No candidate code or tests executed locally. Hosted platform CI remains pending; keep the stated merge/release hold until validation completes.

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 87f639a32c

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread packages/codex/rust/environment.rs Resolved
@markstuart-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 87f639a32c

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 87f639a32c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Contributor Author

@dpiet-oai The hard-link finding is fixed in 87f639a3, and its threads are resolved. All current-head checks have finished: 31 passed and 27 were intentionally skipped. Installed-package qualification passed on Linux, macOS, and Windows; the strict Linux mount suite passed all 38 tests without skips. Hosted code/security review and maintainer re-review are complete, and the exact head merges cleanly with 0d672481.

Please confirm the fix and update your earlier change-request review when you have a chance.

@markstuart-oai
markstuart-oai merged commit b0e2f96 into feat/codex-harness Nov 7, 2026
60 checks passed
@markstuart-oai
markstuart-oai deleted the markstuart/native-storage-mounts branch November 7, 2026 07:00
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.

3 participants