Skip to main content
The coordinator for capabilities and policies. Create one per agent process.

Definition

A Runtime owns the capability registry, the policy engine, and the interception machinery. You create one per agent process, configure it with capabilities and policies, and let it govern all capability calls.

Constructor

All constructor arguments are optional.

Owned Components

Methods

Register a capability in the capability registry.
Decorator that registers the function as a governed capability and wraps it with policy enforcement.
Wrap an existing function as a governed capability without decorator syntax.
Register policies that run before or after a capability executes.
Create and evaluate actions manually.

Common Setups

Minimal local development:
Full production context:
Pre-registering capabilities and policies:
Per-request runtime for multi-tenant systems:
One runtime per agent process is the recommended pattern. If you need different tenant or principal contexts per request, create a new Runtime per request with the appropriate identity fields, or override them per create_action call.

Future Constructor Arguments

  • audit: AuditSink for recording action events
  • approvals: ApprovalProvider for handling approval_required decisions
  • cloud: CloudClient for remote policy evaluation
  • grants: GrantRegistry for agent capability grants
  • fail_mode: fail-open or fail-closed on policy engine errors