Commit Graph

1794 Commits

Author SHA1 Message Date
Michael Bolin
3bcda29a24 Merge d8765eecc8 into sapling-pr-archive-bolinfest 2025-06-25 12:27:41 -07:00
Michael Bolin
d8765eecc8 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:26:22 -07:00
Michael Bolin
72082164c1 chore: rename AskForApproval::UnlessAllowListed to AskForApproval::UnlessTrusted (#1385)
We could just rename to `Untrusted` instead of `UnlessTrusted`, but I
think `AskForApproval::UnlessTrusted` reads a bit better.
2025-06-25 12:26:13 -07:00
Michael Bolin
61806fc5f5 Merge a66f27bc9d into sapling-pr-archive-bolinfest 2025-06-25 12:09:47 -07:00
Michael Bolin
a66f27bc9d feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:09:36 -07:00
Michael Bolin
0235df863a chore: rename AskForApproval::UnlessAllowListed to AskForApproval::UnlessTrusted 2025-06-25 12:09:27 -07:00
Michael Bolin
c640e59dcd merge commit for archive created by Sapling 2025-06-25 12:07:16 -07:00
Michael Bolin
24e051c466 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:07:09 -07:00
Michael Bolin
2c621b3860 merge commit for archive created by Sapling 2025-06-25 11:33:43 -07:00
Michael Bolin
552b404626 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:33:37 -07:00
Michael Bolin
4610c998a1 Merge 1b1611b891 into sapling-pr-archive-bolinfest 2025-06-25 11:32:16 -07:00
Michael Bolin
1b1611b891 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:32:11 -07:00
Michael Bolin
66c6ad7801 Merge 1420d2458c into sapling-pr-archive-bolinfest 2025-06-25 11:21:37 -07:00
Michael Bolin
1420d2458c feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:21:09 -07:00
Michael Bolin
e09691337d chore: improve docstring for --full-auto (#1379)
Reference `-c sandbox.mode=workspace-write` in the docstring and users
can read the config docs for `sandbox` for more information.
2025-06-25 09:13:36 -07:00
Michael Bolin
887a7467f6 Merge 9e144a71d0 into sapling-pr-archive-bolinfest 2025-06-24 22:19:32 -07:00
Michael Bolin
9e144a71d0 chore: improve docstring for --full-auto 2025-06-24 22:19:26 -07:00
Michael Bolin
86d5a9d80d chore: rename unless-allow-listed to untrusted (#1378)
For the `approval_policy` config option, renames `unless-allow-listed`
to `untrusted`. In general, when it comes to exec'ing commands, I think
"trusted" is a more accurate term than "safe."

Also drops the `AskForApproval::AutoEdit` variant, as we were not really
making use of it, anyway.

Fixes https://github.com/openai/codex/issues/1250.


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1378).
* #1379
* __->__ #1378
2025-06-24 22:19:21 -07:00
Michael Bolin
c6e562aedd merge commit for archive created by Sapling 2025-06-24 22:15:59 -07:00
Michael Bolin
63af91e70d chore: improve docstring for --full-auto 2025-06-24 22:15:47 -07:00
Michael Bolin
4c8514a636 chore: rename unless-allow-listed to untrusted 2025-06-24 22:15:47 -07:00
Michael Bolin
8cd306f8d8 Merge 989afe9e7a into sapling-pr-archive-bolinfest 2025-06-24 22:11:10 -07:00
Michael Bolin
989afe9e7a chore: improve docstring for --full-auto 2025-06-24 22:11:03 -07:00
Michael Bolin
53a97c4b00 chore: rename unless-allow-listed to untrusted 2025-06-24 22:11:03 -07:00
Michael Bolin
b6b2205936 Merge 3734c29859 into sapling-pr-archive-bolinfest 2025-06-24 22:09:22 -07:00
Michael Bolin
3734c29859 chore: improve docstring for --full-auto 2025-06-24 22:09:06 -07:00
Michael Bolin
3d672c2262 merge commit for archive created by Sapling 2025-06-24 22:05:59 -07:00
Michael Bolin
b66373f946 chore: rename unless-allow-listed to untrusted 2025-06-24 22:05:53 -07:00
Michael Bolin
0eff0d93a7 Merge 17fad32de2 into sapling-pr-archive-bolinfest 2025-06-24 22:05:07 -07:00
Michael Bolin
17fad32de2 chore: rename unless-allow-listed to untrusted 2025-06-24 22:04:59 -07:00
Michael Bolin
531ce7626f fix: pretty-print the sandbox config in the TUI/exec modes (#1376)
Now that https://github.com/openai/codex/pull/1373 simplified the
sandbox config, we can print something much simpler in the TUI (and in
`codex exec`) to summarize the sandbox config.

Before:

![Screenshot 2025-06-24 at 5 45
52 PM](https://github.com/user-attachments/assets/b7633efb-a619-43e1-9abe-7bb0be2d0ec0)

With this change:

![Screenshot 2025-06-24 at 5 46
44 PM](https://github.com/user-attachments/assets/8d099bdd-a429-4796-a08d-70931d984e4f)

For reference, my `config.toml` contains:

```
[sandbox]
mode = "workspace-write"
writable_roots = ["/tmp", "/Users/mbolin/.pyenv/shims"]
```

Fixes https://github.com/openai/codex/issues/1248
2025-06-24 17:48:51 -07:00
Michael Bolin
073ff4110c Merge 26f93c320b into sapling-pr-archive-bolinfest 2025-06-24 17:44:11 -07:00
Michael Bolin
26f93c320b fix: pretty-print the sandbox config in the TUI/exec modes 2025-06-24 17:44:04 -07:00
Michael Bolin
63363a54e5 chore: install just in the devcontainer for Linux development (#1375)
Apparently `just` was added to `apt` in Ubuntu 24, so this required
updating the Ubuntu version in the `Dockerfile` to make it so we could
simply `apt install just`.

Though then that caused a conflict with the custom `dev` user we were
using, though the end result seems simpler since now we just use the
default `ubuntu` user provided by Ubuntu 24.
2025-06-24 17:20:53 -07:00
Michael Bolin
e417a49932 Merge 05c8800062 into sapling-pr-archive-bolinfest 2025-06-24 17:16:44 -07:00
Michael Bolin
05c8800062 chore: install just in the devcontainer for Linux development 2025-06-24 17:16:31 -07:00
Michael Bolin
6d65010aad chore: install clippy and rustfmt in the devcontainer for Linux development (#1374)
I discovered it was difficult to do development in the devcontainer
without these tools available.
2025-06-24 17:05:36 -07:00
Michael Bolin
10b61396d3 Merge 90079447da into sapling-pr-archive-bolinfest 2025-06-24 17:02:47 -07:00
Michael Bolin
90079447da chore: install clippy and rustfmt in the devcontainer for Linux development 2025-06-24 17:02:41 -07:00
Michael Bolin
0776d78357 feat: redesign sandbox config (#1373)
This is a major redesign of how sandbox configuration works and aims to
fix https://github.com/openai/codex/issues/1248. Specifically, it
replaces `sandbox_permissions` in `config.toml` (and the
`-s`/`--sandbox-permission` CLI flags) with a "table" with effectively
three variants:

```toml
# Safest option: full disk is read-only, but writes and network access are disallowed.
[sandbox]
mode = "read-only"

# The cwd of the Codex task is writable, as well as $TMPDIR on macOS.
# writable_roots can be used to specify additional writable folders.
[sandbox]
mode = "workspace-write"
writable_roots = []  # Optional, defaults to the empty list.
network_access = false  # Optional, defaults to false.

# Disable sandboxing: use at your own risk!!!
[sandbox]
mode = "danger-full-access"
```

This should make sandboxing easier to reason about. While we have
dropped support for `-s`, the way it works now is:

- no flags => `read-only`
- `--full-auto` => `workspace-write`
- currently, there is no way to specify `danger-full-access` via a CLI
flag, but we will revisit that as part of
https://github.com/openai/codex/issues/1254

Outstanding issue:

- As noted in the `TODO` on `SandboxPolicy::is_unrestricted()`, we are
still conflating sandbox preferences with approval preferences in that
case, which needs to be cleaned up.
2025-06-24 16:59:47 -07:00
Michael Bolin
725bfd5ca7 merge commit for archive created by Sapling 2025-06-24 16:46:51 -07:00
Michael Bolin
364706bddc feat: redesign sandbox config 2025-06-24 16:46:21 -07:00
Michael Bolin
1f95562c13 merge commit for archive created by Sapling 2025-06-24 16:38:48 -07:00
Michael Bolin
c660ec6852 feat: redesign sandbox config 2025-06-24 16:38:41 -07:00
Michael Bolin
73ae461b80 merge commit for archive created by Sapling 2025-06-24 16:22:56 -07:00
Michael Bolin
d81914669b feat: redesign sandbox config 2025-06-24 16:22:49 -07:00
Michael Bolin
66eba709a7 merge commit for archive created by Sapling 2025-06-24 15:20:35 -07:00
Michael Bolin
21b846bd87 feat: redesign sandbox config 2025-06-24 15:20:28 -07:00
Michael Bolin
afd2768d56 Merge 0d6f705d51 into sapling-pr-archive-bolinfest 2025-06-24 14:52:51 -07:00
Michael Bolin
0d6f705d51 feat: redesign sandbox config 2025-06-24 14:08:43 -07:00