pub struct LivePolicyHandle { /* private fields */ }Expand description
Single-lock live policy handle coordinating filesystem, network, sandbox mode, and protected-path evaluation across parent and child sessions.
Implementations§
Source§impl LivePolicyHandle
impl LivePolicyHandle
Sourcepub fn new(baseline: LivePolicyBaseline) -> Self
pub fn new(baseline: LivePolicyBaseline) -> Self
Creates a live handle initialized with baseline.
Sourcepub fn for_workspace(policy: Option<WorkspaceAccessPolicy>) -> Self
pub fn for_workspace(policy: Option<WorkspaceAccessPolicy>) -> Self
Creates a standalone handle initialized from an optional
WorkspaceAccessPolicy (primarily for standalone tools and tests).
Sourcepub fn for_network(policy: NetworkAccessPolicy) -> Self
pub fn for_network(policy: NetworkAccessPolicy) -> Self
Creates a standalone handle initialized from a NetworkAccessPolicy
(preserving any attached session permission view).
Sourcepub fn with_session_permissions(
self,
view: ProcessSessionPermissionView,
) -> Self
pub fn with_session_permissions( self, view: ProcessSessionPermissionView, ) -> Self
Attaches a live read-only view of session-scoped permission grants.
Sourcepub fn for_child(
&self,
session_permissions: Option<ProcessSessionPermissionView>,
child_override: Option<ChildWorkspacePolicyOverride>,
) -> Self
pub fn for_child( &self, session_permissions: Option<ProcessSessionPermissionView>, child_override: Option<ChildWorkspacePolicyOverride>, ) -> Self
Derives a child handle sharing the same atomic baseline lock while
binding session grant evaluation strictly to the child’s own
session_permissions and optional workspace/worktree overrides.
Sourcepub fn baseline_snapshot(&self) -> Arc<LivePolicyBaseline> ⓘ
pub fn baseline_snapshot(&self) -> Arc<LivePolicyBaseline> ⓘ
Returns a point-in-time Arc snapshot of the shared policy baseline.
Sourcepub fn replace_baseline(&self, next: LivePolicyBaseline)
pub fn replace_baseline(&self, next: LivePolicyBaseline)
Atomically replaces the shared policy baseline under a single lock.
Sourcepub fn is_restricted(&self) -> bool
pub fn is_restricted(&self) -> bool
Returns whether workspace sandbox restrictions are currently active.
Sourcepub fn workspace_writable(&self) -> bool
pub fn workspace_writable(&self) -> bool
Returns whether writes inside the workspace are currently allowed.
Sourcepub fn network_allow_local(&self) -> bool
pub fn network_allow_local(&self) -> bool
Returns whether the active network baseline allows local loopback targets.
Sourcepub fn product_private_paths(&self) -> Vec<PathBuf>
pub fn product_private_paths(&self) -> Vec<PathBuf>
Returns the currently active ProductPrivate protected credential paths.
Sourcepub fn evaluate_read(
&self,
path: &Path,
once_grants: &[PathAccessRule],
) -> PathEvaluation
pub fn evaluate_read( &self, path: &Path, once_grants: &[PathAccessRule], ) -> PathEvaluation
Evaluates filesystem read access for path against the active baseline,
this session’s grants, and optional single-action once_grants.
Sourcepub fn evaluate_write(
&self,
path: &Path,
once_grants: &[PathAccessRule],
) -> PathEvaluation
pub fn evaluate_write( &self, path: &Path, once_grants: &[PathAccessRule], ) -> PathEvaluation
Evaluates filesystem write access for path against the active baseline,
this session’s grants, and optional single-action once_grants.
Sourcepub fn evaluate_path(
&self,
path: &Path,
requested: PathAccess,
once_grants: &[PathAccessRule],
) -> PathEvaluation
pub fn evaluate_path( &self, path: &Path, requested: PathAccess, once_grants: &[PathAccessRule], ) -> PathEvaluation
Evaluates filesystem access for path in either --sandbox workspace
or --sandbox off mode using a single authoritative evaluation pass.
Sourcepub fn evaluate_network_host(
&self,
host: &str,
once_domains: &[String],
) -> NetworkAccessDecision
pub fn evaluate_network_host( &self, host: &str, once_domains: &[String], ) -> NetworkAccessDecision
Evaluates outbound HTTP(S) access to host against the active baseline,
this session’s grants, and optional single-action once_domains.
Sourcepub fn evaluate_data_url(&self) -> NetworkAccessDecision
pub fn evaluate_data_url(&self) -> NetworkAccessDecision
Evaluates access to a browser data: document against the active baseline.