Commit Graph
12572 Commits
Author SHA1 Message Date
Michael Bolin 3f4fe759fd merge commit for archive created by Sapling 2026-04-22 15:21:07 -07:00
Michael Bolin f8dec04ab8 tests: isolate approval fixtures from host rules 2026-04-22 15:20:46 -07:00
Michael Bolin b8b04f2df2 shell-escalation: carry resolved permission profiles 2026-04-22 15:20:46 -07:00
Michael Bolin a1a28dd8f9 mcp: include permission profiles in sandbox state 2026-04-22 15:20:46 -07:00
Michael Bolin b9ea5751b1 tui: carry permission profiles on user turns 2026-04-22 15:20:46 -07:00
Michael Bolin b9ff80b631 tui: sync session permission profiles 2026-04-22 15:20:38 -07:00
Michael Bolin f8168fb526 app-server: accept command permission profiles 2026-04-22 15:20:38 -07:00
Michael Bolin aec03f26d2 protocol: report session permission profiles 2026-04-22 15:20:38 -07:00
Michael Bolin f501b9ad99 rollout: persist turn permission profiles 2026-04-22 15:20:38 -07:00
Michael Bolin add328d677 clients: send permission profiles to app-server 2026-04-22 15:20:37 -07:00
Michael Bolin 0e199dd9ae exec-server: require explicit filesystem sandbox cwd 2026-04-22 15:20:37 -07:00
Michael Bolin 3b439e1f5f merge commit for archive created by Sapling 2026-04-22 15:08:10 -07:00
Michael Bolin d3d911ca2e tests: isolate approval fixtures from host rules 2026-04-22 15:06:21 -07:00
Michael Bolin 8fce002112 shell-escalation: carry resolved permission profiles 2026-04-22 15:06:20 -07:00
Michael Bolin 26aafff003 mcp: include permission profiles in sandbox state 2026-04-22 15:06:20 -07:00
Michael Bolin b9d98d0aa3 tui: carry permission profiles on user turns 2026-04-22 15:06:20 -07:00
Michael Bolin fa29623cc7 tui: sync session permission profiles 2026-04-22 15:04:58 -07:00
Michael Bolin 579eb371d4 app-server: accept command permission profiles 2026-04-22 15:04:58 -07:00
Michael Bolin 543972c703 protocol: report session permission profiles 2026-04-22 15:04:58 -07:00
Michael Bolin f372e24c08 rollout: persist turn permission profiles 2026-04-22 15:04:58 -07:00
Michael Bolin 6665c299e6 clients: send permission profiles to app-server 2026-04-22 15:04:58 -07:00
Michael Bolin 6f5539bae8 exec-server: require explicit filesystem sandbox cwd 2026-04-22 15:00:13 -07:00
Michael Bolin e0b423c1c7 merge commit for archive created by Sapling 2026-04-22 14:49:30 -07:00
Michael Bolin d9211b8740 tests: isolate approval fixtures from host rules 2026-04-22 14:46:53 -07:00
Michael Bolin f677a22f3e shell-escalation: carry resolved permission profiles 2026-04-22 14:46:53 -07:00
Michael Bolin 92d040d850 mcp: include permission profiles in sandbox state 2026-04-22 14:46:53 -07:00
Michael Bolin ed509deaf5 tui: carry permission profiles on user turns 2026-04-22 14:46:53 -07:00
Michael Bolin 50fffd01d2 tui: sync session permission profiles 2026-04-22 14:46:53 -07:00
Michael Bolin 4cbff80b72 app-server: accept command permission profiles 2026-04-22 14:46:53 -07:00
Michael Bolin 33269edfdc protocol: report session permission profiles 2026-04-22 14:46:53 -07:00
Michael Bolin 582316c408 rollout: persist turn permission profiles 2026-04-22 14:42:26 -07:00
Michael Bolin 5b9c978857 clients: send permission profiles to app-server 2026-04-22 14:42:26 -07:00
Michael Bolin d3dd0d759b exec-server: expose arg0 alias root to fs sandbox (#19016)
## Why

The post-merge `rust-ci-full` run for #18999 still failed the Ubuntu
remote `suite::remote_env` sandboxed filesystem tests. That run checked
out merge commit `ddde50c611e4800cb805f243ed3c50bbafe7d011`, so the arg0
guard lifetime fix was present.

The Docker-backed failure had two remaining pieces:

- The sandboxed filesystem helper needs to execute Codex through the
`codex-linux-sandbox` arg0 alias path. The helper sandbox was only
granting read access to the real Codex executable parent, so the alias
parent also has to be visible inside the helper sandbox.
- The remote-env tests were building sandbox contexts with
`FileSystemSandboxContext::new()`, which captures the local test runner
cwd. In the Docker remote exec-server, that host checkout path does not
exist, so spawning the filesystem helper failed with `No such file or
directory` before the helper could process the request.

## What Changed

- Track all helper runtime read roots instead of a single root.
- Add both the real Codex executable parent and the
`codex-linux-sandbox` alias parent to sandbox readable roots.
- Avoid sending an unused local cwd in remote filesystem sandbox
contexts when the permission profile has no cwd-dependent entries.
- Build the Docker remote-env test sandbox contexts with a cwd path that
exists inside the container.
- Add unit coverage for the alias-parent root and remote sandbox cwd
handling.

## Verification

- `cargo test -p codex-exec-server`
- `cargo test -p codex-core
remote_test_env_sandboxed_read_allows_readable_root`
- `just fix -p codex-exec-server`
- `just fix -p codex-core`
2026-04-22 21:34:22 +00:00
Leo Shimonaka 16eeeb534a Fix MCP permission policy sync (#19033)
###### Why/Context/Summary

Repro: start a session outside Full Access, switch permissions to Full
Access, then submit a new turn that triggers MCP/CUA permission
handling.

The turn used the live Full Access `SessionConfiguration`, but the MCP
coordinator was still synced from the stale `original_config_do_not_use`
/ per-turn config copy. That left the coordinator with an old sandbox
policy, so empty MCP permission elicitations could be denied instead of
auto-accepted.

Fix: update/rebuild the MCP connection manager from the live
turn/session approval and sandbox policy fields.

###### Test plan

```sh
just fmt
cargo test -p codex-core --lib
cargo test -p codex-core --lib mcp_tool_call::tests
```
2026-04-22 14:30:29 -07:00
Michael Bolin 60d260dd5a merge commit for archive created by Sapling 2026-04-22 14:23:14 -07:00
Michael Bolin 013c20f225 tests: isolate approval fixtures from host rules 2026-04-22 14:19:53 -07:00
Michael Bolin 5de9a66ad8 shell-escalation: carry resolved permission profiles 2026-04-22 14:19:53 -07:00
Michael Bolin a11ace780b mcp: include permission profiles in sandbox state 2026-04-22 14:19:53 -07:00
Michael Bolin 903074ab6e tui: carry permission profiles on user turns 2026-04-22 14:19:53 -07:00
Michael Bolin 47f27ce39f tui: sync session permission profiles 2026-04-22 14:19:53 -07:00
Michael Bolin e4813bacf5 app-server: accept command permission profiles 2026-04-22 14:19:53 -07:00
Michael Bolin 94ec85723c protocol: report session permission profiles 2026-04-22 14:19:53 -07:00
Michael Bolin de2c507ce2 rollout: persist turn permission profiles 2026-04-22 14:19:53 -07:00
Michael Bolin 754533a4e9 clients: send permission profiles to app-server 2026-04-22 14:19:53 -07:00
Michael Bolin 3805c01cf5 Merge a96e08da33 into sapling-pr-archive-bolinfest 2026-04-22 14:06:45 -07:00
Michael Bolin a96e08da33 exec-server: expose arg0 alias root to fs sandbox
## Why

The post-merge `rust-ci-full` run for #18999 still failed the Ubuntu remote `suite::remote_env` sandboxed filesystem tests. That run checked out merge commit `ddde50c611e4800cb805f243ed3c50bbafe7d011`, so the arg0 guard lifetime fix was present.

The remaining gap is that the remote exec-server can pass an arg0 alias path such as `codex-linux-sandbox` as a runtime helper, but the sandboxed filesystem helper only added the real Codex binary parent as a readable runtime root. When bubblewrap re-enters Codex through the alias path, the alias directory also has to be visible inside the sandbox.

## What Changed

- Track all helper runtime read roots instead of a single root.
- Add both the real Codex executable parent and the `codex-linux-sandbox` alias parent to sandbox readable roots.
- Add unit coverage for the alias-parent root.

## Verification

- `cargo test -p codex-exec-server`
- `just argument-comment-lint -p codex-exec-server`
- `just fix -p codex-exec-server`
2026-04-22 14:06:37 -07:00
Michael Bolin a04b169249 Merge eeba65cbee into sapling-pr-archive-bolinfest 2026-04-22 14:01:21 -07:00
Michael Bolin eeba65cbee exec-server: expose arg0 alias root to fs sandbox
## Why

The post-merge `rust-ci-full` run for #18999 still failed the Ubuntu remote `suite::remote_env` sandboxed filesystem tests. That run checked out merge commit `ddde50c611e4800cb805f243ed3c50bbafe7d011`, so the arg0 guard lifetime fix was present.

The remaining gap is that the remote exec-server can pass an arg0 alias path such as `codex-linux-sandbox` as a runtime helper, but the sandboxed filesystem helper only added the real Codex binary parent as a readable runtime root. When bubblewrap re-enters Codex through the alias path, the alias directory also has to be visible inside the sandbox.

## What Changed

- Track all helper runtime read roots instead of a single root.
- Add both the real Codex executable parent and the `codex-linux-sandbox` alias parent to sandbox readable roots.
- Add unit coverage for the alias-parent root.

## Verification

- `cargo test -p codex-exec-server`
- `just argument-comment-lint -p codex-exec-server`
- `just fix -p codex-exec-server`
2026-04-22 14:01:14 -07:00
viyatb-oaiandCodex 2d73bac45f feat: add guardian network approval trigger context (#18197)
## Summary

Give guardian network-access reviews the command context that triggered
a managed-network approval. The prompt JSON now includes the originating
tool call id, tool name, command argv, cwd, sandbox permissions,
additional permissions, justification, and tty state when a single
active tool call can be attributed.

The implementation keeps the trigger shape canonical by serializing
`GuardianNetworkAccessTrigger` directly and lets each runtime build that
trigger from its `ToolCtx`. Non-guardian approval prompts avoid cloning
the full trigger payload.

## UX changes

Guardian network-access reviews now include a `trigger` object that
explains what command caused the network approval. Instead of seeing
only the requested host, the guardian reviewer can also see the
originating tool call, argv, working directory, sandbox mode,
justification, and tty state.

Example payload the guardian reviewer can see:

```json
{
  "tool": "network_access",
  "target": "https://api.github.com:443",
  "host": "api.github.com",
  "protocol": "https",
  "port": 443,
  "trigger": {
    "callId": "call_abc123",
    "toolName": "shell",
    "command": ["gh", "api", "/repos/openai/codex/pulls/18197"],
    "cwd": "/workspace/codex",
    "sandboxPermissions": "require_escalated",
    "justification": "Fetch PR metadata from GitHub.",
    "tty": false
  }
}
```

The network review itself remains scoped to the network decision:
`target_item_id` stays `null`. `trigger.callId` is attribution context
only, so clients can still distinguish network reviews from
item-targeted command reviews.

## Verification

- Added coverage for serializing network trigger context in guardian
approval JSON.
- Added regression coverage that network guardian reviews do not reuse
`trigger.callId` as `target_item_id`.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-22 14:00:53 -07:00
Michael Bolin 4382a5037c Merge 4696169fe9 into sapling-pr-archive-bolinfest 2026-04-22 13:57:47 -07:00