QNSP

Build Pattern · TypeScript

Build a FOIA-Aligned Public Records System

Controlled access, immutable audit logs, and retention policies aligned to FOIA-style workflows.

Manage public records with QNSP audit-service (tamper-evident chain), access-control-service (RBAC + per-record ACLs), and vault (retention-locked storage). FOIA-style request workflows with controlled access and selective indexing. Tenant-isolated by agency.

30 minTime to first PQC
TypeScriptPrimary SDK
3Services used

QNSP services used

Stack

Code

Real code, real SDK calls

Snippets reference the published @cuilabs/qnsp SDK surface (TypeScript, Python, Go, Rust mirror byte-for-byte).

FOIA-style request: gate access via RBAC + audittypescript
import { QnspClient } from "@cuilabs/qnsp";

const qnsp = new QnspClient({ apiKey: process.env.QNSP_API_KEY! });

// Check access via QNSP access-control-service
const allowed = await qnsp.access.check({
  principal: requesterId,
  resource: `record:${recordId}`,
  action: "read",
});

if (!allowed.granted) {
  await qnsp.audit.logEvent({
    eventType: "foia.access.denied",
    payload: { requesterId, recordId, reason: allowed.reason },
  });
  return { error: "ACCESS_DENIED" };
}

// Audit BEFORE returning record (regulator-grade evidence)
await qnsp.audit.logEvent({
  eventType: "foia.access.granted",
  payload: { requesterId, recordId, foiaRequestId },
});

const record = await qnsp.vault.getSecret(`record:${recordId}`);
return { payload: record.payloadB64 };

Ship it

Get an API key and start building