pub struct PermissionsConfig {
pub mode: Option<PermissionsMode>,
pub rules: Vec<PermissionRule>,
}Expand description
[permissions] block in config.toml. Carries the gate’s
enforcement posture and (v0.7.0 K9) the declarative rule list
the unified crate::permissions::Permissions::evaluate
pipeline consults before mode + hook fall-through.
Wire format (rules — K9):
[permissions]
mode = "enforce"
[[permissions.rules]]
namespace_pattern = "secrets/*"
op = "memory_store"
agent_pattern = "ai:*"
decision = "deny"
reason = "ai agents may not write to secrets"Rules are deny-first and longest-pattern-wins; see
crate::permissions module docs for the full combination
rule.
Fields§
§mode: Option<PermissionsMode>Enforcement mode. None when the operator declared a
[permissions] block but omitted mode = — this is the
“partial config” case that B4 (S5-M3) closes: such a block
MUST NOT silently fall back to the serde-derived
PermissionsMode::default (advisory), because the v0.7.0
secure default is enforce. The
AppConfig::effective_permissions_mode resolver maps
Some(cfg { mode: None }) to the secure default + a
migration warning, so an operator who half-typed
[permissions] and forgot the mode line still ships
enforce, not the v0.6.x advisory posture.
Serializes as omitted when None so a round-tripped config
without an explicit mode keeps the partial-config shape
for the next loader.
rules: Vec<PermissionRule>v0.7.0 K9 — declarative permission rules. Each entry is a
(namespace_pattern, op, agent_pattern, decision) tuple
consulted by crate::permissions::Permissions::evaluate
before the mode default falls through. Defaults to empty
(no declarative rules — pre-K9 behaviour: mode + hooks +
existing governance gate decide everything).
Trait Implementations§
Source§impl Clone for PermissionsConfig
impl Clone for PermissionsConfig
Source§fn clone(&self) -> PermissionsConfig
fn clone(&self) -> PermissionsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PermissionsConfig
impl Debug for PermissionsConfig
Source§impl Default for PermissionsConfig
impl Default for PermissionsConfig
Source§fn default() -> PermissionsConfig
fn default() -> PermissionsConfig
Source§impl<'de> Deserialize<'de> for PermissionsConfig
impl<'de> Deserialize<'de> for PermissionsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PermissionsConfig
impl RefUnwindSafe for PermissionsConfig
impl Send for PermissionsConfig
impl Sync for PermissionsConfig
impl Unpin for PermissionsConfig
impl UnsafeUnpin for PermissionsConfig
impl UnwindSafe for PermissionsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more