Read turn permissions from the current configuration (#36930)

## What changed

- Remove the cached permission profile from `TurnContext` and derive the
  effective profile, filesystem policy, network policy, and legacy sandbox
  policy from `config.permissions`.
- Update sandbox consumers and tests to use the current turn configuration.
- Verify that role-based agent spawning reapplies runtime permissions and that
  cold-resumed agents retain their disabled permission profile.

GitOrigin-RevId: d67c5d2bcbe6dc76f15b56defb485b155fd1f138
This commit is contained in:
jif authored and copyberry committed 2026-08-04 17:13:13 +00:00
1 parent 7ada37a15e
commit 90314a9207
14 files changed
+67 -40

No files matched your search

+3 -2
View File
@@ -443,11 +443,12 @@ impl ToolRegistry {
let tool_name_flat = flat_tool_name(&tool_name);
let call_id_owned = invocation.call_id.clone();
let otel = invocation.turn.session_telemetry.clone();
let permission_profile = invocation.turn.permission_profile();
let base_tool_result_tags = [
(
"sandbox",
permission_profile_sandbox_tag(
&invocation.turn.permission_profile,
&permission_profile,
invocation.turn.windows_sandbox_level,
invocation.turn.network.is_some(),
),
@@ -455,7 +456,7 @@ impl ToolRegistry {
(
"sandbox_policy",
permission_profile_policy_tag(
&invocation.turn.permission_profile,
&permission_profile,
#[allow(deprecated)]
invocation.turn.cwd.as_path(),
),