Skip to content

feat(core) Introduce Feature::RequestPermissions#11871

Merged
dylan-hurd-oai merged 17 commits intomainfrom
dh--request-permission-1
Feb 24, 2026
Merged

feat(core) Introduce Feature::RequestPermissions#11871
dylan-hurd-oai merged 17 commits intomainfrom
dh--request-permission-1

Conversation

@dylan-hurd-oai
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai commented Feb 15, 2026

Summary

Introduces the initial implementation of Feature::RequestPermissions. RequestPermissions allows the model to request that a command be run inside the sandbox, with additional permissions, like writing to a specific folder. Eventually this will include other rules as well, and the ability to persist these permissions, but this PR is already quite large - let's get the core flow working and go from there!

Screenshot 2026-02-15 at 2 26 22 PM

Testing

  • Added tests
  • Tested locally
  • Feature

@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--rm-feature-request-rule branch from cf57554 to 686a4ba Compare February 16, 2026 18:48
Base automatically changed from dh--rm-feature-request-rule to main February 16, 2026 22:30
@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--request-permission-1 branch from b01add8 to 61850cc Compare February 18, 2026 08:26
@dylan-hurd-oai dylan-hurd-oai marked this pull request as ready for review February 19, 2026 02:44
@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--request-permission-1 branch from 129cf27 to ea396ea Compare February 19, 2026 02:47
),
network_approval_context: None,
proposed_execpolicy_amendment: None,
additional_permissions: None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should network_approval_context and additional_permissions be somehow merged?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Soon! I think both are still actively being worked on - I'd like to merge once we've stabilized the APIs


When you need extra filesystem access for one command, use:

- `sandbox_permissions: "with_additional_permissions"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need to make the model set sandbox_permissions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Technically no, but I think this is helpful for consistency with require_escalated

@pakrym-oai
Copy link
Copy Markdown
Collaborator

I think this PR needs a ton more integration tests that both verify that additional permissions work, error responses an that things are escalated/not escalated accordingly.

access: merge_read_only_access_with_additional_reads(access, extra_reads),
}
} else {
SandboxPolicy::WorkspaceWrite {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think here there is a small bug. ReadOnly basically means the user does not want the model to write anywhere (cwd included).

In this specific case, the model ask to be able to write in one specific directory (from extra_writes). But if we check how WorkspaceWrite is used, we see in get_writable_roots_with_cwd that by default it gives access to writable_root=extra_writes AND the cwd (and /tmp btw).

This means this permission request implicitly give access to the full CWD

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should have added a comment here - I agree that this doesn't map perfectly. We could add a new SandboxPolicy::SpecificWrite which doesn't include the cwd

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've opened #12504 as an example of how we might support fine-grained controls here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SG, must be a blocker to release the feature

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

100% agreed!

@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--request-permission-1 branch from fb60743 to 8bb9995 Compare February 24, 2026 07:42
@jif-oai
Copy link
Copy Markdown
Collaborator

jif-oai commented Feb 24, 2026

@codex review

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: 8bb9995c2c

ℹ️ 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 +250 to +258
SandboxPolicy::WorkspaceWrite {
writable_roots: dedup_absolute_paths(extra_writes),
read_only_access: merge_read_only_access_with_additional_reads(
access,
extra_reads,
),
network_access: false,
exclude_tmpdir_env_var: false,
exclude_slash_tmp: false,
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 Preserve read-only sandbox when granting extra write paths

Do not upgrade ReadOnly to WorkspaceWrite for fs_write grants. This branch widens access beyond requested paths by enabling workspace-write defaults (exclude_tmpdir_env_var: false, exclude_slash_tmp: false), so approved commands can write to unrequested locations (e.g., cwd/tmp). That breaks least-privilege and can expose unintended file modification paths.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As discussed

Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

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

Not ready to land because of the read escalation thing but good to iterate on

);
}

if uses_additional_permissions {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess this is intended that if we are in full access, the request is basically ignored?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the intention here is to remain similar to OnRequest behavior!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This code might be overly defensive, since it's already handled here. will think about how to clean up as we iterate on this feature

Comment on lines +250 to +258
SandboxPolicy::WorkspaceWrite {
writable_roots: dedup_absolute_paths(extra_writes),
read_only_access: merge_read_only_access_with_additional_reads(
access,
extra_reads,
),
network_access: false,
exclude_tmpdir_env_var: false,
exclude_slash_tmp: false,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As discussed

@dylan-hurd-oai dylan-hurd-oai merged commit f6053fd into main Feb 24, 2026
73 of 77 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the dh--request-permission-1 branch February 24, 2026 17:49
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants