agentHost: use workspace-scoped Codex permission profiles - #334945
Draft
Giuseppe Cianci (Giuspepe) wants to merge 8 commits into
Draft
agentHost: use workspace-scoped Codex permission profiles#334945Giuseppe Cianci (Giuspepe) wants to merge 8 commits into
Giuseppe Cianci (Giuspepe) wants to merge 8 commits into
Conversation
Giuseppe Cianci (Giuspepe)
marked this pull request as ready for review
September 7, 2026 16:13
Giuseppe Cianci (Giuspepe)
enabled auto-merge (squash)
September 7, 2026 16:13
Copilot started reviewing on behalf of
Giuseppe Cianci (Giuspepe)
September 7, 2026 16:13
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Workspace-root handling can retain or persist additional-directory access after it should be revoked.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/vs/platform/agentHost/node/codex/codexAgent.ts — Mixing additional writable directories into runtimeWorkspaceRoots also makes them… |
What changed in this PR
Restricts Codex’s default filesystem permissions to workspace-scoped profiles while preserving existing permission presets.
Changes:
- Defines VS Code-owned Codex permission profiles.
- Applies profiles across starts, turns, forks, and resumes.
- Expands focused permission and workspace-root tests.
| File | Description |
|---|---|
codexSessionConfigKeys.test.ts |
Tests updated preset descriptions. |
codexPrewarmEviction.test.ts |
Tests profile propagation and workspace roots. |
codexLaunchConfig.test.ts |
Tests profile definitions and resume overrides. |
codexLaunchConfig.ts |
Defines and selects permission profiles. |
codexAgent.ts |
Applies profiles throughout session lifecycles. |
Suppressed comments (1)
src/vs/platform/agentHost/node/codex/codexAgent.ts:1764
runtimeWorkspaceRootsis sticky onturn/start(the protocol says this field replaces the roots only when supplied). For a single-root thread started in workspace-write mode with an additional directory, switching to read-only returnsundefinedhere, so Codex retains the additional directory in:workspace_roots; the read-only profile can then still read outside the workspace. Always send the actual workspace roots when selecting read-only so prior additional roots are removed.
: workingDirectories.length > 1 ? distinctAbsolutePaths(workingDirectories) : [];
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alexandru Dima (alexdima)
previously approved these changes
Sep 7, 2026
Giuseppe Cianci (Giuspepe)
marked this pull request as draft
September 8, 2026 08:32
auto-merge was automatically disabled
September 8, 2026 08:32
Pull request was converted to draft
Giuseppe Cianci (Giuspepe)
force-pushed
the
agents/debug-vscode-issue-334925-fix
branch
2 times, most recently
from
September 8, 2026 10:10
cb07c3d to
740b893
Compare
Use named Codex permission profiles for default and auto-review sessions while preserving the existing full-access behavior. Apply the selected profile across thread start, turns, forks, resumes, and backing chats.
Keep app-server runtime roots from promoting additional writable directories into persisted workspace state. Send explicit roots for read-only sessions, use portable protected-path overrides, and keep generic Codex E2E fixtures on full access.
Giuseppe Cianci (Giuspepe)
force-pushed
the
agents/debug-vscode-issue-334925-fix
branch
from
September 8, 2026 11:08
740b893 to
4dd4e9e
Compare
Giuseppe Cianci (Giuspepe)
marked this pull request as ready for review
September 8, 2026 12:58
Giuseppe Cianci (Giuspepe)
marked this pull request as draft
September 8, 2026 12:59
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
:minimalsystem/runtime reads and isolated temporary-directory accessRelated to #334925
Platform behavior
:minimalruntime set can remain readableValidation
npm run compilenpm run hygienegit diff --check/etc/passwdremains readable in sandboxed modes because Codex includes required system/runtime paths in:minimal