Install
Starting the server
The server is started by running the package entry point. Configure it via environment variables:| Variable | Description |
|---|---|
PORT | Port to listen on (default: 3000) |
HOST | Host to bind to (default: 0.0.0.0) |
PARMANA_API_KEY | Bearer token for authentication (omit for dev mode) |
PARMANA_SIGNING_KEY | PEM-encoded Ed25519 private key (env mode) |
PARMANA_SIGNING_KEY_PATH | Path to PEM key file (disk mode) |
AUDIT_DATABASE_URL | PostgreSQL connection URL (enables audit persistence and /audit/* routes) |
CORS_ORIGIN | Comma-separated allowed origins, or * (default: localhost:5173,localhost:8080) |
LOG_LEVEL | Pino log level (default: info in production, debug otherwise) |
API endpoints
| Method | Path | Description |
|---|---|---|
POST | /execute | Verify authority before execution — returns signed ExecutionAttestation |
POST | /verify | Verify an ExecutionAttestation signature and provenance |
POST | /evaluate | Dry-run policy evaluation — no attestation, no replay slot |
POST | /simulate | Full pipeline simulation — no side effects |
POST | /confirm-execution | Confirm a real-world action against an authorization |
GET | /health | Health check |
GET | /runtime/manifest | Runtime version, hash, and supported schema versions |
GET | /runtime/capabilities | Capability declarations for this runtime instance |
GET | /audit/decisions | Decision timeline (requires AUDIT_DATABASE_URL) |
GET | /audit/decisions/:executionId | Decision detail by execution ID (requires AUDIT_DATABASE_URL) |
GET | /audit/stats | Aggregate audit statistics (requires AUDIT_DATABASE_URL) |
GET | /audit/security | Security event summary (requires AUDIT_DATABASE_URL) |
GET | /audit/verifications/:executionId | Verification history for an execution (requires AUDIT_DATABASE_URL) |
POST /execute
Request:ExecutionAttestation):
POST /verify
Request: the fullExecutionAttestation object returned by /execute.
Response:
POST /evaluate
Dry-run evaluation — computes what decision would be made without issuing an attestation or consuming a replay slot. Request:POST /simulate
Full pipeline simulation. No attestation produced, no replay slot consumed. Request: same shape as/execute.
Response:
POST /confirm-execution
Verifies that a real-world action matches a prior governance authorization and returns a signedExecutionIntegrityProof.
Request:
ExecutionIntegrityProof):
GET /health
signing_mode is one of "env" (key from environment variable), "disk" (key from file), or "ephemeral" (generated at startup).
GET /runtime/manifest
Returns the active governance runtime manifest.GET /runtime/capabilities
Audit routes
All/audit/* routes are registered only when AUDIT_DATABASE_URL is set. They are rate-limited to 60 requests/minute and require bearer auth if PARMANA_API_KEY is set.
| Route | Query params |
|---|---|
GET /audit/decisions | limit, offset, policyId, decision (approve/deny/any), from, to |
GET /audit/decisions/:executionId | — |
GET /audit/stats | — |
GET /audit/security | from, to, limit |
GET /audit/verifications/:executionId | — |
Using with the SDK client
Use@parmanasystems/sdk-client as the companion HTTP client for this server. It provides typed methods for all endpoints.
Use Cases
Deploying a governance sidecar for a loan origination service
An NBFC runs the governance server as a sidecar next to its loan origination service. The origination service sendsPOST /execute with each loan application’s signals and receives a signed ExecutionAttestation. The sidecar is configured with a persistent signing key via PARMANA_SIGNING_KEY and uses AUDIT_DATABASE_URL to persist every decision to PostgreSQL for regulatory inspection:
POST /confirm-execution after funds are transferred.
Using /evaluate for pre-flight policy checks
Before collecting full KYC documentation, a loan app usesPOST /evaluate to check whether the applicant’s initial signals would qualify under the current policy. No attestation is issued and no replay slot is consumed — the response is a dry-run decision:
wouldDecide is "reject", the app surfaces a rejection message before the borrower completes the full application — saving time for both parties.
Audit query for SEBI reporting
A fintech running stock margin governance uses the/audit/* routes to pull decision timelines for a SEBI inspection. All routes require AUDIT_DATABASE_URL. A bearer token is set via PARMANA_API_KEY to restrict access:
ExecutionAttestation — independently verifiable using the public key, without requiring access to the live runtime.
See also
- SDK Client - typed HTTP client for this server
- Production Checklist
- API Reference - full function signatures and types