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.
Release files for actra 0.7.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| actra-0.7.8.tar.gz | 38.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| actra-0.7.8-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| actra-0.7.8-cp39-abi3-win32.whl | CPython 3.9 | abi3 | Windows x86-32 | Details |
| actra-0.7.8-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| actra-0.7.8-cp39-abi3-macosx_10_12_universal2.whl | CPython 3.9 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64) | Details |
Total release size: 1.8 MB
Release files / actra-0.7.8.tar.gz
| Download URL | actra-0.7.8.tar.gz |
|---|---|
| Size | 38.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e502425640dfdf042d9074a91455f3942f0b46a3678fb21a5407908f254ddef8
|
|
BLAKE2b-256 checksum How to use checksums |
a420601a6da4e7131a41beeb1603e22683e9b007ec9d4ada84dc967ae4803366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency logRelease files / actra-0.7.8-cp39-abi3-win_amd64.whl
| Download URL | actra-0.7.8-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 342.6 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7c4ae5dab99d6fe549d29fbf7666e839eec7428ddbfa531f06b86647149c04a8
|
|
BLAKE2b-256 checksum How to use checksums |
533c9c6d960cd4eb2a3f97c5f989e01d428abd6376716bf53e7e056aac2099eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency logRelease files / actra-0.7.8-cp39-abi3-win32.whl
| Download URL | actra-0.7.8-cp39-abi3-win32.whl |
|---|---|
| Size | 321.5 kB |
| Tags | CPython 3.9 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
c805f4adaffef54b26aa5ae818f2d1daefe5479120429ecf276a85af431598d2
|
|
BLAKE2b-256 checksum How to use checksums |
f98ec4b6070e393a4ec6442e3521b53370a67844fdb460fa39cde152aba337bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency logRelease files / actra-0.7.8-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | actra-0.7.8-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 408.8 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c63dd4978ceb69d3718960e4a521d8a4468c167f9ddf7bd95d0bd548a7b86770
|
|
BLAKE2b-256 checksum How to use checksums |
54173a4170e3d3072c9a96cbb47ed5c9f83b2314ab23bba05bd59fda8357a26e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency logRelease files / actra-0.7.8-cp39-abi3-macosx_10_12_universal2.whl
| Download URL | actra-0.7.8-cp39-abi3-macosx_10_12_universal2.whl |
|---|---|
| Size | 730.5 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
9e6192518ded2fc04f953246815faeb21706b15f5bb828a60c3d4b7a9e32ab06
|
|
BLAKE2b-256 checksum How to use checksums |
08ea2f5b4c04593a230821969fa833fd13d9a06652c30a2d603ec42c30da95df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency log