Documentation

Mizara is a programmable authorization layer for AI agents. One call before your agent acts - deterministic, sub-10ms, with a signed receipt on every decision.

Quick start

TypeScript

npm install @mizara/sdk

import { createMizaraClient } from '@mizara/sdk';

const mizara = createMizaraClient({ policyPath: './policy.json' });

const result = await mizara.authorize({
  actor:    { id: 'agent_1', type: 'autonomous_agent' },
  action:   { name: 'delete_production_resource' },
  resource: { type: 'cloud_resource', id: 'res_1',
               attributes: { environment: 'production' } },
  context:  { client_id: 'acme_corp' },
});

if (result.status === 'ALLOW') {
  // proceed
} else {
  // result.enforcement.user_facing_error
}

Python

pip install mizara

from mizara import create_mizara_client

mizara = create_mizara_client(policy_path="./policy.json")

result = mizara.authorize(
    actor={"id": "agent_1", "type": "autonomous_agent"},
    action={"name": "delete_production_resource"},
    resource={"type": "cloud_resource", "id": "res_1",
              "attributes": {"environment": "production"}},
    context={"client_id": "acme_corp"},
)

if result.status == "ALLOW":
    pass  # proceed

Input schema

Every authorize() call takes four fields.

actorobjectrequired

The agent making the request. Fields: id (string), type (string), framework? (string, e.g. "langgraph").

actionobjectrequired

The action being requested. Fields: name (string), risk_profile? (string, e.g. "high_irreversible").

resourceobjectrequired

The resource being acted on. Fields: type (string), id (string), attributes? (object of arbitrary key-value pairs, e.g. { amount: 75, currency: "USD" }).

contextobjectoptional

Runtime context for policy evaluation. Any key-value pairs: client_id, target_jurisdiction, data_classification[], underlying_llm, etc.

Policy format

Policies are plain JSON files. No Rego, no Cedar. Each rule has a condition expression evaluated at runtime against the input.

{
  "policy_id": "pol_infra_guard_v1",
  "client_id": "acme_corp",
  "rules": [
    {
      "id": "rule_block_prod_delete",
      "target_action": "delete_production_resource",   // "any" matches all actions
      "condition": "resource.attributes.environment == 'production'",
      "effect": "DENY",
      "fallback_effect": "ALLOW",
      "remediation_message": "Production deletion requires approval."
    }
  ]
}

Condition syntax

Comparisonresource.attributes.amount <= 50.00
Equalitycontext.target_jurisdiction == 'EU'
Array containscontext.data_classification.contains('PII')
Arithmeticcontext.session_total + resource.attributes.amount <= 500
Logical ANDcontext.jurisdiction == 'EU' && resource.attributes.authorized == false
Logical ORactor.type == 'autonomous_agent' || context.elevated == true

Decision statuses

ALLOW

Action may proceed. enforcement.action_halted is false.

DENY

Action is blocked. enforcement.action_halted is true. enforcement.user_facing_error contains the remediation message.

REDACT

Action should proceed but sensitive data must be masked before it does. The caller is responsible for performing the redaction.

RE_ROUTE

Action requires alternative handling - typically a human approval queue. The caller decides how to route.

Hosted API

Use the hosted API instead of running the SDK locally. Requires an API key from signup.

POST
/api/v1/authorize

Evaluate whether an action should proceed. Body: the full authorize() input object.

GET
/api/v1/receipts/:id

Look up a past decision by receipt ID. Returns the full decision payload for audit.

GET
/api/v1/policies/:clientId

Fetch the active policy for a client.

PUT
/api/v1/policies/:clientId

Update policy rules. Body: { policy_id, rules[] }. Takes effect on the next authorize() call.

Auth header

Authorization: Bearer <your_api_key>

Integration examples