pub struct VerbPolicy { /* private fields */ }Expand description
Decides calls to screen-action tools (spec 3.3 §2 item 7, owner questions 22 and 23).
Attach it with HarnessAgentBuilder::add_operator_policy: it composes with the harness’s
policy through StrictestPolicy, so no mode, standing rule or earlier approval allows an
agent’s change (the spec 3.2 K-I9 pattern).
| Call | Decision |
|---|---|
A tool not published as verbs:<app> | Allow (not this layer’s call) |
By urn:adk:agent:<app>/surface.verbs, a person’s own action | Allow |
An action that only reads (coming_up) | Allow |
| An action only a person takes | Deny |
From an agent with MAX_WAITING requests waiting for the same person already, unless the person answered this call | Deny: “Finance already has 3 changes waiting for you” |
| An action that would be refused now: not found, in another area, started, moved | Deny, before any card |
| Any other action | RequireApproval, every call, with the kernel’s words: “Move News digest to 19:00” |
§Example
use std::sync::Arc;
let builder = builder
.toolset(Arc::new(registry.toolset("work")))
.tool_classes(Arc::new(registry.classes()))
.add_operator_policy(Arc::new(registry.policy("work")));Trait Implementations§
Source§impl Clone for VerbPolicy
impl Clone for VerbPolicy
Source§impl Debug for VerbPolicy
impl Debug for VerbPolicy
Source§impl ToolPolicy for VerbPolicy
impl ToolPolicy for VerbPolicy
Source§fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 ToolPolicyRequest,
) -> Pin<Box<dyn Future<Output = PolicyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 ToolPolicyRequest,
) -> Pin<Box<dyn Future<Output = PolicyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Decides one call.
Source§fn evaluate_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
request: &'life1 ToolPolicyRequest,
call: &'life2 PolicyCall<'life3>,
) -> Pin<Box<dyn Future<Output = PolicyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn evaluate_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
request: &'life1 ToolPolicyRequest,
call: &'life2 PolicyCall<'life3>,
) -> Pin<Box<dyn Future<Output = PolicyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Decides one call, given its
PolicyCall facts as well as the request. Read moreSource§fn policy_ref(&self) -> Option<String>
fn policy_ref(&self) -> Option<String>
A name or version for audit records, which cite the policy as
tool_policy:<name>. The default is None, cited as tool_policy.Auto Trait Implementations§
impl !RefUnwindSafe for VerbPolicy
impl !UnwindSafe for VerbPolicy
impl Forget for VerbPolicy
impl Freeze for VerbPolicywhere
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for VerbPolicy
impl Send for VerbPolicy
impl Sync for VerbPolicy
impl Unpin for VerbPolicy
impl UnsafeUnpin for VerbPolicywhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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