@axtary/policy
v0.1.0
Published
Deterministic policy evaluation and Cedar/OPA mappings for Axtary agent actions.
Maintainers
Readme
@axtary/policy
Deterministic policy evaluation and Cedar/OPA mappings for Axtary agent actions.
Early 0.x release: the runtime path is real and tested, but the API is not stable yet and may change between minor versions.
npm install @axtary/policyWhat It Does
- Evaluates normalized Axtary actions against a local policy config.
- Returns
allow,deny, orstep_updecisions. - Ships first guardrails for GitHub PRs, GitHub content reads/writes, Slack posts, and Linear/Jira issue actions.
- Maps the same normalized action into Cedar-style principal/action/resource/context.
- Exposes OPA/Rego-compatible input JSON.
Quickstart
This example runs as-is with Node 20+:
import { evaluatePolicy, explainPolicyDecision } from "@axtary/policy";
import { demoAction } from "@axtary/actionpass";
// Deterministic decision for a normalized action: allow | deny | step_up.
const decision = evaluatePolicy(demoAction);
console.log(decision.decision, decision.reasons);
// Human-readable explanation for agents and reviewers.
console.log(explainPolicyDecision(decision).summary);Design Notes
The normalized action schema from @axtary/actionpass remains the source of truth. Policy evaluation is deterministic and fail-closed for unknown protected tools.
This package stays format-agnostic. @axtary/config loads YAML and passes the parsed policy object into this evaluator so the same deterministic decision path can be used by tests, the local proxy, and future MCP wrappers.
