loading…
Search for a command to run...
loading…
Policy enforcement gateway for MCP tool calls, evaluating every tool invocation against declarative YAML policies (allow/deny/escalate-to-human), generating cry
Policy enforcement gateway for MCP tool calls, evaluating every tool invocation against declarative YAML policies (allow/deny/escalate-to-human), generating cryptographic hash-chained audit receipts, and including built-in content safety scanning.
Authensor
The open-source safety stack for AI agents
Every agent action evaluated. Every decision auditable. Every tool governed.
Quickstart · Why Authensor · Architecture · Packages · OWASP Coverage · EU AI Act
AI agents are shipping to production without guardrails. They call APIs, browse the web, execute code, and manage infrastructure — often with no policy enforcement, no approval workflows, and no audit trail.
Existing guardrails focus on what models say (prompt/response filtering). Authensor focuses on what agents do (action authorization, approval workflows, and cryptographic audit trails).
Authensor is four open-source tools that together cover the full surface area of agent risk:
| Tool | What it guards | How |
|---|---|---|
| Authensor | Agent actions (API calls, tool use, data access) | Policy engine + control plane with hash-chained receipts |
| SpiroGrapher | Agent web browsing | Compiles HTML to structured IR, detects dark patterns, constitutional rules |
| SafeClaw | Local agent execution | PreToolUse hook gating, deny-by-default, mobile approval workflows |
| SiteSitter | Website safety monitoring | Continuous governance for deployed sites |
git clone https://github.com/authensor/authensor.git
cd authensor
docker compose up -d
# Control plane running at http://localhost:3000
# Admin token printed to logs: docker compose logs control-plane
That's it. Postgres starts, migrations run, a bootstrap admin key is created, and a default-safe policy (deny-by-default) is provisioned. Aegis content safety and Sentinel monitoring are enabled out of the box.
npx safeclaw init --demo
npx safeclaw run "list my project files"
# Opens dashboard at localhost:7700 with policy enforcement + audit trail
import { Authensor } from '@authensor/sdk';
const authensor = new Authensor({
controlPlaneUrl: 'http://localhost:3000',
principalId: 'my-agent',
});
const result = await authensor.execute(
'stripe.charges.create',
'stripe://customers/cus_123/charges',
async () => stripe.charges.create({ amount: 1000, currency: 'usd' }),
{ constraints: { maxAmount: 10000 } }
);
// Receipt created, policy enforced, action audited
from authensor import Authensor
async with Authensor(
control_plane_url="http://localhost:3000",
principal_id="my-agent",
) as authensor:
result = await authensor.execute(
action_type="stripe.charges.create",
resource="stripe://customers/cus_123/charges",
executor=lambda: create_charge(),
constraints={"max_amount": 10000},
)
Drop-in integration for popular agent frameworks:
// LangChain / LangGraph
import { AuthensorGuardrail } from '@authensor/langchain';
const guardrail = new AuthensorGuardrail({ controlPlaneUrl: '...' });
// OpenAI Agents SDK
import { AuthensorGuardrail } from '@authensor/openai';
// CrewAI
import { AuthensorGuardrail } from '@authensor/crewai';
// Vercel AI SDK
import { AuthensorGuardrail } from '@authensor/vercel-ai-sdk';
// Claude Agent SDK
import { AuthensorGuardrail } from '@authensor/claude-agent-sdk';
// Claude Code (hooks-based integration)
// See docs/claude-code-hooks.md
| Capability | Authensor | AWS AgentCore + Cedar | Galileo Agent Control | NeMo Guardrails | Guardrails AI |
|---|---|---|---|---|---|
| Action authorization (pre-execution) | Yes | Yes | Yes | No (prompt/response) | No (output validation) |
| Content safety scanning (pre-eval) | Yes (Aegis) | No | No | Yes | Yes |
| Approval workflows (human-in-the-loop) | Yes (SMS, Slack, email, mobile PWA) | No | No | No | No |
| Cryptographic audit trail (receipts) | Yes (hash-chained, Sigstore) | No | No | No | No |
| Real-time anomaly detection | Yes (Sentinel) | No | No | No | No |
| Deny-by-default / fail-closed | Yes | Yes | No | No | No |
| Cloud-agnostic | Yes | No (AWS only) | Yes | Yes | Yes |
| Open source | Yes (MIT) | No (Cedar is, AgentCore isn't) | Yes (Apache 2.0) | Yes (Apache 2.0) | Yes (Apache 2.0) |
| MCP tool governance | Yes | No | No | No | No |
| Web browsing governance | Yes (SpiroGrapher) | No | No | No | No |
| Multi-party approval | Yes | No | No | No | No |
| Cross-agent chain tracing | Yes (parentReceiptId) | No | No | No | No |
| Session-level threat detection | Yes (forbidden sequences, risk scoring) | No | No | No | No |
| Budget enforcement | Yes (per-principal spending limits) | No | No | No | No |
| Shadow/canary policy testing | Yes | No | No | No | No |
| Framework adapters | 8 (LangChain, OpenAI, Vercel AI, Claude Agent, CrewAI, Claude Code, TS SDK, Python SDK) | 1 (Bedrock) | 1 (custom) | 1 (custom) | 1 (custom) |
Action-level, not prompt-level. Most guardrails filter what the model says. Authensor governs what the agent does — every tool call, API request, and side effect goes through policy evaluation before execution.
Defense in depth. Seven layers of safety in one stack:
Receipts, not just logs. Every action produces a structured, policy-versioned receipt recording what was requested, what policy decided, why, and what happened. Hash-chained for tamper evidence. This directly satisfies EU AI Act Article 12 (record-keeping) and SOX audit requirements.
Fail-closed by default. No policy loaded? Denied. Control plane unreachable? Denied. Unknown action type? Denied. This matches OWASP and NIST recommendations.
Cross-provider. Works with Claude, GPT, LangChain, CrewAI, Vercel AI, Claude Code, or any agent framework. Eight adapters, one safety layer for all your agents.
┌─────────────────────────────────────────────────────────────────────┐
│ Your Agent │
│ (Claude, GPT, LangChain, CrewAI, Vercel AI, custom, etc.) │
└──────────────────────────────┬──────────────────────────────────────┘
│ SDK / MCP / Hook
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Authensor Stack │
│ │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌──────────────┐ │
│ │ Aegis │→ │ Engine │→ │ Control │→ │ Sentinel │ │
│ │ (content │ │ (pure │ │ Plane │ │ (real-time │ │
│ │ safety) │ │ logic) │ │ (HTTP API)│ │ monitoring) │ │
│ └────────────┘ └────────────┘ └─────┬──────┘ └──────────────┘ │
│ │ │
│ ┌────────────┐ ┌────────────┐ ┌─────▼──────┐ ┌──────────────┐ │
│ │ SafeClaw │ │ SpiroGrapher│ │ Receipts │ │ Adapters │ │
│ │(local gate)│ │(web govern) │ │(hash chain)│ │(8 adapters) │ │
│ └────────────┘ └────────────┘ └────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
| Layer | Package | What It Does | Dependencies |
|---|---|---|---|
| Policy Engine | @authensor/engine |
Session rules, budget evaluation, constraint enforcement. Pure, synchronous, deterministic. | 0 |
| Aegis Content Scanner | @authensor/aegis |
15+ prompt injection rules, 22 MINJA memory poisoning rules, PII/credential scanning, exfiltration detection, multimodal safety. | 0 |
| Sentinel Behavioral Monitor | @authensor/sentinel |
EWMA/CUSUM baselines, deny-rate/latency/volume anomaly detection, chain depth and fan-out alerts. | 0 |
| Control Plane | @authensor/control-plane |
Hono + PostgreSQL HTTP API. Shadow/canary eval, TOCTOU protection, principal binding, Sigstore/Rekor integration. | Hono, pg |
| MCP Gateway | @authensor/mcp-server |
SEP authorization protocol (authorization/propose, authorization/decide, authorization/receipt). |
— |
Agent wants to act
│
▼
Action Envelope created (who, what, where, constraints)
│
▼
Aegis scans for injection, jailbreak, PII, memory poisoning
│
▼
Session rules check forbidden sequences + risk threshold
│
▼
Policy engine evaluates conditions, rate limits, budgets
│
▼
Decision: allow | deny | require_approval | rate_limited
│
▼
Receipt created (hash-chained, policy-versioned)
│
▼
Sentinel monitors for anomalies
│
▼
Action executes (or doesn't) → receipt updated
Action Envelope — describes what an agent wants to do:
{
"id": "uuid",
"timestamp": "2026-01-01T00:00:00Z",
"action": {
"type": "stripe.charges.create",
"resource": "stripe://customers/cus_123/charges",
"operation": "create",
"parameters": { "amount": 1000, "currency": "usd" }
},
"principal": { "type": "agent", "id": "my-agent" },
"context": { "sessionId": "sess_abc", "parentReceiptId": "uuid" },
"constraints": { "maxAmount": 10000, "currency": "USD" }
}
Receipt — permanent, auditable, hash-chained record:
{
"id": "uuid",
"envelopeId": "uuid",
"parentReceiptId": "uuid",
"decision": { "outcome": "allow", "policyId": "prod-v2", "policyVersion": "2.1.0" },
"status": "executed",
"receiptHash": "sha256:...",
"prevReceiptHash": "sha256:..."
}
| Package | Description | Deps |
|---|---|---|
@authensor/schemas |
JSON Schema definitions — single source of truth | 0 |
@authensor/engine |
Pure policy evaluation (conditions, sessions, budgets, constraints) | 0 |
@authensor/aegis |
Content safety scanner (injection, jailbreak, PII, memory poisoning, multimodal) | 0 |
@authensor/sentinel |
Real-time monitoring (EWMA/CUSUM anomaly detection, chain tracking, alerts) | 0 |
@authensor/control-plane |
HTTP API: evaluate, receipts, approvals, policies, budgets, shadow eval | Hono, pg |
@authensor/mcp-server |
MCP tools with policy enforcement (Stripe, GitHub, HTTP) | — |
@authensor/sdk |
TypeScript SDK for agent builders | — |
authensor |
CLI: authensor policy lint, authensor policy test, authensor policy diff |
— |
authensor (Python) |
Python SDK | — |
create-authensor |
Project scaffolder: npx create-authensor |
— |
@authensor/redteam |
Adversarial red-team test seeds (15 attack patterns, 5 categories, MITRE ATLAS mapped) | 0 |
| Package | Framework | Description |
|---|---|---|
@authensor/langchain |
LangChain / LangGraph | Guardrail + interrupt integration |
@authensor/openai |
OpenAI Agents SDK | Pre-execution guardrail |
@authensor/vercel-ai-sdk |
Vercel AI SDK | Middleware integration |
@authensor/claude-agent-sdk |
Claude Agent SDK | Tool-use guardrail |
@authensor/crewai |
CrewAI | Task guardrail |
| — | Claude Code | Hooks-based PreToolUse / PostToolUse integration |
@authensor/sdk |
TypeScript SDK | Direct integration for any TS agent |
authensor (Python) |
Python SDK | Direct integration for any Python agent |
| Tool | Description |
|---|---|
| SafeClaw | Local agent gating with PreToolUse hooks, mobile PWA dashboard, swipe-to-approve |
| SpiroGrapher | Web governance: HTML→IR compilation, 26 constitutional rules, dark pattern detection |
| SiteSitter | Website safety monitoring and governance |
Zero-dependency content scanner that runs before policy evaluation:
Detect privilege escalation through multi-action patterns:
[auth.login, admin.escalate] chains with glob matchingPer-principal spending limits with period-based resets:
Zero-dependency anomaly detection engine:
Test new policies alongside active ones without enforcement:
?shadow=policy-id query parameter or AUTHENSOR_SHADOW_POLICY_ID env varparentReceiptId links receipts across delegation chainsAuthensor addresses all 10 risks in the OWASP Top 10 for Agentic Applications (2026):
| OWASP Risk | Authensor Coverage |
|---|---|
| ASI01: Agent Goal Hijacking | Aegis pre-eval scanning + policy engine evaluates action intent, not input text |
| ASI02: Tool Misuse | Per-tool policies, parameter constraints, rate limits, budget caps |
| ASI03: Identity & Privilege Abuse | Principal binding, RBAC, ABAC conditions, session risk scoring |
| ASI04: Supply Chain Vulnerabilities | MCP tool governance, domain allowlisting, SSRF protection |
| ASI05: Unexpected Code Execution | Deny-by-default, explicit allowlisting, SafeClaw container mode |
| ASI06: Memory & Context Poisoning | Aegis memory poisoning detector (22 MINJA rules), hash-chained receipts |
| ASI07: Insecure Inter-Agent Communication | Cross-agent chain tracing (parentReceiptId), Sentinel chain depth alerts |
| ASI08: Cascading Failures | Kill switch, per-tool circuit breakers, rate limiting, Sentinel anomaly detection |
| ASI09: Human-Agent Trust Exploitation | Multi-party approval workflows, TOCTOU re-evaluation, shadow policy testing |
| ASI10: Rogue Agents | Fail-closed architecture, Sentinel behavioral baselines, forbidden action sequences |
See full OWASP alignment document for detailed mapping.
Authensor's architecture maps directly to major regulatory requirements:
| Method | Endpoint | Description | Role |
|---|---|---|---|
| POST | /evaluate |
Evaluate an action envelope | ingest, admin |
| POST | /evaluate?shadow=id |
Evaluate with shadow policy | ingest, admin |
| GET | /receipts |
List receipts | admin |
| GET | /receipts/:id |
Get a receipt | admin |
| GET | /receipts/:id/view |
Human-readable receipt viewer | admin |
| GET | /receipts/:id/chain |
Get cross-agent receipt chain | admin |
| GET | /receipts/:id/transparency |
Get Sigstore transparency proof | admin |
| POST | /receipts/:id/claim |
Claim a receipt for execution | executor, admin |
| POST | /receipts/:id/finalize |
Finalize execution | executor, admin |
| GET | /policies |
List policies | admin |
| POST | /policies |
Create a policy | admin |
| POST | /policies/:id/activate |
Activate a policy version | admin |
| POST | /approvals/:id/approve |
Approve a pending action | admin |
| POST | /approvals/:id/reject |
Reject a pending action | admin |
| GET | /budgets |
List budgets with utilization | admin |
| POST | /budgets |
Create/update a budget | admin |
| GET | /shadow/report |
Shadow evaluation divergence report | admin |
| GET | /controls |
Get kill switch / tool controls | executor, admin |
| POST | /controls |
Update controls | admin |
| POST | /keys |
Create API key | admin |
| GET | /keys |
List API keys | admin |
| POST | /keys/:id/principal |
Bind principal to key | admin |
| GET | /metrics/summary |
Usage metrics | admin |
| GET | /health |
Health check | public |
# Lint a policy for common issues
authensor policy lint policy.json
# Test a policy against scenarios
authensor policy test policy.json scenarios.json
# Diff two policy versions
authensor policy diff v1.json v2.json
# Prerequisites: Node.js 20+, Docker, pnpm
corepack enable
pnpm install
# Start the stack
docker compose up -d # Postgres + control plane
pnpm dev # Dev servers with hot reload
# Test (924+ tests across 16 packages)
pnpm test
# Build all packages
pnpm build
# Verify generated types match schemas
pnpm gen:check
Everything is open source. Self-host it all, or use the managed version:
| Self-Hosted (Free) | Hosted | |
|---|---|---|
| Policy engine | Yes | Yes |
| Control plane | Yes | Yes, managed |
| Aegis content safety | Yes | Yes |
| Sentinel monitoring | Yes | Yes, with dashboards |
| Receipts & audit trail | Yes | Yes, with retention SLA |
| Approval workflows | Yes | Yes, with SMS/email gateway |
| SpiroGrapher | Yes | Yes, with federated threat intel |
| OpenTelemetry export | Yes | Yes, pre-configured |
| Support | Community | Dedicated |
| Compliance reports | DIY | Automated |
| SLA | None | 99.9% uptime |
docker compose up -d
helm install authensor deploy/helm/authensor \
--set postgresql.auth.password=your-password \
--set controlPlane.env.AUTHENSOR_BOOTSTRAP_ADMIN_TOKEN=your-token
Modules available for AWS (ECS + RDS), GCP (Cloud Run + Cloud SQL), and Railway:
cd deploy/terraform/aws
terraform init && terraform apply
curl -fsSL https://raw.githubusercontent.com/authensor/authensor/main/install.sh | sh
We welcome contributions! See CONTRIBUTING.md for guidelines.
Authensor is built on the belief that safety tooling should not have a paywall. We open-source every line of safety code because the more people who use these tools, the safer agents get for everyone.
MIT — use it however you want.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"authensor-mcp-server": {
"command": "npx",
"args": []
}
}
}PRs, issues, code search, CI status
Database, auth and storage
Reference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.