Agent-Safe

OpenSSF Best Practices

Embed authorization in the token. 150 lines. Zero deps. Microseconds.

Parse + eval: ~15 μs  ·  Eval only: ~2 μs

The Problem with Policy Servers

Every authorization decision an AI agent makes currently requires a round-trip to a policy server. At agent scale — thousands of micro-decisions per second across thousands of agents — that's not a reliability problem. It's a throughput and latency tax on every operation.

SPL moves the policy into the token. The service that receives the request verifies it locally. The policy server only matters when minting the token, not when verifying it.

Latency Tax

OPA/Cedar add 1–5 ms per decision (network + evaluation). SPL evaluates in ~2 μs. That's 100–1,000x faster with no network in the path.

Throughput Bottleneck

1,000 agents × 100 decisions/min = 100K requests/min to your policy server. With SPL, it's zero.

Coarse-Grained Scopes

OAuth tokens grant broad access. SPL lets you say "only purchases under $50 for gift cards to family members, max 1 per day."

Architecture

Grantor
Signs token
Agent
Carries token
Service
verify(token)
Result
ALLOW / DENY

Token = signed SPL policy + Merkle root + hash-chain commitment + DPoP binding. One function call. No server.

The SQLite of agent authorization. You embed it. It's 150 lines. No server to deploy, no sidecar to manage, no protobuf to compile. When you outgrow it, you'll know.

Performance

Benchmarked on Apple M1 Max. Policy: family_gifts.spl (10 conjuncts including crypto predicates).

~2 μs
Eval only (Go & TypeScript)
~15 μs
Parse + Eval (Go)
0
Network round-trips
0
Runtime dependencies (TS, Go, Java, C#)

Honest Comparison

SystemPolicy in TokenLanguageLocal VerifyOffline BudgetsZero Deps
SPLYesS-expr (~150 LOC)YesYesYes
BiscuitYesDatalogYesNoProtobuf
MacaroonsCaveats onlyN/APartialNoHMAC lib
CedarNoFull policyServer-sideNoEngine
OPA/RegoNoRego (Turing-complete)Server-sideNoOPA server

Where Biscuit wins: third-party blocks, revocation IDs, token sealing (SPL now has this too), and production maturity. Where SPL wins: 150-line evaluator, zero dependencies, hash-chain offline budgets, and no protobuf in the critical path. Choose Biscuit when you need multi-org delegation. Choose SPL when you need the simplest thing that works.

Try It

Edit the policy or request and click Evaluate. This runs the full SPL evaluator in your browser — the same algorithm as all six server-side SDKs.

Get Started

TypeScript / Node.js
npm install agent-safe-spl
Go
go get github.com/jmcentire/agent-safe/sdk/go
Python
pip install agent-safe-spl
Rust
cargo add agent-safe-spl
Java (JDK 21+, from source)
cd sdk/java && mvn install
C# (.NET 10+, from source)
cd sdk/csharp && dotnet build

249 tests across 6 SDKs. Shared crypto test vectors ensure cross-language compatibility.

Privacy Stack

Agent-Safe is one layer of a larger privacy architecture. Each component addresses a different failure mode.

Signet

Cryptographic vault. Three-tier data model, ZK proofs, Ed25519 root of trust.

Tessera

Self-validating documents. Hash chain, Ed25519 signatures, embedded validators.

BlindDB

Storage the operator can't read. Client-side encryption, opaque record IDs.

HermesP2P

Ephemeral P2P messaging. No servers, no metadata, no persistence.