Skip to main content
[AVAILABLE], every command below was run against a live local server on 2026-07-12 (commit 651497a), including python/examples/quickstart/run.py itself.

1. Install dependencies

npm install

2. Generate a local Gateway keypair

The Execution Gateway signs its own attestations with a keypair separate from the authorization-verification key (keys/default.*.pem, already committed for local dev). No key is generated automatically, you have to create one:
npm run generate:gateway-keys
This runs scripts/generate-keypair.ts --algorithm ed25519 --key-id gateway, writing keys/gateway.private.pem / keys/gateway.public.pem. keys/ is gitignored, this stays local. See createGatewayKeyPair.ts for why this key is deliberately separate from the authorization key, and Deploy patterns for how to manage it outside local dev.

3. Start the Runtime locally

The committed .env defaults to Supabase-backed storage. To run fully locally with no external dependency, override storage to memory. The one connector wired into the default server, vendor-payment, is a reference mock that reads its credential from an environment variable, set a placeholder value for it:
PARMANA_STORAGE=memory \
  PARMANA_POLICY_DIR=/absolute/path/to/policies \
  VENDOR_PAYMENT_TOKEN=quickstart-demo-token \
  npm run dev
Confirm it’s up:
curl http://localhost:3000/health
# {"status":"UP"}
curl http://localhost:3000/version
# {"name":"Parmana","version":"0.4.0","api":"v1"}
The Execution Gateway is wired into this server unconditionally (createExecutionSystem() always returns createExecutionGateway(), packages/api/src/bootstrap/createExecutionSystem.ts). Every POST /execute is independently re-verified and routed through a real Connector. An action with no registered connector fails closed with "No connector registered for action", it does not silently skip enforcement. See The gateway.

4. Install the Python SDK

pip install -e ./python

5. Execute a Business Transaction

from datetime import UTC, datetime
from uuid import uuid4

from parmana import (
    Authority, Authorization, BusinessTransaction,
    BusinessTransactionMetadata, Intent, ParmanaClient, PolicyReference,
)

client = ParmanaClient(endpoint="http://localhost:3000")

transaction_id = str(uuid4())
now = datetime.now(UTC)

transaction = BusinessTransaction(
    business_transaction_id=transaction_id,
    metadata=BusinessTransactionMetadata(
        business_transaction_id=transaction_id,
        correlation_id="quickstart",
        tenant_id=None,
        source_system="python-sdk-quickstart",
        submitted_by="sdk-demo",
        submitted_at=now,
    ),
    authority=Authority(
        authority_id="authority-001", authority_type="SERVICE",
        principal_id="python-sdk", display_name="Python SDK Quickstart", issued_at=now,
    ),
    authorization=Authorization(
        authorization_id="authorization-001", authority_id="authority-001",
        purpose="Quickstart demo", issued_at=now,
    ),
    intent=Intent(
        intent_id="intent-001", authorization_id="authorization-001",
        action="payments:execute", target="vendor://payments",
        parameters={"amount": 1000, "currency": "USD"}, created_at=now,
    ),
    policy=PolicyReference(name="vendor-payment", version="2.0.0", schema_version="1.0.0"),
    signals={
        "vendorVerified": True, "invoiceVerified": True, "paymentApproved": True,
        "sufficientFunds": True, "paymentAmount": 1000, "riskScore": 5,
    },
    status="RECEIVED",
    created_at=now,
)

trust_record = client.execution.execute(transaction)
print(trust_record.trust_record_hash)
Full runnable version: python/examples/quickstart/run.py, this is the same transaction it sends.

6. Real output

Captured from an actual run, 2026-07-12 (IDs and hashes differ on every run):
Trust Record Hash: fdb313e82c7cd86cf5f1dfb0ab90ac72f550a67a91891ebfce9462a73e9da103
The full ExecutionTrustRecord includes the signature block, executions[0].decision (outcome: APPROVED, evaluated by the vendor-payment policy), executions[0].evidence (what the connector actually did, including a connectorEvidenceHash), and an initial verifications / receipts history. See Trust Record for the complete shape.

Next

How Parmana thinks

The concepts behind what just happened: policy, authorization, the gateway, trust records.

Verify & replay

Read back or re-run verification against the record you just created.