pub struct PolicyDecisionPoint { /* private fields */ }Expand description
The local policy decision point. Evaluates tool calls against the intent map, the global mission, and every per-agent mission that selects the caller.
Implementations§
Source§impl PolicyDecisionPoint
impl PolicyDecisionPoint
Sourcepub fn from_config(
config: &HarnessConfig,
signer: Option<Arc<TokenSigner>>,
) -> Self
pub fn from_config( config: &HarnessConfig, signer: Option<Arc<TokenSigner>>, ) -> Self
Build from harness config with an optional token signer.
Sourcepub fn applicable_missions<'s>(
&'s self,
caller: &CallerFacts<'_>,
) -> Vec<&'s MissionConfig>
pub fn applicable_missions<'s>( &'s self, caller: &CallerFacts<'_>, ) -> Vec<&'s MissionConfig>
Every mission that constrains caller: the global mission, then
each [[missions]] entry whose selectors match.
Sourcepub fn decide(&self, tool: &str, now_s: u64) -> AuthzDecision
pub fn decide(&self, tool: &str, now_s: u64) -> AuthzDecision
Decide whether tool may run at now_s for a caller without a
validated identity. Signs nothing.
Sourcepub fn decide_for(
&self,
tool: &str,
now_s: u64,
caller: &CallerFacts<'_>,
) -> AuthzDecision
pub fn decide_for( &self, tool: &str, now_s: u64, caller: &CallerFacts<'_>, ) -> AuthzDecision
Decide whether tool may run at now_s for caller. Signs
nothing, so the pipeline can run it before the budget is charged.
Missions only narrow: every applicable mission must allow the call.
Sourcepub fn intent_for(&self, tool: &str) -> String
pub fn intent_for(&self, tool: &str) -> String
The business intent tool maps to: its intent_map entry, or the
tool name itself. A plain lookup that never denies.
Sourcepub fn mint_intent_token(
&self,
tool: &str,
intent: &str,
caller: &CallerFacts<'_>,
audience: &str,
now_s: u64,
) -> Option<String>
pub fn mint_intent_token( &self, tool: &str, intent: &str, caller: &CallerFacts<'_>, audience: &str, now_s: u64, ) -> Option<String>
Sign a short-lived intent token for a permitted call, bound to the
backend that receives it. sub is the human principal and act.sub
the calling agent; the token never outlives an applicable mission.
None when no signer is configured.
Sourcepub fn intent_token_ttl_s(&self) -> u64
pub fn intent_token_ttl_s(&self) -> u64
The configured intent token TTL.
Auto Trait Implementations§
impl Freeze for PolicyDecisionPoint
impl RefUnwindSafe for PolicyDecisionPoint
impl Send for PolicyDecisionPoint
impl Sync for PolicyDecisionPoint
impl Unpin for PolicyDecisionPoint
impl UnsafeUnpin for PolicyDecisionPoint
impl UnwindSafe for PolicyDecisionPoint
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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