The coordinator for capabilities and policies. Create one per agent process.Documentation Index
Fetch the complete documentation index at: https://docs.brane.membranelabs.org/llms.txt
Use this file to discover all available pages before exploring further.
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
| Argument | Type | Description | |
|---|---|---|---|
agent_id | `str | None` | Identity of this agent. Used in every AgentAction record. |
environment | `str | None` | Runtime environment: dev, staging, prod. |
tenant_id | `str | None` | Default tenant for all actions. Can be overridden per action. |
principal_id | `str | None` | Default principal for all actions. |
capabilities | list[Capability] | Pre-register capabilities at construction. | |
policies | list[Policy] | Pre-register policies at construction. |
Owned Components
| Attribute | Type | Purpose |
|---|---|---|
capabilities | CapabilityRegistry | Stores and retrieves registered capabilities. |
policy | PolicyRegistry | Stores registered policy functions. |
policies | PolicyEngine | Evaluates actions against registered policies. |
interceptor | CapabilityInterceptor | Core intercept-evaluate-execute loop. |
callables | CallableCapabilityInterceptor | Wraps Python callables with interception and argument binding. |
Methods
Common Setups
Minimal local development: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 eventsapprovals: ApprovalProvider for handlingapproval_requireddecisionscloud: CloudClient for remote policy evaluationgrants: GrantRegistry for agent capability grantsfail_mode: fail-open or fail-closed on policy engine errors
