Skip to main content

Module policy

Module policy 

Source
Expand description

Policy: governance layer (authorize, retry, budget).

Must exist even as a minimal implementation so Oris is not a “run any tool” demo.

Retry loop: The driver calls retry_strategy_attempt on executor Err and only stops when the policy returns Fail. Implementations must eventually return Fail or the loop would not terminate; RetryWithBackoffPolicy does so after max_retries attempts.

Structs§

AllowListPolicy
Policy that allows only actions whose tool/provider is in the given sets. Empty set = no tools or providers allowed for that category. Sleep and WaitSignal are always allowed. To allow all tools/providers use AllowAllPolicy, or populate the sets explicitly.
BudgetRules
Optional budget rules (cost, token limits, etc.).
PolicyCtx
Context passed to policy (e.g. caller identity, run metadata).
RetryWithBackoffPolicy
Policy that returns RetryAfterMs with exponential backoff (and optional jitter) for the first max_retries attempts, then Fail. For RateLimited errors with retry_after_ms, uses that value when set.

Enums§

RetryDecision
Decision after an action failure (retry, backoff, or fail).

Traits§

Policy
Policy: authorize actions, decide retries, optional budget.