Skip to main content

Documentation Index

Fetch the complete documentation index at: https://parmanasystems.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Install

npm install @parmanasystems/core
Requires Node.js ≥ 20.

Run a governed decision

import crypto from "crypto";
import {
  executeFromSignals,
  LocalSigner,
  LocalVerifier,
  MemoryReplayStore,
  verifyAttestation,
} from "@parmanasystems/core";

// 1. Generate an Ed25519 keypair (use AWS KMS in production)
const { privateKey, publicKey } = crypto.generateKeyPairSync("ed25519", {
  privateKeyEncoding: { type: "pkcs8", format: "pem" },
  publicKeyEncoding:  { type: "spki",  format: "pem" },
});

const signer      = new LocalSigner(privateKey);
const verifier    = new LocalVerifier(publicKey);
const replayStore = new MemoryReplayStore();

// 2. Execute a governed decision
const result = await executeFromSignals(
  {
    policyId:      "claims-approval",
    policyVersion: "v1",
    signals: {
      insurance_active: true,
      risk_score:       42,
      vip_customer:     false,
      claim_amount:     8500,
    },
  },
  signer,
  verifier,
  replayStore
);

// 3. Inspect the attestation
console.log(result.execution_state);
// "completed"

console.log(result.decision);
// { action: "approve", requires_override: false, reason: "standard_approval" }

console.log(result.executionId);
// "a3f2b1c4d8e7f96a012b3c4d5e6f7890a1b2c3d4e5f6789012345678abcdef01"
// ↑ SHA-256 of (policyId + policyVersion + canonicalized signals)

console.log(result.signature);
// "v4F7mK3nQs8rXpLw2YbD9eHtNcAoGiUjZlV0TfRkMyPh1CxBs6WqJ5IuEdOgPm4Qa3bZwF2K8BNrHc+Ts1YxXD=="
// ↑ Ed25519 over canonical attestation JSON (64 bytes → 88-char base64)

// 4. Independently verify — no runtime state required
const valid = verifyAttestation(result, verifier);
console.log(valid); // true

What you just got back

Every governed execution returns an ExecutionAttestation:
FieldTypeMeaning
executionIdstringSHA-256 identity of this execution
execution_fingerprintstringDeterministic replay identity (same as executionId here)
policyIdstringThe policy that governed this decision
policyVersionstringExact version used
schemaVersionstringPolicy schema version
runtimeVersionstringParmana Systems runtime version at execution time
signalsHashstringSHA-256 of the canonical input signals
decision.action"approve" | "reject"The governance outcome
decision.requires_overridebooleanWhether human escalation is required
decision.reasonstringThe rule reason string
execution_state"completed" | "blocked" | "pending_override"Execution state
signaturestringEd25519 signature over canonical attestation JSON
runtimeHashstringHash of the runtime binary state

Possible execution states

StateMeaning
completedApproved, no override required — execution is done
blockedRejected by policy — execution did not proceed
pending_overrideRejected but flagged as requiring human escalation

Next steps

How it works

Understand the full pipeline from signals to attestation

Policies

Define your own governance rules

Verify an attestation

Portable verification without runtime state

Fintech use case

End-to-end insurance claims example