pub enum EnforcementMode {
Enforce,
Observe,
Disabled,
}Expand description
Controls whether policy decisions are applied to agent actions or only observed.
Mirrors the proto EnforcementMode enum defined in proto/policy.proto so
pure-Rust code can reason about the enforcement posture without a proto
dependency.
| Mode | Proto value | Effect on Deny / Redact / Pending / BudgetBlock |
|---|---|---|
Enforce | 1 | Decision applied; agent blocked / payload redacted. |
Observe | 2 | Decision recorded as a shadow audit event; agent proceeds. |
Disabled | 3 | Policy evaluation skipped entirely (test environments). |
Enforce is the default — omitting enforcement_mode from any
policy document or registration payload leaves existing behavior unchanged.
Variants§
Enforce
Default: deny blocks, redact strips, pending halts execution.
Observe
Dry-run / sandbox: decisions computed and audited; no enforcement applied.
Disabled
Policy evaluation disabled entirely. Only valid in hermetic test environments.
Implementations§
Source§impl EnforcementMode
impl EnforcementMode
Sourcepub fn from_proto_i32(v: i32) -> Option<Self>
pub fn from_proto_i32(v: i32) -> Option<Self>
Convert from the proto integer value (1=Enforce … 3=Disabled).
Returns None for 0 (UNSPECIFIED) and any out-of-range value so callers
can fall back to a server-side default rather than silently coercing.
Trait Implementations§
Source§impl Clone for EnforcementMode
impl Clone for EnforcementMode
Source§fn clone(&self) -> EnforcementMode
fn clone(&self) -> EnforcementMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EnforcementMode
Source§impl Debug for EnforcementMode
impl Debug for EnforcementMode
Source§impl Default for EnforcementMode
impl Default for EnforcementMode
Source§fn default() -> EnforcementMode
fn default() -> EnforcementMode
impl Eq for EnforcementMode
Source§impl Hash for EnforcementMode
impl Hash for EnforcementMode
Source§impl PartialEq for EnforcementMode
impl PartialEq for EnforcementMode
Source§fn eq(&self, other: &EnforcementMode) -> bool
fn eq(&self, other: &EnforcementMode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EnforcementMode
Auto Trait Implementations§
impl Freeze for EnforcementMode
impl RefUnwindSafe for EnforcementMode
impl Send for EnforcementMode
impl Sync for EnforcementMode
impl Unpin for EnforcementMode
impl UnsafeUnpin for EnforcementMode
impl UnwindSafe for EnforcementMode
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.