Files
codex/codex-rs/protocol/src/lib.rs
jif 19d185fec8 Add safe permission profile intersection (#39242)
## What changed

- Add `intersect_effective_permission_profiles` to derive the permissions shared by an authority profile and a requested profile.
- Preserve the more restrictive filesystem access, read denials, protected metadata paths, temporary-directory access, and network policy.
- Canonicalize concrete paths so symlinks cannot expand authority, and fail closed for policy shapes that cannot be intersected safely.

## Testing

Add coverage for workspace intersections, nested carveouts, deny patterns, unsupported policies, temporary-directory restrictions, symlink escapes, and macOS path aliases.

GitOrigin-RevId: a35bdc47e41afad13630f92c032514b300c14a0d
2026-08-18 17:53:36 +00:00

48 lines
1.2 KiB
Rust

pub mod account;
mod agent_path;
pub mod auth;
mod response_item_id;
mod session_id;
mod thread_id;
mod tool_name;
pub use agent_path::AgentPath;
pub use permission_profile_intersection::PermissionIntersectionError;
pub use permission_profile_intersection::intersect_effective_permission_profiles;
pub use response_item_id::ResponseItemId;
pub use session_id::SessionId;
pub use thread_id::RolloutId;
pub use thread_id::ThreadId;
pub use tool_name::DEFAULT_FUNCTION_NAMESPACE;
pub use tool_name::ToolName;
pub mod approvals;
pub mod capabilities;
pub mod config_types;
pub mod dynamic_tools;
mod environment;
pub mod error;
pub mod exec_output;
pub mod items;
mod legacy_events;
pub mod local_media;
pub mod mcp;
pub mod mcp_approval_meta;
pub mod mcp_policy;
pub mod memory_citation;
pub mod models;
pub mod network_policy;
pub mod num_format;
pub mod openai_models;
pub mod parse_command;
mod permission_profile_intersection;
mod permission_profile_snapshot;
pub mod permissions;
pub mod plan_tool;
pub mod protocol;
pub mod request_permissions;
pub mod request_user_input;
pub mod review_format;
pub mod security_risk;
pub mod shell_environment;
pub mod turn_input;
pub mod user_input;