Commit Graph

12249 Commits

Author SHA1 Message Date
Michael Bolin
ff8f1e1501 Merge 72f2c066a6 into sapling-pr-archive-bolinfest 2026-04-21 13:51:18 -07:00
Michael Bolin
72f2c066a6 tests: isolate approval fixtures from host rules 2026-04-21 13:50:53 -07:00
Michael Bolin
b6eb7a90e7 shell-escalation: carry resolved permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
5b901a30e5 mcp: include permission profiles in sandbox state 2026-04-21 13:50:53 -07:00
Michael Bolin
d85b460dda tui: carry permission profiles on user turns 2026-04-21 13:50:53 -07:00
Michael Bolin
b75d3a2a9a tui: sync session permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
d8e33e24d2 app-server: accept command permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
9cef7da96d protocol: report session permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
7863d68212 rollout: persist turn permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
648b4ac09b clients: send permission profiles to app-server 2026-04-21 13:50:53 -07:00
Michael Bolin
620e44c617 app-server: accept permission profile overrides 2026-04-21 13:50:53 -07:00
Michael Bolin
d81c8233f3 app-server: expose thread permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
6846eefa9f core: derive active permission profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
5974af73f6 exec-server: carry filesystem sandbox profiles 2026-04-21 13:50:53 -07:00
Michael Bolin
22370ddb80 sandboxing: materialize cwd-relative permission globs 2026-04-21 13:50:53 -07:00
iceweasel-oai
6f6997758a skip busted tests while I fix them (#18885) 2026-04-21 13:40:34 -07:00
Ruslan Nigmatullin
56375712e3 app-server: fix Bazel clippy in tracing tests (#18872)
## Why

PR #18431 exposed a Bazel clippy failure in the app-server unit-test
target across Linux, macOS, and Windows. The failing lint was
`clippy::await_holding_invalid_type`: two tracing tests serialized
access to global tracing state by holding a `tokio::sync::MutexGuard`
across awaited test work.

That serialization is still needed because the tests share
process-global tracing setup and exporter state, but it should not
require holding an async mutex guard through the whole test body.

## What changed

- Replaced the bespoke async `tracing_test_guard` helper with
`serial_test` on the two tracing tests that need global tracing
serialization.
- Removed the `#[expect(clippy::await_holding_invalid_type)]`
annotations and the lock guard callsites that Bazel clippy rejected.

## Validation

- `cargo test -p codex-app-server jsonrpc_span`
- `just fix -p codex-app-server`
- `git diff --check`

I also attempted the exact failing Bazel clippy target locally with
BuildBuddy disabled: `bazel --noexperimental_remote_repo_contents_cache
build --config=clippy --bes_backend= --remote_cache=
--experimental_remote_downloader= --
//codex-rs/app-server:app-server-unit-tests-bin`. That run did not reach
clippy because Bazel timed out downloading `libcap-2.27.tar.gz` from
`kernel.org`.
2026-04-21 13:10:36 -07:00
Michael Bolin
4a2bbe60c5 Merge f0cadb0270 into sapling-pr-archive-bolinfest 2026-04-21 11:05:02 -07:00
Michael Bolin
f0cadb0270 sandboxing: materialize cwd-relative permission globs 2026-04-21 11:00:58 -07:00
Ruslan Nigmatullin
5bab04dcd7 app-server: add codex-device-key crate (#18429)
## Why

Device-key storage and signing are local security-sensitive operations
with platform-specific behavior. Keeping the core API in
`codex-device-key` keeps app-server focused on routing and business
logic instead of owning key-management details.

The crate keeps the signing surface intentionally narrow: callers can
create a bound key, fetch its public key, or sign one of the structured
payloads accepted by the crate. It does not expose a generic
arbitrary-byte signing API.

Key IDs cross into platform-specific labels, tags, and metadata paths,
so externally supplied IDs are constrained to the same auditable
namespace created by the crate: `dk_` followed by unpadded base64url for
32 bytes. Remote-control target paths are also tied to each signed
payload shape so connection proofs cannot be reused for enrollment
endpoints, or vice versa.

## What changed

- Added the `codex-device-key` workspace crate.
- Added account/client-bound key creation with stable `dk_` key IDs.
- Added strict `key_id` validation before public-key lookup or signing
reaches a provider.
- Added public-key lookup and structured signing APIs.
- Split remote-control client endpoint allowlists by connection vs
enrollment payload shape.
- Added validation for key bindings, accepted payload fields, token
expiration, and payload/key binding mismatches.
- Added flow-oriented docs on the validation helpers that gate provider
signing.
- Added protection policy and protection-class types without wiring a
platform provider yet.
- Added an unsupported default provider so platforms without an
implementation fail explicitly instead of silently falling back to
software-backed keys.
- Updated Cargo and Bazel lock metadata for the new crate and
non-platform-specific dependencies.

## Stack

This is stacked on #18428.

## Validation

- `cargo test -p codex-device-key`
- Added unit coverage for strict `key_id` validation before provider
use.
- Added unit coverage that rejects remote-control paths from the wrong
signed payload shape.
- `just bazel-lock-update`
- `just bazel-lock-check`
2026-04-21 17:57:00 +00:00
iceweasel-oai
8612714aa6 Add Windows sandbox unified exec runtime support (#15578)
## Summary

This is the runtime/foundation half of the Windows sandbox unified-exec
work.

- add Windows sandbox `unified_exec` session support in
`windows-sandbox-rs` for both:
  - the legacy restricted-token backend
  - the elevated runner backend
- extend the PTY/process runtime so driver-backed sessions can support:
  - stdin streaming
  - stdout/stderr separation
  - exit propagation
  - PTY resize hooks
- add Windows sandbox runtime coverage in `codex-windows-sandbox` /
`codex-utils-pty`

This PR does **not** enable Windows sandbox `UnifiedExec` for product
callers yet because hooking this up to app-server comes in the next PR.

Windows sandbox advertising is intentionally kept aligned with `main`,
so sandboxed Windows callers still fall back to `ShellCommand`.

This PR isolates the runtime/session layer so it can be reviewed
independently from product-surface enablement.

---------

Co-authored-by: jif-oai <jif@openai.com>
Co-authored-by: Codex <noreply@openai.com>
2026-04-21 10:44:49 -07:00
Michael Bolin
c38d67a009 Merge d26056285f into sapling-pr-archive-bolinfest 2026-04-21 10:44:13 -07:00
Michael Bolin
d26056285f tests: isolate approval fixtures from host rules 2026-04-21 10:40:32 -07:00
Michael Bolin
bd8f2f9861 shell-escalation: carry resolved permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
ac87f8dc91 mcp: include permission profiles in sandbox state 2026-04-21 10:40:32 -07:00
Michael Bolin
9ed50c0e71 tui: carry permission profiles on user turns 2026-04-21 10:40:32 -07:00
Michael Bolin
93441b62fd tui: sync session permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
98f3ab68e7 app-server: accept command permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
24a8186010 protocol: report session permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
fd63861883 rollout: persist turn permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
447123caa8 clients: send permission profiles to app-server 2026-04-21 10:40:32 -07:00
Michael Bolin
a8aa1b2bf3 app-server: accept permission profile overrides 2026-04-21 10:40:32 -07:00
Michael Bolin
c503582661 app-server: expose thread permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
8a10b7dd51 core: derive active permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
cacb5de94e exec-server: carry filesystem sandbox profiles 2026-04-21 10:40:32 -07:00
Michael Bolin
9f863363a1 sandboxing: materialize cwd-relative permission globs 2026-04-21 10:40:25 -07:00
Michael Bolin
54a57a0de6 Merge 1aae3d3b02 into sapling-pr-archive-bolinfest 2026-04-21 10:27:23 -07:00
Michael Bolin
1aae3d3b02 tests: isolate approval fixtures from host rules 2026-04-21 10:26:15 -07:00
Michael Bolin
0d5510c549 shell-escalation: carry resolved permission profiles 2026-04-21 10:25:04 -07:00
Michael Bolin
e8c3569a3c mcp: include permission profiles in sandbox state 2026-04-21 10:25:04 -07:00
Michael Bolin
255490b98d tui: carry permission profiles on user turns 2026-04-21 10:25:04 -07:00
Michael Bolin
8d1ce90d59 tui: sync session permission profiles 2026-04-21 10:25:03 -07:00
Michael Bolin
02b498e158 app-server: accept command permission profiles 2026-04-21 10:25:03 -07:00
Michael Bolin
fa4dc621f7 protocol: report session permission profiles 2026-04-21 10:25:02 -07:00
Steve Coffey
38ba876ea9 Refresh generated Python app-server SDK types (#18862)
This is the first step in splitting the Python SDK PyPI publish work
into reviewable layers: land the generated SDK refresh by itself before
changing packaging mechanics. The next PRs will make the runtime wheel
publishable, then wire the SDK package/version pinning to that runtime.

## Summary
- Refresh generated Python app-server v2 models and notification
registry from the current schema.
- Update the public API signature expectations for the newly generated
kwargs.

## Stack
- PR 1 of 3 for the Python SDK PyPI publishing split.
- Follow-up PRs will handle runtime wheel publishing mechanics, then
SDK/package version pinning.

## Tests
- `uv run --extra dev pytest` in `sdk/python` -> 51 passed, 37 skipped.
2026-04-21 10:23:27 -07:00
Michael Bolin
ff27339587 rollout: persist turn permission profiles 2026-04-21 10:23:20 -07:00
Michael Bolin
4ddcab277b clients: send permission profiles to app-server 2026-04-21 10:23:20 -07:00
Michael Bolin
c89723329e app-server: accept permission profile overrides 2026-04-21 10:23:20 -07:00
Michael Bolin
6c59e78192 app-server: expose thread permission profiles 2026-04-21 10:23:20 -07:00
Michael Bolin
2089eb5d64 core: derive active permission profiles 2026-04-21 10:23:20 -07:00