pub enum Policy {
SafetyHandoff {
intents: Vec<String>,
},
Redact {
keys: Vec<String>,
},
Commit {
tool: String,
idempotency_key: Option<String>,
compensate_with: Option<String>,
},
}Expand description
A reusable, cross-cutting policy aspect.
Variants§
SafetyHandoff
Hand off (terminate the conversation) when any of these intents is
detected (the intent:{name} flag becomes true). Lowered to a safety
digression with Resume::Terminate.
Redact
Redact these state keys in logs/transcripts. Recorded for the runtime’s
logging layer; pairs with #[slot(pii)].
Commit
Commit-tool governance: idempotency and compensation metadata for a confirm-before-act tool.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn safety_handoff<I, S>(intents: I) -> Self
pub fn safety_handoff<I, S>(intents: I) -> Self
Terminate/hand off when any of intents is detected.
Sourcepub fn commit(tool: impl Into<String>) -> CommitPolicy
pub fn commit(tool: impl Into<String>) -> CommitPolicy
Begin a commit-governance policy for tool.
Sourcepub fn redacted_keys(&self) -> &[String]
pub fn redacted_keys(&self) -> &[String]
The state keys this policy marks for redaction (empty for non-redact).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CommitPolicy> for Policy
impl From<CommitPolicy> for Policy
Source§fn from(c: CommitPolicy) -> Self
fn from(c: CommitPolicy) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
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
Mutably borrows from an owned value. Read more