Commit Graph
518 Commits
Author SHA1 Message Date
Michael Bolin 36899af488 Merge 9483c56240 into sapling-pr-archive-bolinfest 2025-04-29 19:41:50 -07:00
Michael Bolin 9483c56240 fix: remove expected dot after v in rust-v tag name 2025-04-29 19:41:38 -07:00
Michael Bolin 822b1c07f2 Merge c3c6f2ad9b into sapling-pr-archive-bolinfest 2025-04-29 19:38:32 -07:00
Michael Bolin c3c6f2ad9b fix: remove expected dot after v in rust-v tag name 2025-04-29 19:38:26 -07:00
Michael Bolin 85999d7277 chore: set Cargo workspace to version 0.0.2504291926 to create a scratch release (#741)
Needed to exercise the new release process in
https://github.com/openai/codex/pull/671.
rust-v.0.0.2504291926
2025-04-29 19:35:37 -07:00
Michael Bolin 005e431acd Merge f1e0bbf9c1 into sapling-pr-archive-bolinfest 2025-04-29 19:27:59 -07:00
Michael Bolin f1e0bbf9c1 chore: set Cargo workspace to version 0.0.2504291926 to create a scratch release 2025-04-29 19:27:51 -07:00
Michael Bolin 411bfeb410 feat: codex-linux-sandbox standalone executable (#740)
This introduces a standalone executable that run the equivalent of the
`codex debug landlock` subcommand and updates `rust-release.yml` to
include it in the release.

The idea is that we will include this small binary with the TypeScript
CLI to provide support for Linux sandboxing.
rust-v.0.0.2504291921 rust-v0.0.2504291921
2025-04-29 19:21:26 -07:00
Michael Bolin f33c3a18b9 Merge 0180a42a1f into sapling-pr-archive-bolinfest 2025-04-29 19:17:59 -07:00
Michael Bolin 0180a42a1f feat: codex-linux-sandbox standalone executable 2025-04-29 19:17:56 -07:00
Michael Bolin 45ca4de2a5 merge commit for archive created by Sapling 2025-04-29 19:15:30 -07:00
Michael Bolin 6bbce63b9e feat: codex-linux-sandbox standalone executable 2025-04-29 19:15:17 -07:00
Michael Bolin 94331d0ff6 merge commit for archive created by Sapling 2025-04-29 19:11:41 -07:00
Michael Bolin fa153bd470 feat: codex-linux-sandbox standalone executable 2025-04-29 19:11:35 -07:00
Michael Bolin 61cfd3cd11 merge commit for archive created by Sapling 2025-04-29 19:07:28 -07:00
Michael Bolin b20106cebd feat: codex-linux-sandbox standalone executable 2025-04-29 19:07:22 -07:00
Michael Bolin 8fba191a68 merge commit for archive created by Sapling 2025-04-29 19:00:28 -07:00
Michael Bolin cd58c2dd62 feat: codex-linux-sandbox standalone executable 2025-04-29 19:00:16 -07:00
Michael Bolin 462e17b313 Merge f590442903 into sapling-pr-archive-bolinfest 2025-04-29 18:51:45 -07:00
Michael Bolin f590442903 feat: codex-linux-sandbox standalone executable 2025-04-29 18:51:01 -07:00
Michael Bolin 27bc4516bf feat: bring back -s option to specify sandbox permissions (#739) 2025-04-29 18:42:52 -07:00
Michael Bolin af415a60c0 merge commit for archive created by Sapling 2025-04-29 16:59:57 -07:00
Michael Bolin e622ab400d feat: codex-linux-sandbox standalone executable 2025-04-29 16:59:48 -07:00
Michael Bolin f906dd6ee7 feat: bring back -s option to specify sandbox permissions 2025-04-29 16:48:27 -07:00
oai-ragona cb0b0259f4 [codex-rs] Add rust-release action (#671)
Taking a pass at building artifacts per platform so we can consider
different distribution strategies that don't require users to install
the full `cargo` toolchain.

Right now this grabs just the `codex-repl` and `codex-tui` bins for 5
different targets and bundles them into a draft release. I think a
clearly marked pre-release set of artifacts will unblock the next step
of testing.
2025-04-29 16:38:47 -07:00
Michael Bolin 86091a0189 merge commit for archive created by Sapling 2025-04-29 16:19:06 -07:00
Michael Bolin f5fa188cb0 feat: bring back -s option to specify sandbox permissions 2025-04-29 16:18:57 -07:00
Michael Bolin 0a00b5ed29 fix: overhaul SandboxPolicy and config loading in Rust (#732)
Previous to this PR, `SandboxPolicy` was a bit difficult to work with:


https://github.com/openai/codex/blob/237f8a11e11fdcc793a09e787e48215676d9b95b/codex-rs/core/src/protocol.rs#L98-L108

Specifically:

* It was an `enum` and therefore options were mutually exclusive as
opposed to additive.
* It defined things in terms of what the agent _could not_ do as opposed
to what they _could_ do. This made things hard to support because we
would prefer to build up a sandbox config by starting with something
extremely restrictive and only granting permissions for things the user
as explicitly allowed.

This PR changes things substantially by redefining the policy in terms
of two concepts:

* A `SandboxPermission` enum that defines permissions that can be
granted to the agent/sandbox.
* A `SandboxPolicy` that internally stores a `Vec<SandboxPermission>`,
but externally exposes a simpler API that can be used to configure
Seatbelt/Landlock.

Previous to this PR, we supported a `--sandbox` flag that effectively
mapped to an enum value in `SandboxPolicy`. Though now that
`SandboxPolicy` is a wrapper around `Vec<SandboxPermission>`, the single
`--sandbox` flag no longer makes sense. While I could have turned it
into a flag that the user can specify multiple times, I think the
current values to use with such a flag are long and potentially messy,
so for the moment, I have dropped support for `--sandbox` altogether and
we can bring it back once we have figured out the naming thing.

Since `--sandbox` is gone, users now have to specify `--full-auto` to
get a sandbox that allows writes in `cwd`. Admittedly, there is no clean
way to specify the equivalent of `--full-auto` in your `config.toml`
right now, so we will have to revisit that, as well.

Because `Config` presents a `SandboxPolicy` field and `SandboxPolicy`
changed considerably, I had to overhaul how config loading works, as
well. There are now two distinct concepts, `ConfigToml` and `Config`:

* `ConfigToml` is the deserialization of `~/.codex/config.toml`. As one
might expect, every field is `Optional` and it is `#[derive(Deserialize,
Default)]`. Consistent use of `Optional` makes it clear what the user
has specified explicitly.
* `Config` is the "normalized config" and is produced by merging
`ConfigToml` with `ConfigOverrides`. Where `ConfigToml` contains a raw
`Option<Vec<SandboxPermission>>`, `Config` presents only the final
`SandboxPolicy`.

The changes to `core/src/exec.rs` and `core/src/linux.rs` merit extra
special attention to ensure we are faithfully mapping the
`SandboxPolicy` to the Seatbelt and Landlock configs, respectively.

Also, take note that `core/src/seatbelt_readonly_policy.sbpl` has been
renamed to `codex-rs/core/src/seatbelt_base_policy.sbpl` and that
`(allow file-read*)` has been removed from the `.sbpl` file as now this
is added to the policy in `core/src/exec.rs` when
`sandbox_policy.has_full_disk_read_access()` is `true`.
2025-04-29 15:01:16 -07:00
Michael Bolin 27c086661c Merge 30c5314c54 into sapling-pr-archive-bolinfest 2025-04-29 14:32:23 -07:00
Michael Bolin 30c5314c54 feat: flip the sense of the --sandbox option 2025-04-29 14:32:19 -07:00
Michael Bolin a30b5ac59d merge commit for archive created by Sapling 2025-04-29 14:30:22 -07:00
Michael Bolin 80791a30a9 feat: flip the sense of the --sandbox option 2025-04-29 14:30:16 -07:00
Michael Bolin 197df59717 merge commit for archive created by Sapling 2025-04-29 14:24:18 -07:00
Michael Bolin 32991d2fcc feat: flip the sense of the --sandbox option 2025-04-29 14:24:12 -07:00
Michael Bolin 298685f856 Merge e1a15b13a9 into sapling-pr-archive-bolinfest 2025-04-29 14:01:52 -07:00
Michael Bolin e1a15b13a9 feat: flip the sense of the --sandbox option 2025-04-29 14:01:48 -07:00
Michael Bolin 8f88c54917 merge commit for archive created by Sapling 2025-04-29 13:57:59 -07:00
Michael Bolin 4c2abb2ed5 feat: flip the sense of the --sandbox option 2025-04-29 13:57:54 -07:00
Michael Bolin ad5e9e6899 merge commit for archive created by Sapling 2025-04-29 13:55:09 -07:00
Michael Bolin 1d198677c8 feat: flip the sense of the --sandbox option 2025-04-29 13:55:04 -07:00
Michael Bolin 33d0a8cf47 merge commit for archive created by Sapling 2025-04-29 13:52:51 -07:00
Michael Bolin f63e2bb776 feat: flip the sense of the --sandbox option 2025-04-29 13:52:44 -07:00
Michael Bolin a0e99e0866 merge commit for archive created by Sapling 2025-04-29 13:31:37 -07:00
Michael Bolin a1bac7afab feat: flip the sense of the --sandbox option 2025-04-29 13:31:31 -07:00
Michael Bolin dd75f98f18 merge commit for archive created by Sapling 2025-04-29 13:24:25 -07:00
Michael Bolin 32eb5e14e1 feat: flip the sense of the --sandbox option 2025-04-29 13:24:20 -07:00
Michael Bolin cd82749ec9 merge commit for archive created by Sapling 2025-04-29 13:21:17 -07:00
Michael Bolin f4e037db0a feat: flip the sense of the --sandbox option 2025-04-29 13:21:10 -07:00
Michael Bolin 9383f1c6fc merge commit for archive created by Sapling 2025-04-29 13:13:28 -07:00
Michael Bolin e92caeafac feat: flip the sense of the --sandbox option 2025-04-29 13:13:19 -07:00