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

Uploaded CPython 3.9+Windows x86-64

actra-0.7.2-cp39-abi3-win32.whl (321.6 kB view details)

Uploaded CPython 3.9+Windows x86

actra-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl (408.7 kB view details)

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

actra-0.7.2-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.2.tar.gz.

File metadata

  • Download URL: actra-0.7.2.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.2.tar.gz
Algorithm Hash digest
SHA256 af668dfaafac92e1b317144b455ce632a39d1eb95f042dd7e0a53f04807b4c85
MD5 34e4dc067cab014656e3e6317f7bae8e
BLAKE2b-256 299fb51404533ef6a183eba27a060afbb3e538f92098443ce93211511e2d976e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.2-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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6ec24bfb6fb4b179051dc1bf4db687767792ea059787817d3cb84a7570e875df
MD5 b9e8b4f61c88ed14020c2d0b2d1bc270
BLAKE2b-256 a03317cae46e31f4310eff28cbee5d945b89d14b1dcefa421cd06de762796090

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.2-cp39-abi3-win32.whl
  • Upload date:
  • Size: 321.6 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.2-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 dc2b57e593772be37856d5b05c40e8e34d10950a1ea83a5deb7b3883475eec3c
MD5 8467984fcc2d93645e37652705214044
BLAKE2b-256 248240daa8911fd672037535b794d6263a11a8b3e4393737c7f87c71d1718def

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for actra-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a4271c1e370e492ea8b7e5cfab80bab98d978c773506baea7ae361edbfb9ab0f
MD5 72da322fde884f01b2b1c759e62d934d
BLAKE2b-256 6711ccffe65373d1fbe0e75558bf87cf1e3d4b381bcf415fac0e73a734b0acac

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.2-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.2-cp39-abi3-macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 50cfa74c01a7b7cdda5348914b29abaf31f586e5872cdaa286ca54ca21731e4c
MD5 d61d26e84ec66941555e0d05154927b7
BLAKE2b-256 7529fb12e5c8414a85272266590545828c0958f0d029c8f34c5e76105f3ed9ef

See more details on using hashes here.

Provenance

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