Skip to content

Add sandboxed exec-server filesystem helpers#16747

Open
starr-openai wants to merge 9 commits intomainfrom
fs-sandbox-rough-0403
Open

Add sandboxed exec-server filesystem helpers#16747
starr-openai wants to merge 9 commits intomainfrom
fs-sandbox-rough-0403

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

Summary

  • add optional filesystem sandbox policy plumbing to fs requests and the exec-server filesystem abstraction
  • re-invoke LocalFileSystem operations in a hidden codex-exec-server --internal-fs-op helper process when sandboxing is requested
  • add coverage for the helper-path wiring and the direct-enforcement fallback for split filesystem policies

Validation

  • remote on dev: cargo test -p codex-exec-server helper_legacy_policy_falls_back_to_external_sandbox_for_direct_runtime_enforcement
  • remote on dev: cargo test -p codex-exec-server file_system && cargo test -p codex-app-server suite::v2::fs

Copy link
Copy Markdown
Contributor

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

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: 17bb4317da

ℹ️ 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".

Comment on lines +411 to +433
WindowsSandboxLevel::Disabled,
/*has_managed_network_requirements*/ false,
);
let command = SandboxCommand {
program: helper_exe.clone().into(),
args: vec![INTERNAL_FS_OP_FLAG.to_string()],
cwd: helper_cwd.clone(),
env: HashMap::new(),
additional_permissions: None,
};
manager
.transform(SandboxTransformRequest {
command,
policy: &legacy_policy,
file_system_policy: &effective_file_system_policy,
network_policy,
sandbox,
enforce_managed_network: false,
network: None,
sandbox_policy_cwd: helper_cwd.as_path(),
codex_linux_sandbox_exe: codex_linux_sandbox_exe.as_ref(),
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
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.

P1 Badge Respect Windows sandbox policy in helper execution

prepare_helper_request hardcodes WindowsSandboxLevel::Disabled when choosing and transforming the sandbox request. On Windows this drives select_initial to SandboxType::None, so *_with_sandbox_policy executes --internal-fs-op without sandboxing even for restricted policies. That silently bypasses requested filesystem restrictions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b85bee8c: the sandboxed filesystem helper now uses RestrictedToken for helper-side sandbox selection/transform instead of hardcoding Disabled, so Windows helper execution no longer silently bypasses the requested policy.

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