mirror of
https://github.com/openai/codex.git
synced 2026-11-09 20:50:33 +00:00
feat: allow limited git writes in workspace sandbox
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
d6748f741a
commit
8980fd17ee
@@ -772,6 +772,7 @@ impl ConfigToml {
|
||||
Some(SandboxWorkspaceWrite {
|
||||
writable_roots,
|
||||
network_access,
|
||||
allow_limited_git_writes,
|
||||
exclude_tmpdir_env_var,
|
||||
exclude_slash_tmp,
|
||||
}) => {
|
||||
@@ -780,11 +781,12 @@ impl ConfigToml {
|
||||
} else {
|
||||
NetworkSandboxPolicy::Restricted
|
||||
};
|
||||
PermissionProfile::workspace_write_with(
|
||||
PermissionProfile::workspace_write_with_limited_git_writes(
|
||||
writable_roots,
|
||||
network_policy,
|
||||
*exclude_tmpdir_env_var,
|
||||
*exclude_slash_tmp,
|
||||
*allow_limited_git_writes,
|
||||
)
|
||||
}
|
||||
None => PermissionProfile::workspace_write(),
|
||||
|
||||
@@ -883,6 +883,8 @@ pub struct SandboxWorkspaceWrite {
|
||||
#[serde(default)]
|
||||
pub network_access: bool,
|
||||
#[serde(default)]
|
||||
pub allow_limited_git_writes: bool,
|
||||
#[serde(default)]
|
||||
pub exclude_tmpdir_env_var: bool,
|
||||
#[serde(default)]
|
||||
pub exclude_slash_tmp: bool,
|
||||
@@ -893,6 +895,7 @@ impl From<SandboxWorkspaceWrite> for codex_app_server_protocol::SandboxSettings
|
||||
Self {
|
||||
writable_roots: sandbox_workspace_write.writable_roots,
|
||||
network_access: Some(sandbox_workspace_write.network_access),
|
||||
allow_limited_git_writes: Some(sandbox_workspace_write.allow_limited_git_writes),
|
||||
exclude_tmpdir_env_var: Some(sandbox_workspace_write.exclude_tmpdir_env_var),
|
||||
exclude_slash_tmp: Some(sandbox_workspace_write.exclude_slash_tmp),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user