mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Session isolation relied on Guardian source attribution. An explicit policy lets callers control inherited capabilities independently of how a session is attributed. ## What changed - Add `SessionIsolation` with default `Inherit` and opt-in `Isolated` modes, captured at session startup through `ExtensionDataInit`. - Use the policy to control inherited instructions, extensions, execution rules, and MCP resources. Isolated sessions retain managed execution rules and omit executor-discovered MCP servers. - Explicitly isolate Guardian reviewers while preserving source-based fallback for older callers and saved reviewers. ## Testing Extend delegate tests to cover isolation independently of attribution, update execution-policy coverage to supply the explicit policy, and assert that managed reviewers do not inherit the parent's configured MCP tools. GitOrigin-RevId: f0ab42fa2f0237860ec661e72693ab191216afbf
16 lines
815 B
Rust
16 lines
815 B
Rust
//! Host-supplied isolation for internal runtimes, independent of their attribution.
|
|
//! Isolation only removes inherited capabilities; it never grants review authority.
|
|
|
|
/// Runtime policy supplied through `ExtensionDataInit` before session startup.
|
|
/// The host captures this value once so later extension-state changes cannot alter it.
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
|
pub enum SessionIsolation {
|
|
/// Use the host's ordinary instruction providers, extensions and execution rules.
|
|
#[default]
|
|
Inherit,
|
|
/// Start without inherited instruction providers or extensions, retain only managed
|
|
/// execution rules, and omit executor-discovered MCP servers. Explicitly supplied
|
|
/// instructions and permissions remain the responsibility of the internal caller.
|
|
Isolated,
|
|
}
|