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.4.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.4-cp39-abi3-win_amd64.whl (342.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

actra-0.7.4-cp39-abi3-win32.whl (321.7 kB view details)

Uploaded CPython 3.9+Windows x86

actra-0.7.4-cp39-abi3-manylinux_2_28_x86_64.whl (409.2 kB view details)

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

actra-0.7.4-cp39-abi3-macosx_10_12_universal2.whl (730.5 kB view details)

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

File details

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

File metadata

  • Download URL: actra-0.7.4.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.4.tar.gz
Algorithm Hash digest
SHA256 7260fd653586b468b04bd643532c106d2ea8baa508cbcd2541fb8308b4b020f5
MD5 391efd7c17c43a48cc7d4919dbaac1ee
BLAKE2b-256 3ee2873cb93c60a473952355e98a84ac2990cf985180f76c3ff57b6a0bc5c8a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.4.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.4-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: actra-0.7.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 342.4 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.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 11fc9d8890932dfb6089e29866db9699a00bf432601a3f86754a070356a175b1
MD5 5bc801dfc4fefdd7678bd5df5ae16e55
BLAKE2b-256 e4c7d5f91003a0845ff4dce21f95d2d2ea639cd32ec14fe8929665618978340e

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.4-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.4-cp39-abi3-win32.whl.

File metadata

  • Download URL: actra-0.7.4-cp39-abi3-win32.whl
  • Upload date:
  • Size: 321.7 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.4-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 2b7f0a218a88b11c4e865b8733198ac183f011c03fa04daee9b802e8ce38eaae
MD5 8cf57bc2a5f180b0d3510aed777225f7
BLAKE2b-256 72452312a1ce4efe67f7918a487cb3b12da77dff4a15a1c92ea0cdaea667ba2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.4-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.4-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for actra-0.7.4-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d99de326bb3a36f1b1a1cb95207cb9384ac1a481fb2f63ca793ecfd16b400a1
MD5 703f9c193c5620960bfd5f4d0ef48c9d
BLAKE2b-256 8ae3c24cfc043b36d047884ca83b0712ee82ac8c6eda4cdb9453156b534a0878

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.4-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.4-cp39-abi3-macosx_10_12_universal2.whl.

File metadata

  • Download URL: actra-0.7.4-cp39-abi3-macosx_10_12_universal2.whl
  • Upload date:
  • Size: 730.5 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.4-cp39-abi3-macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 0dbfb1b16ffc70e0a86e701058f3713a4bac38c8a8e0eff8f40b365579e33795
MD5 2c9890ae9b9635f07672f89cecf3c22f
BLAKE2b-256 a48834c74e3dc171381851bda3e1363c2e3d89c4c7634f3ce9015a2f2ad232ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for actra-0.7.4-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