pub struct ApprovalGate { /* private fields */ }Expand description
Puts every consequential call to the Approver, and lets the rest
through.
This is the runtime half of approval, installed as mentra’s
ToolAuthorizer. It carries no policy: since ADR-0010 there is nothing left
for one to say, because the approver decides. What it still owns is the
filter — is_consequential — and the choice to surface rather than
answer, which is what turns a call into a PermissionRequested event and
blocks the turn until someone resolves it.
Installed even by a run that approves everything, and that is the point. An authorizer is fixed when the runtime is built and mentra never hands it back; without one it allows every call unconditionally and no permission request can ever be raised. Surfacing unconditionally is what lets the answer be chosen per turn — or changed mid-session, which is how an ACP client’s mode picker works at all.
Implementations§
Source§impl ApprovalGate
impl ApprovalGate
pub fn new() -> Self
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Gives up on an unanswered request after timeout, denying the call.
mentra applies this to the whole wait, so it bounds an approver that
never answers as well as one that answers slowly — the fail-closed rule
of Approver, enforced from outside for approvers that forget it.
Trait Implementations§
Source§impl Clone for ApprovalGate
impl Clone for ApprovalGate
Source§fn clone(&self) -> ApprovalGate
fn clone(&self) -> ApprovalGate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more