pub struct ReadPathPolicy {
pub agent: String,
pub blueprint: ReadPathSet,
pub grants: ReadPathSet,
pub allow_blueprint: bool,
}Expand description
Everything read-path enforcement needs, resolved once at spawn.
blueprint is what the manifest declares; grants is what the user’s
config allows ([security] read_paths plus [agent_read_paths.<name>]);
allow_blueprint is the [security] allow_blueprint_read_paths override
that honors declarations without itemized grants.
Fields§
§agent: StringThe agent’s name, for error and warning text.
blueprint: ReadPathSetEntries the blueprint declares.
grants: ReadPathSetEntries the user’s config grants.
allow_blueprint: boolWhether declarations are honored without itemized grants.
Implementations§
Source§impl ReadPathPolicy
impl ReadPathPolicy
Sourcepub fn inactive() -> Self
pub fn inactive() -> Self
A policy that allows nothing beyond the workdir - the default for
every agent whose blueprint has no [read_paths].
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Whether the blueprint declares any read paths at all. When false, the resolver never consults this policy and the workdir sandbox behaves exactly as it always has.
Sourcepub fn decide(&self, canonical: &Path) -> ReadPathDecision
pub fn decide(&self, canonical: &Path) -> ReadPathDecision
The double check: the blueprint must declare the path AND the user must grant it (itemized, or via the blanket override).
Trait Implementations§
Source§impl Clone for ReadPathPolicy
impl Clone for ReadPathPolicy
Source§fn clone(&self) -> ReadPathPolicy
fn clone(&self) -> ReadPathPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more