Skip to main content
The Parmana TypeScript SDK (@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:
  1. Proposes the action to Parmana as a Business Transaction (what, why, who, and the facts a policy needs to decide).
  2. Parmana decides, synchronously, evaluating a named policy version against those facts (amount limits, verification state, risk score, whatever the policy declares).
  3. Your system executes only if the decision is APPROVED — the SDK call throws ExecutionRejectedError otherwise, there’s no path where a rejected transaction silently proceeds.
  4. Proof is recorded: an ExecutionTrustRecord, signed (Ed25519 or ML-DSA-65, see Choose a signature provider), independently verifiable without trusting Parmana itself.
Result: the agent never holds the downstream credential. The policy decides, not the agent’s own reasoning about whether an action is safe.

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/else chain 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.
It’s a mismatch if you just need application logging (use a logger), have no consequential actions to gate (read-only lookups don’t need authorization), or want authorization decisions that can’t be expressed as a policy document evaluated against a fixed set of signals.

Core concepts

Unlike a design with a separate “authorize” step and a separate “execute” step, Parmana’s 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: an authority (who), an authorization (why — the stated purpose), an intent (what — action, target, parameters), a policy reference (name + version + schema version), and signals (the facts the policy evaluates). You build one with createBusinessTransaction() 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 a signature block 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 boundSignals a 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

Real, published, installable with a plain 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.