Skip to main content
The ActGuard Python SDK gives you a runtime client that manages:
  • Run-scoped execution context (client.run(...))
  • Budget reserve/settle scopes (client.budget_guard(...))
  • Tool guard decorators (rate_limit, circuit_breaker, max_attempts, timeout, idempotent, prove, enforce, tool)
  • Optional event shipping to the ActGuard gateway

Install

Canonical runtime pattern

This is the same pattern used by the framework demos in actguard/examples.

Initialization options

  • actguard.Client.from_env() reads ACTGUARD_CONFIG when set
  • actguard.Client.from_file("./actguard.json") reads JSON config from disk
  • actguard.Client(...) accepts explicit constructor args
ACTGUARD_CONFIG may be either:
  • A base64-encoded JSON object
  • A filesystem path to a JSON file

Runtime scopes at a glance

  • client.run(...): required for runtime-scoped decorators like max_attempts and idempotent
  • client.budget_guard(...): budget tracking/enforcement scope bound to the active run
  • actguard.session(...): chain-of-custody scope used by prove and enforce

Next steps