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.8.tar.gz (38.0 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.8-cp39-abi3-win_amd64.whl (342.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+Windows x86

actra-0.7.8-cp39-abi3-manylinux_2_28_x86_64.whl (408.8 kB view details)

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

actra-0.7.8-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.8.tar.gz.

File metadata

  • Download URL: actra-0.7.8.tar.gz
  • Upload date:
  • Size: 38.0 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.8.tar.gz
Algorithm Hash digest
SHA256 e502425640dfdf042d9074a91455f3942f0b46a3678fb21a5407908f254ddef8
MD5 88547f48b5c56553564f79a555ed248f
BLAKE2b-256 a420601a6da4e7131a41beeb1603e22683e9b007ec9d4ada84dc967ae4803366

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.8-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 342.6 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.8-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7c4ae5dab99d6fe549d29fbf7666e839eec7428ddbfa531f06b86647149c04a8
MD5 78cf413ece3f4e36e5a161b41a825153
BLAKE2b-256 533c9c6d960cd4eb2a3f97c5f989e01d428abd6376716bf53e7e056aac2099eb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.8-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.8-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 c805f4adaffef54b26aa5ae818f2d1daefe5479120429ecf276a85af431598d2
MD5 b9b2e2da5ed58ab5609ccb1f1654a50f
BLAKE2b-256 f98ec4b6070e393a4ec6442e3521b53370a67844fdb460fa39cde152aba337bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for actra-0.7.8-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c63dd4978ceb69d3718960e4a521d8a4468c167f9ddf7bd95d0bd548a7b86770
MD5 ce7de58aafaea5a1dabb904d69f35f31
BLAKE2b-256 54173a4170e3d3072c9a96cbb47ed5c9f83b2314ab23bba05bd59fda8357a26e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: actra-0.7.8-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.8-cp39-abi3-macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9e6192518ded2fc04f953246815faeb21706b15f5bb828a60c3d4b7a9e32ab06
MD5 95b6ddaec7f3cb1d7de1a2184d0b7ccc
BLAKE2b-256 08ea2f5b4c04593a230821969fa833fd13d9a06652c30a2d603ec42c30da95df

See more details on using hashes here.

Provenance

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