Skip to main content

Actra - Deterministic admission control engine for automated system actions.

Project description

Actra Python SDK

Action Admission Control for Automated Systems

Deterministic policy engine that decides whether automated actions are allowed before they execute.

The Actra Python SDK provides a simple interface for loading policies and evaluating decisions using the Actra engine written in Rust.


Runtime Admission Control

The SDK also provides a runtime layer for protecting functions using Actra policies.

If a policy blocks the operation, the function will not execute and a PermissionError will be raised.


Installation

Install from PyPI:

pip install actra

The package includes a compiled Rust engine, so no Rust toolchain is required during installation.


Quick Start

@actra.admit()
def refund(amount):
    ...

The rule lives in policy:

rules:
  - id: block_large_refund
    when:
      subject:
        domain: action
        field: amount
      operator: greater_than
      value:
        literal: 1000
    effect: block
Result:

refund(200)   > allowed  
refund(1500)  > blocked by policy

Actra evaluates the policy before the function executes and blocks refunds greater than 1000.


Design Goals

The Python SDK focuses on:

  • simple developer ergonomics
  • deterministic policy evaluation
  • minimal runtime overhead
  • seamless integration with the Rust engine

The heavy lifting is performed by the core engine, ensuring fast and consistent evaluations.


Architecture

flowchart LR
    subgraph User Code
        U[User Code]
    end
    
    subgraph SDK Layer
        S[Python SDK]
    end

    subgraph Native Bindings
        N[Rust bindings<br/>actra]
    end

    subgraph Core Engine
        C[Actra Engine]
    end

    U --> S --> N --> C

The SDK provides a Python-friendly interface while the core engine handles compilation and evaluation.


License

Apache License 2.0


Project

Actra is designed for systems requiring explicit, reproducible control over state-changing operations in automated environments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actra-0.7.6.tar.gz (37.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

actra-0.7.6-cp39-abi3-win_amd64.whl (342.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

actra-0.7.6-cp39-abi3-win32.whl (321.5 kB view details)

Uploaded CPython 3.9+Windows x86

actra-0.7.6-cp39-abi3-manylinux_2_28_x86_64.whl (409.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

actra-0.7.6-cp39-abi3-macosx_10_12_universal2.whl (730.2 kB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)

File details

Details for the file actra-0.7.6.tar.gz.

File metadata

  • Download URL: actra-0.7.6.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for actra-0.7.6.tar.gz
Algorithm Hash digest
SHA256 8cab1a1b4ff5399a73c5942b8f6745c63f38c350aff5dd323e514218cf986ecb
MD5 9739c8b83ea0056e0332f009b71cb8ae
BLAKE2b-256 3bd946b2cf0e725a2ebad270430bf7f859c2addc3b4024e5a89e28478a8fe007

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.6.tar.gz:

Publisher: py-sdk-build-publish.yml on getactra/actra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file actra-0.7.6-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: actra-0.7.6-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 342.5 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for actra-0.7.6-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d5a2811744cf2f28b6d4380b487ede9d576e2408c369cebc1ba4801530c11878
MD5 318110b55b65bb1e2bf4659bf005a7e5
BLAKE2b-256 cb1b0380dfaa8638817806ab51b4a75446dcae325a3f2fcc97f47875a5778437

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.6-cp39-abi3-win_amd64.whl:

Publisher: py-sdk-build-publish.yml on getactra/actra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file actra-0.7.6-cp39-abi3-win32.whl.

File metadata

  • Download URL: actra-0.7.6-cp39-abi3-win32.whl
  • Upload date:
  • Size: 321.5 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for actra-0.7.6-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 19dbbd23553d1391fe17e9ff1a7ab5e7922ad21ee7142518d57b3f353c0e0824
MD5 aeadc497db63faa34f860a3ebe84d61d
BLAKE2b-256 d7110fd86c62ff378c012795e3f737b30255bbe988571eb42c7e95de3ec26812

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.6-cp39-abi3-win32.whl:

Publisher: py-sdk-build-publish.yml on getactra/actra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file actra-0.7.6-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for actra-0.7.6-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0846099e303372d26f6fc662d1639e506a2d591009c85b7074582594335c323a
MD5 b86fee49cac357378c5cbc855f46f688
BLAKE2b-256 32d53dcad6d67beed3cb0000e0e6aeaaf5bc12283e878d049fb1d3800b56a2c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.6-cp39-abi3-manylinux_2_28_x86_64.whl:

Publisher: py-sdk-build-publish.yml on getactra/actra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file actra-0.7.6-cp39-abi3-macosx_10_12_universal2.whl.

File metadata

  • Download URL: actra-0.7.6-cp39-abi3-macosx_10_12_universal2.whl
  • Upload date:
  • Size: 730.2 kB
  • Tags: CPython 3.9+, macOS 10.12+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for actra-0.7.6-cp39-abi3-macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 735bdbb407f6c795827f0de357fc913f79cac5eede7601eb70245b3b9b2448fb
MD5 420529754b11d1df3fe5ff252b446fd5
BLAKE2b-256 fbd2471951b97dbec69b9b467f192fa4884e7a707d7646a148c1225ddcfbe82a

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.6-cp39-abi3-macosx_10_12_universal2.whl:

Publisher: py-sdk-build-publish.yml on getactra/actra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page