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.
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 # proceedEvery authorize() call takes four fields.
actorobjectrequiredThe agent making the request. Fields: id (string), type (string), framework? (string, e.g. "langgraph").
actionobjectrequiredThe action being requested. Fields: name (string), risk_profile? (string, e.g. "high_irreversible").
resourceobjectrequiredThe resource being acted on. Fields: type (string), id (string), attributes? (object of arbitrary key-value pairs, e.g. { amount: 75, currency: "USD" }).
contextobjectoptionalRuntime context for policy evaluation. Any key-value pairs: client_id, target_jurisdiction, data_classification[], underlying_llm, etc.
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
resource.attributes.amount <= 50.00context.target_jurisdiction == 'EU'context.data_classification.contains('PII')context.session_total + resource.attributes.amount <= 500context.jurisdiction == 'EU' && resource.attributes.authorized == falseactor.type == 'autonomous_agent' || context.elevated == trueALLOWAction may proceed. enforcement.action_halted is false.
DENYAction is blocked. enforcement.action_halted is true. enforcement.user_facing_error contains the remediation message.
REDACTAction should proceed but sensitive data must be masked before it does. The caller is responsible for performing the redaction.
RE_ROUTEAction requires alternative handling - typically a human approval queue. The caller decides how to route.
Use the hosted API instead of running the SDK locally. Requires an API key from signup.
/api/v1/authorizeEvaluate whether an action should proceed. Body: the full authorize() input object.
/api/v1/receipts/:idLook up a past decision by receipt ID. Returns the full decision payload for audit.
/api/v1/policies/:clientIdFetch the active policy for a client.
/api/v1/policies/:clientIdUpdate policy rules. Body: { policy_id, rules[] }. Takes effect on the next authorize() call.
Auth header
Authorization: Bearer <your_api_key>LangGraph (TypeScript)
Authorization node in a LangGraph StateGraph - runs before tool execution.
View on GitHub →
LangGraph (Python)
Same pattern in Python - works with the langgraph package.
View on GitHub →
OpenAI Agents SDK (TypeScript)
mizara_authorize as a @function_tool in an OpenAI agent.
View on GitHub →
OpenAI Agents SDK (Python)
Same integration in Python using @function_tool decorator.
View on GitHub →