Skip to main content

Core Concepts

Actra helps you control what runs before it runs by evaluating policies inside your application runtime.

Before going deeper into the DSL, it helps to understand the seven core concepts that make up every Actra policy flow.


1) Schema

A schema defines the data shape that policies are allowed to reference.

It acts as the contract between your application and the policy engine.

Typical schema domains include:

  • actions → function inputs
  • actor → caller identity
  • snapshot → external system state

Without a schema, policies cannot safely reason about data.


2) Policy

A policy is a set of rules that decides whether an action should be allowed or blocked.

Each rule contains:

  • a scope
  • a condition
  • an effect

Policies are compiled once and reused by the runtime.


3) Runtime

The runtime is the execution layer that applies compiled policies before your function runs.

It is responsible for:

  • loading the compiled policy
  • resolving actor context
  • resolving action payload
  • resolving snapshot state
  • evaluating matching rules
  • blocking execution when required

This is what powers:

runtime.admit("refund", refund)

4) Governance

Governance defines what a policy is allowed to control and the boundaries within which it executes.

It answers questions like:

  • Which actions can be governed?
  • Which fields can policies inspect?
  • Which effects are valid?
  • What execution guarantees exist?

Governance makes policies:

  • deterministic
  • safe
  • portable
  • reviewable

This is what makes Actra more than a simple rule engine.


5) Actor

The actor represents who or what is attempting the action.

Examples:

  • user role
  • service identity
  • AI agent name
  • workflow system

Actor data is usually provided dynamically through an actor resolver.


6) Action

The action represents what is being attempted right now.

It is the primary runtime payload evaluated by Actra and usually maps to:

  • a function call
  • an API operation
  • a workflow step
  • an agent tool invocation
  • a deployment event

Typical action fields include:

  • type
  • amount
  • environment
  • resource_id
  • operation_mode

The action.type field is especially important because it determines which action-scoped rules are evaluated first.

This makes action the highest-priority decision context during runtime evaluation.


7) Snapshot

A snapshot represents external runtime state.

This can include:

  • fraud flags
  • deployment state
  • account status
  • quota usage
  • workflow approvals

Snapshots let policies reason about the current world before execution.


Mental Model

Think of every Actra execution as:

Schema defines the data contract
Policy defines the rules
Actor identifies the caller
Action defines the attempted operation
Snapshot defines current state
Runtime enforces before execution

This mental model scales naturally from simple API checks to governed AI agents and workflow controls.


Next Steps

  • Explore the full DSL Overview
  • Learn Schema and Policy blocks in depth
  • Build multi-rule policies with actor, action, and snapshot context