Skip to content

Propagate runtime permission profiles#19849

Closed
evawong-oai wants to merge 1 commit into
codex/bugb15632-preserved-path-preflightfrom
codex/bugb15632-runtime-permissions
Closed

Propagate runtime permission profiles#19849
evawong-oai wants to merge 1 commit into
codex/bugb15632-preserved-path-preflightfrom
codex/bugb15632-runtime-permissions

Conversation

@evawong-oai

@evawong-oai evawong-oai commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Propagate active runtime permission profiles through embedded turn start paths so platform sandbox adapters receive the current FileSystemSandboxPolicy.

Scope

  1. Pass runtime permission profiles through thread routing.
  2. Preserve legacy sandbox behavior for remote turns.
  3. Add focused coverage for embedded and remote turn start cases.

Reviewer Focus

  1. This PR updates active session permission flow, not platform sandbox implementation.
  2. Embedded turns should receive the active runtime profile when one exists.
  3. Remote turns should keep the existing legacy sandbox behavior.

Stack

  1. Policy primitive: [sandbox] Enforce protected workspace metadata paths #19846
  2. macOS Seatbelt adapter: Enforce workspace metadata protections in Seatbelt #19847
  3. Shell preflight UX: Add workspace metadata shell preflight #19848
  4. Runtime profile propagation: this PR
  5. Linux bubblewrap adapter: Enforce workspace metadata protections in Linux sandbox #19852

Validation

  1. codex tui app server session tests
  2. codex tui thread routing tests
  3. formatting for codex tui

@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 05f4eb2 to f23239c Compare April 27, 2026 18:16
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from fca3989 to 1bc0b13 Compare April 27, 2026 18:32
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch 2 times, most recently from 2e4f779 to 774934a Compare April 27, 2026 18:40
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch 2 times, most recently from 2b511ae to b0df7b1 Compare April 27, 2026 18:55
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 774934a to 21cfe9c Compare April 27, 2026 18:55
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from b0df7b1 to e76a989 Compare April 27, 2026 19:07
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 21cfe9c to 4e95f07 Compare April 27, 2026 19:07
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from e76a989 to 6c3c566 Compare April 27, 2026 19:48
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch 2 times, most recently from 5f6cf03 to a73dc93 Compare April 27, 2026 20:52
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 6c3c566 to 669222a Compare April 27, 2026 20:52
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from a73dc93 to f483023 Compare April 27, 2026 21:14
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch 2 times, most recently from a1666bf to 427c425 Compare April 27, 2026 22:22
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch 2 times, most recently from 9d4f283 to 4db4407 Compare April 28, 2026 00:10
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 427c425 to 5259804 Compare April 28, 2026 00:10
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 4db4407 to e8365c7 Compare April 28, 2026 01:10
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 5259804 to f9a5bc4 Compare April 28, 2026 01:10
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from e8365c7 to abc55be Compare April 28, 2026 03:15
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from f9a5bc4 to e683055 Compare April 28, 2026 03:15
evawong-oai added a commit that referenced this pull request Apr 28, 2026
## Summary

Make FileSystemSandboxPolicy the semantic source of truth for project
root metadata protection. Under writable roots, `.git`, `.codex`, and
`.agents` stay protected unless user policy grants an explicit write
rule for that metadata path.

## Scope

1. Add `protected_metadata_names` to `WritableRoot`.
2. Teach `FileSystemSandboxPolicy::can_write_path_with_cwd` to reject
protected metadata writes under writable roots unless explicitly
allowed.
3. Default workspace write profiles to protect `.git`, `.codex`, and
`.agents`.
4. Add the Linux fallback setup needed before Linux enforcement lands
later in the stack.

## Reviewer Focus

1. The policy decision belongs in FileSystemSandboxPolicy, not shell
command parsing.
2. Legacy SandboxPolicy remains a compatibility projection, not the
source of the new rule.
3. Explicit user write rules can still opt into these metadata paths.

## Stack

1. Policy primitive: this PR
2. macOS Seatbelt adapter: #19847
3. Shell preflight UX: #19848
4. Runtime profile propagation: #19849
5. Linux bubblewrap adapter: #19852

## Validation

1. codex protocol permissions tests
2. formatting for codex protocol and codex linux sandbox
3. diff whitespace check
evawong-oai added a commit that referenced this pull request Apr 28, 2026
## Summary

Translate FileSystemSandboxPolicy project root metadata carveouts into
macOS Seatbelt rules.

## Scope

1. Thread protected metadata names into Seatbelt access roots.
2. Ask FileSystemSandboxPolicy whether each metadata carveout is
writable.
3. Emit Seatbelt deny rules that block creating or replacing protected
metadata names under writable roots.
4. Add coverage for first time metadata creation and read only
carveouts.

## Reviewer Focus

1. This PR only covers the macOS sandbox adapter.
2. The policy decision comes from FileSystemSandboxPolicy.
3. Read only subpath carveouts and metadata protection checks should
compose cleanly.

## Stack

1. Policy primitive: #19846
2. macOS Seatbelt adapter: this PR
3. Shell preflight UX: #19848
4. Runtime profile propagation: #19849
5. Linux bubblewrap adapter: #19852

## Validation

1. formatting for codex sandboxing
2. codex sandboxing package tests
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from e683055 to 74f29c7 Compare April 28, 2026 17:17
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from abc55be to 3eb844d Compare April 28, 2026 21:15
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 9fcd271 to 9ee9e1c Compare April 28, 2026 21:29
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 3eb844d to a86cfa7 Compare April 28, 2026 21:30
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 9ee9e1c to 8d29c35 Compare April 28, 2026 21:56
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from a86cfa7 to b8b87d1 Compare April 28, 2026 21:57
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 8d29c35 to 35e30b8 Compare April 28, 2026 22:00
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from b8b87d1 to 27a4413 Compare April 28, 2026 22:00
@evawong-oai evawong-oai force-pushed the codex/bugb15632-preserved-path-preflight branch from 35e30b8 to 321204f Compare April 28, 2026 22:08
@evawong-oai evawong-oai force-pushed the codex/bugb15632-runtime-permissions branch from 27a4413 to 3465cc9 Compare April 28, 2026 22:08
Oreoxp pushed a commit to Oreoxp/codex-cli that referenced this pull request May 7, 2026
## Summary

Make FileSystemSandboxPolicy the semantic source of truth for project
root metadata protection. Under writable roots, `.git`, `.codex`, and
`.agents` stay protected unless user policy grants an explicit write
rule for that metadata path.

## Scope

1. Add `protected_metadata_names` to `WritableRoot`.
2. Teach `FileSystemSandboxPolicy::can_write_path_with_cwd` to reject
protected metadata writes under writable roots unless explicitly
allowed.
3. Default workspace write profiles to protect `.git`, `.codex`, and
`.agents`.
4. Add the Linux fallback setup needed before Linux enforcement lands
later in the stack.

## Reviewer Focus

1. The policy decision belongs in FileSystemSandboxPolicy, not shell
command parsing.
2. Legacy SandboxPolicy remains a compatibility projection, not the
source of the new rule.
3. Explicit user write rules can still opt into these metadata paths.

## Stack

1. Policy primitive: this PR
2. macOS Seatbelt adapter: openai#19847
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. codex protocol permissions tests
2. formatting for codex protocol and codex linux sandbox
3. diff whitespace check
Oreoxp pushed a commit to Oreoxp/codex-cli that referenced this pull request May 7, 2026
## Summary

Translate FileSystemSandboxPolicy project root metadata carveouts into
macOS Seatbelt rules.

## Scope

1. Thread protected metadata names into Seatbelt access roots.
2. Ask FileSystemSandboxPolicy whether each metadata carveout is
writable.
3. Emit Seatbelt deny rules that block creating or replacing protected
metadata names under writable roots.
4. Add coverage for first time metadata creation and read only
carveouts.

## Reviewer Focus

1. This PR only covers the macOS sandbox adapter.
2. The policy decision comes from FileSystemSandboxPolicy.
3. Read only subpath carveouts and metadata protection checks should
compose cleanly.

## Stack

1. Policy primitive: openai#19846
2. macOS Seatbelt adapter: this PR
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. formatting for codex sandboxing
2. codex sandboxing package tests
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
## Summary

Make FileSystemSandboxPolicy the semantic source of truth for project
root metadata protection. Under writable roots, `.git`, `.codex`, and
`.agents` stay protected unless user policy grants an explicit write
rule for that metadata path.

## Scope

1. Add `protected_metadata_names` to `WritableRoot`.
2. Teach `FileSystemSandboxPolicy::can_write_path_with_cwd` to reject
protected metadata writes under writable roots unless explicitly
allowed.
3. Default workspace write profiles to protect `.git`, `.codex`, and
`.agents`.
4. Add the Linux fallback setup needed before Linux enforcement lands
later in the stack.

## Reviewer Focus

1. The policy decision belongs in FileSystemSandboxPolicy, not shell
command parsing.
2. Legacy SandboxPolicy remains a compatibility projection, not the
source of the new rule.
3. Explicit user write rules can still opt into these metadata paths.

## Stack

1. Policy primitive: this PR
2. macOS Seatbelt adapter: openai#19847
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. codex protocol permissions tests
2. formatting for codex protocol and codex linux sandbox
3. diff whitespace check
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
## Summary

Translate FileSystemSandboxPolicy project root metadata carveouts into
macOS Seatbelt rules.

## Scope

1. Thread protected metadata names into Seatbelt access roots.
2. Ask FileSystemSandboxPolicy whether each metadata carveout is
writable.
3. Emit Seatbelt deny rules that block creating or replacing protected
metadata names under writable roots.
4. Add coverage for first time metadata creation and read only
carveouts.

## Reviewer Focus

1. This PR only covers the macOS sandbox adapter.
2. The policy decision comes from FileSystemSandboxPolicy.
3. Read only subpath carveouts and metadata protection checks should
compose cleanly.

## Stack

1. Policy primitive: openai#19846
2. macOS Seatbelt adapter: this PR
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. formatting for codex sandboxing
2. codex sandboxing package tests
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
## Summary

Make FileSystemSandboxPolicy the semantic source of truth for project
root metadata protection. Under writable roots, `.git`, `.codex`, and
`.agents` stay protected unless user policy grants an explicit write
rule for that metadata path.

## Scope

1. Add `protected_metadata_names` to `WritableRoot`.
2. Teach `FileSystemSandboxPolicy::can_write_path_with_cwd` to reject
protected metadata writes under writable roots unless explicitly
allowed.
3. Default workspace write profiles to protect `.git`, `.codex`, and
`.agents`.
4. Add the Linux fallback setup needed before Linux enforcement lands
later in the stack.

## Reviewer Focus

1. The policy decision belongs in FileSystemSandboxPolicy, not shell
command parsing.
2. Legacy SandboxPolicy remains a compatibility projection, not the
source of the new rule.
3. Explicit user write rules can still opt into these metadata paths.

## Stack

1. Policy primitive: this PR
2. macOS Seatbelt adapter: openai#19847
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. codex protocol permissions tests
2. formatting for codex protocol and codex linux sandbox
3. diff whitespace check
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
## Summary

Translate FileSystemSandboxPolicy project root metadata carveouts into
macOS Seatbelt rules.

## Scope

1. Thread protected metadata names into Seatbelt access roots.
2. Ask FileSystemSandboxPolicy whether each metadata carveout is
writable.
3. Emit Seatbelt deny rules that block creating or replacing protected
metadata names under writable roots.
4. Add coverage for first time metadata creation and read only
carveouts.

## Reviewer Focus

1. This PR only covers the macOS sandbox adapter.
2. The policy decision comes from FileSystemSandboxPolicy.
3. Read only subpath carveouts and metadata protection checks should
compose cleanly.

## Stack

1. Policy primitive: openai#19846
2. macOS Seatbelt adapter: this PR
3. Shell preflight UX: openai#19848
4. Runtime profile propagation: openai#19849
5. Linux bubblewrap adapter: openai#19852

## Validation

1. formatting for codex sandboxing
2. codex sandboxing package tests
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