@parmana/sdk) lets you integrate authorization into Node.js
applications, AI agents, and backend services. Before any action executes, your code asks
Parmana: “is this allowed?” — and gets back a cryptographically signed answer, not just a
boolean.
What it solves, in 30 seconds
Your AI agent wants to issue a refund. Instead of handing it a payment-provider API key directly, your code:- Proposes the action to Parmana as a Business Transaction (what, why, who, and the facts a policy needs to decide).
- Parmana decides, synchronously, evaluating a named policy version against those facts (amount limits, verification state, risk score, whatever the policy declares).
- Your system executes only if the decision is
APPROVED— the SDK call throwsExecutionRejectedErrorotherwise, there’s no path where a rejected transaction silently proceeds. - Proof is recorded: an
ExecutionTrustRecord, signed (Ed25519 or ML-DSA-65, see Choose a signature provider), independently verifiable without trusting Parmana itself.
When to use it
Reach for the TypeScript SDK if:- You have an AI agent (LangChain.js, the Vercel AI SDK, a custom loop) that takes actions with real consequences.
- You need a durable, signed record of who did what, when, and under which policy — not just an application log line.
- You want a named, versioned policy to decide, instead of an
if/elsechain buried in the agent’s own code. - You’re wiring an agent to a real system — a payment provider, a CRM, a vendor API — and don’t want that system’s credentials anywhere near agent-generated text.
Core concepts
POST /execute does both in one round trip: the decision and the execution outcome come
back together, in the ExecutionTrustRecord. There’s no intermediate authorization token
to pass to a second call.
BusinessTransaction— the request: anauthority(who), anauthorization(why — the stated purpose), anintent(what — action, target, parameters), apolicyreference (name + version + schema version), andsignals(the facts the policy evaluates). You build one withcreateBusinessTransaction()rather than assembling these five nested objects and their cross-referenced ids by hand.ExecutionTrustRecord— the response: the transaction as accepted, the decision (outcome: "APPROVED" | "REJECTED", which policy rule matched), the execution outcome and evidence if it ran, and asignatureblock you or anyone else can verify independently (see Verify independently).- Policy — a named, versioned document your Runtime deployment loads
(
PARMANA_POLICY_DIR), not something the SDK defines. See Write your first policy. - Signals — the facts a policy’s rules reference. Every signal a rule needs must be
present, and any
boundSignalsa policy declares are cross-checked against the matching intent field before evaluation runs at all — a mismatch is rejected as a binding-tamper attempt, not silently ignored (see Content binding & TOCTOU).
Install
npm install — see TypeScript SDK
for the install verification and package history.
Quick example
Real-world example: a payment refund
The same shape, applied to an actual connector instead of the local test fixture — this is what End-to-end: agent → Parmana → Paytm runs against real, live infrastructure:What Parmana guarantees
- The agent never holds the downstream credential — only a registered Connector does, and only for connectors currently configured (see Credential isolation).
- The decision is made by a named, versioned policy, not by agent reasoning.
- A rejected transaction throws
ExecutionRejectedError— there is no code path where a rejection is silently treated as success. - Every execution produces a signed
ExecutionTrustRecord, verifiable without trusting Parmana itself. - Signal-to-intent binding is checked before policy evaluation runs, closing the gap where an agent could satisfy a policy’s signals while pointing the actual execution somewhere else.
- Full audit trail: who proposed it, what was decided, what ran, and proof of both.
Next
TypeScript SDK Quickstart
Running end-to-end, locally, in under 10 minutes.
TypeScript SDK for AI Agents
LangChain.js, the Vercel AI SDK, and server-side integration patterns.
TypeScript SDK in Production
Config, error handling, retries, audit logging, and a deployment checklist.
TypeScript SDK reference
The exhaustive reference: full error taxonomy, model types, test suite.