Approval request inputs
Exports
ApprovalDenied
Raised inside a suspended execution when its principal denies the call.Example
Example
ApprovalEnforcementError
Raised when protected work lacks a managed approval boundary.Example
Example
ApprovalError
Base error for approval policy and state transitions.Example
Example
ApprovalExecution
Invocation identity and optional grant visible to protected callables.— means no declared default):
Parameters and example
Parameters and example
ApprovalExecution.authorize
Parameters and example
Parameters and example
ApprovalExpired
Raised inside a suspended execution when its decision deadline passes.Example
Example
ApprovalPolicy
Immutable policy attached to a local tool or MCP client factory.— means no declared default):
Parameters and example
Parameters and example
ApprovalPolicy.applies_to
Parameters and example
Parameters and example
ApprovalRequired
Stop managed execution before a protected action is called.Example
Example
ApprovalRun
One live invocation whose Python task may suspend at protected calls. Obtain this object from the owning Harnest API; its constructor includes runtime bindings. Fields (— means no declared default):
Example
Example
InMemoryApprovalStore
Development approval store with atomic one-time transitions.Parameters and example
Parameters and example
InMemoryApprovalStore.create_run
Parameters and example
Parameters and example
InMemoryApprovalStore.request
Parameters and example
Parameters and example
InMemoryApprovalStore.suspend
Parameters and example
Parameters and example
InMemoryApprovalStore.decide
Parameters and example
Parameters and example
InMemoryApprovalStore.deliver_decision
Parameters and example
Parameters and example
InMemoryApprovalStore.run_for
Parameters and example
Parameters and example
InMemoryApprovalStore.pending_for
Parameters and example
Parameters and example
InMemoryApprovalStore.assert_consumed
Parameters and example
Parameters and example
InMemoryApprovalStore.executed
Parameters and example
Parameters and example
InMemoryApprovalStore.failed
Parameters and example
Parameters and example
InMemoryApprovalStore.cancel_run
Parameters and example
Parameters and example
InMemoryApprovalStore.retained_count
Return the number of live challenges and retained tombstones.Example
Example
PendingApproval
One principal-scoped invocation awaiting a one-time decision. Obtain this object from the owning Harnest API; its constructor includes runtime bindings. Fields (— means no declared default):
Example
Example
PendingApproval.public
Example
Example
approval_execution
Activate approval authority for protected work in this context.Parameters and example
Parameters and example
approval_policy
Read the Harnest approval policy attached to a callable, if present.Parameters and example
Parameters and example
authorize_mcp
Authorize one MCP tool call when the client policy selects it.Parameters and example
Parameters and example
bind_tool_arguments
Bind a tool call to canonical approval-safe argument values.Parameters and example
Parameters and example
record_approved_execution
Record successful completion for an optional one-time approval grant.Parameters and example
Parameters and example
record_approved_failure
Record failed execution for an optional one-time approval grant.Parameters and example
Parameters and example
request_human_approval
Protect only the dynamic operation inside this asynchronous block. Callers may evaluate policy or risk before entering the block. The approval is bound to a stable action name and canonical arguments, while the block boundary lets Harnest audit whether the approved operation completed.Parameters and example
Parameters and example
require_human_approval
Declare that a tool or MCPclient() factory requires approval.
Parameters and example
Parameters and example
wrap_approved_tool
Install an execution gate after both decorator orders are known.Parameters and example
Parameters and example