pub struct ToolPolicyContext {Show 19 fields
pub run_id: Option<String>,
pub workflow_id: Option<String>,
pub turn: Option<u32>,
pub tool_call_id: Option<String>,
pub tool_name: String,
pub action_kind: ToolActionKind,
pub args: Value,
pub args_hash: Option<String>,
pub cwd: Option<PathBuf>,
pub resource_scope: ResourceScope,
pub mode: AgentMode,
pub autonomy_mode: AutonomyMode,
pub workflow_type: WorkflowType,
pub risk_level: RiskLevel,
pub workspace_scope: WorkspaceScope,
pub trust_scope: TrustScopeContext,
pub trust_labels: Vec<String>,
pub supporting_provenance: Vec<Provenance>,
pub metadata: ToolMetadata,
}Expand description
Context supplied to the reference monitor for a single tool/action decision.
Fields§
§run_id: Option<String>§workflow_id: Option<String>§turn: Option<u32>§tool_call_id: Option<String>§tool_name: String§action_kind: ToolActionKind§args: Value§args_hash: Option<String>§cwd: Option<PathBuf>§resource_scope: ResourceScope§mode: AgentMode§autonomy_mode: AutonomyMode§workflow_type: WorkflowType§risk_level: RiskLevel§workspace_scope: WorkspaceScope§trust_scope: TrustScopeContext§trust_labels: Vec<String>§supporting_provenance: Vec<Provenance>§metadata: ToolMetadataImplementations§
Source§impl ToolPolicyContext
impl ToolPolicyContext
pub fn new(tool_name: impl Into<String>, action_kind: ToolActionKind) -> Self
pub fn apply_workflow_contract(&mut self, contract: &WorkflowContract)
pub fn with_workflow_contract(self, contract: &WorkflowContract) -> Self
pub fn with_supporting_provenance(self, provenance: Provenance) -> Self
Trait Implementations§
Source§impl Clone for ToolPolicyContext
impl Clone for ToolPolicyContext
Source§fn clone(&self) -> ToolPolicyContext
fn clone(&self) -> ToolPolicyContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolPolicyContext
impl Debug for ToolPolicyContext
Source§impl<'de> Deserialize<'de> for ToolPolicyContext
impl<'de> Deserialize<'de> for ToolPolicyContext
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 PartialEq for ToolPolicyContext
impl PartialEq for ToolPolicyContext
Source§fn eq(&self, other: &ToolPolicyContext) -> bool
fn eq(&self, other: &ToolPolicyContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolPolicyContext
impl Serialize for ToolPolicyContext
impl StructuralPartialEq for ToolPolicyContext
Auto Trait Implementations§
impl Freeze for ToolPolicyContext
impl RefUnwindSafe for ToolPolicyContext
impl Send for ToolPolicyContext
impl Sync for ToolPolicyContext
impl Unpin for ToolPolicyContext
impl UnsafeUnpin for ToolPolicyContext
impl UnwindSafe for ToolPolicyContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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