Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
### v0.7.5 - 28 March 2026
### v0.7.7 - 28 March 2026
- browser load js sdk bug fix

### v0.7.6 - 28 March 2026
- publish js sdk to npm

### v0.7.5 - 28 March 2026
- publish js sdk to npm

### v0.7.4 - 28 March 2026
- publish js sdk to npm
Expand Down
175 changes: 146 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Actra
### Control what runs before it runs

[![PyPI version](https://img.shields.io/pypi/v/actra.svg)](https://pypi.org/project/actra/)
[![PyPI downloads](https://img.shields.io/pypi/dm/actra)](https://pypi.org/project/actra/)
[![npm version](https://img.shields.io/npm/v/@getactra/actra.svg)](https://www.npmjs.com/package/@getactra/actra)
[![npm downloads](https://img.shields.io/npm/dm/@getactra/actra.svg)](https://www.npmjs.com/package/@getactra/actra)
[![types](https://img.shields.io/npm/types/@getactra/actra)](https://www.npmjs.com/package/@getactra/actra)
[![WebAssembly](https://img.shields.io/badge/WebAssembly-supported-purple.svg)](https://webassembly.org/)
[![Edge Runtime](https://img.shields.io/badge/Edge-ready-black.svg)](https://vercel.com/docs/functions/edge-functions)
[![Bundle size](https://img.shields.io/bundlephobia/minzip/@getactra/actra)](https://bundlephobia.com/package/@getactra/actra)
[![ESM](https://img.shields.io/badge/module-ESM-blue.svg)]()
[![Node](https://img.shields.io/badge/node-%3E%3D18-green.svg)](https://nodejs.org/)
[![Deno](https://img.shields.io/badge/Deno-supported-black.svg)](https://deno.land/)
[![Bun](https://img.shields.io/badge/Bun-supported-black.svg)](https://bun.sh/)
[![Browser](https://img.shields.io/badge/browser-supported-brightgreen.svg)]()
[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare-Workers-orange.svg)](https://workers.cloudflare.com/)
[![Vercel Edge](https://img.shields.io/badge/Vercel-Edge-black.svg)](https://vercel.com/)
[![License](https://img.shields.io/github/license/getactra/actra)](https://github.com/getactra/actra/blob/main/LICENSE)

# Actra
### Decision Control for Software
**Admission Control for Agentic and Automated Systems**

![Actra Policy Enforced](https://img.shields.io/badge/Actra-Policy%20Enforced-16a34a?style=flat-square)

**Admission Control for Agentic and Automated Systems**

Actra introduces **Decision Control** — a runtime layer that evaluates policies **before operations execute**.

It allows systems to **permit or block actions safely**, preventing unsafe operations triggered by AI agents, APIs & automation systems
Expand All @@ -25,21 +38,29 @@ Actra protects operations in systems such as:
- background workers
- workflows and schedulers

<!-- ### Runs Everywhere
### Runs Everywhere
#### SDKs
Python • JavaScript • CLI

**Server**: Node • Bun • Deno
**Edge**: Cloudflare Workers • AWS Lambda • Vercel Edge • Netlify Edge • Fastly Compute@Edge
**Browser**: Web Browsers
**WASM Runtimes:** Wasmtime • Wasmer -->
**WASM Runtimes:** Wasmtime • Wasmer

---

## See Actra in Action

![MCP Demo](doc/mcp-demo.gif)

## Try in 30 seconds

Run Actra directly in your browser:

👉 https://actra.dev/playground.html

No setup required. Uses the real WASM engine.

### An AI agent attempted to call an MCP tool.

Actra evaluated policy and **blocked the unsafe operation before execution**.
Expand Down Expand Up @@ -116,6 +137,104 @@ Actra evaluates the policy **before the function executes** and blocks refunds g

---

## JavaScript Example


```javascript
import { Actra, ActraRuntime, ActraPolicyError } from "@getactra/actra";

// 1. Schema
const schema = `
version: 1

actions:
refund:
fields:
amount: number

actor:
fields:
role: string

snapshot:
fields:
fraud_flag: boolean
`;

// 2. Policy
const policyYaml = `
version: 1

rules:
- id: block_large_refund
scope:
action: refund
when:
subject:
domain: action
field: amount
operator: greater_than
value:
literal: 1000
effect: block
`;

// 3. Compile
const policy = await Actra.fromStrings(schema, policyYaml);

// 4. Runtime
const runtime = new ActraRuntime(policy);

// 5. Context resolvers
runtime.setActorResolver(() => ({ role: "support" }));
runtime.setSnapshotResolver(() => ({ fraud_flag: false }));

// 6. Protect function
function refund(amount) {
console.log("Refund executed:", amount);
}

const protectedRefund = runtime.admit("refund", refund);

// 7. Execute
await protectedRefund(200); // allowed

try {
await protectedRefund(1500); // blocked
} catch (e) {
if (e instanceof ActraPolicyError) {
console.log("Blocked by policy:", e.matchedRule);
}
}
```

## Python Example

```python
from actra import Actra, ActraPolicyError
from actra.runtime import ActraRuntime

schema = """..."""
policy_yaml = """..."""

policy = Actra.from_strings(schema, policy_yaml)
runtime = ActraRuntime(policy)

runtime.set_actor_resolver(lambda ctx: {"role": "support"})
runtime.set_snapshot_resolver(lambda ctx: {"fraud_flag": False})

@runtime.admit()
def refund(amount: int):
print("Refund executed:", amount)

refund(200)

try:
refund(1500)
except ActraPolicyError as e:
print("Blocked by policy:", e.matched_rule)
```

## Key Concepts

Actra evaluates policies using a small set of core concepts.
Expand Down Expand Up @@ -164,14 +283,22 @@ Governance policies operate **above normal admission policies**,
providing a control layer that validates policies themselves before
they are accepted.

## Installation
## Installation Python

```bash
pip install actra
```

See the **examples/** directory for quick start examples.

## Installation JavaScript

Install:

```bash
npm install @getactra/actra
```

---

## Architecture
Expand Down Expand Up @@ -253,23 +380,23 @@ Actra runs across **server, edge, and browser environments**.
| ---------------------- | ------------------- |
| Rust Core Engine | Available (Publishing Pending) |
| Python SDK | Available |
| JavaScript Runtime SDK | WIP |
| JavaScript Browser SDK | WIP |
| JavaScript Runtime SDK | Available |
| JavaScript Browser SDK | Available |
| Go SDK | Planned |

### JavaScript Runtime Compatibility

| Runtime | Status |
| ------------------ | --------|
| Node.js | WIP |
| Bun | WIP |
| Cloudflare Workers | WIP |
| AWS Lambda | WIP |
| Web Browsers | WIP |
| Deno | WIP |
| Fastly Compute@Edge | WIP |
| Vercel Edge Runtime | WIP |
| Netlify Edge Functions | WIP |
| Node.js | Available |
| Bun | Available |
| Cloudflare Workers | Available |
| AWS Lambda | Available |
| Web Browsers | Available |
| Deno | Available |
| Fastly Compute@Edge | Available |
| Vercel Edge Runtime | Available |
| Netlify Edge Functions | Available |

### Native WebAssembly Runtime Targets

Expand Down Expand Up @@ -324,17 +451,7 @@ Actra also supports **governance policies**, which validate operational policies

## Documentation

Full documentation coming soon.

Refer to the **examples** folder for detailed usage examples.

Planned documentation sections:

* policy language
* MCP integration
* agent safety
* runtime architecture
* advanced policy patterns
Full documentation available at https://docs.actra.com

---

Expand Down
Loading