Core Features

Compliance Receipts

Generate cryptographically signed receipts for every AI action to prove compliance during audits.

Overview

Compliance receipts provide immutable, tamper-evident proof that governance policies were enforced for each AI action. Each receipt is cryptographically signed and can be verified independently.

Tamper-Evident

SHA-256 signatures prevent modification

Complete Audit Trail

Full context of every decision

Export Ready

JSON, PDF, or CSV formats

Generating Receipts

Receipts are a cloud artefact: Tork writes one when Tork itself makes the governance decision. Use @torknetwork/sdk (npm install @torknetwork/sdk), whose entry class is TorkClient — a different package from the on-device tork-governance family, which exports Tork.

javascript
import { TorkClient } from '@torknetwork/sdk';

const client = new TorkClient({ apiKey: process.env.TORK_API_KEY });

// Tork governs the call server-side and records a receipt
const result = await client.govern('Meeting tomorrow at 3pm', {
  agentId: 'agent-123',
  mode: 'redact',
});

console.log(result.action);      // 'allow' | 'redact' | 'deny'
console.log(result.receipt_id);
console.log(result.latency_ms);

There is no Python cloud SDK. From Python, call the REST API with a Bearer token:

python
import os, json, requests

TORK_API = "https://tork.network/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['TORK_API_KEY']}"}

# List the most recent receipts for your organisation
r = requests.get(f"{TORK_API}/receipts", headers=HEADERS,
                 params={"limit": 20, "offset": 0})
data = r.json()
print(data["total"])
for receipt in data["receipts"]:
    print(receipt["receipt_id"], receipt["action"], receipt["timestamp"])

Receipt Structure

A single receipt, as returned by GET /api/v1/receipts/{id}. Note what a receipt records and what it does not: metadata about the decision — never the prompt or completion text, and never detected PII values.

json
{
  "receipt_id": "rcpt_abc123xyz",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "action": "redact",
  "pii_types": ["email", "phone"],
  "pii_count": 2,
  "policy_version": "1.0.0",
  "organization_id": "org_9f3c...",
  "latency_ms": 12
}

Verifying Receipts

A proof export carries everything a third party needs to check the hash chain and the anchor offline, without trusting Tork at the moment of verification. The exact algorithm is published at receipt verification.

python
# Export a verifiable proof bundle for a date range
r = requests.get(f"{TORK_API}/receipts/proof-export", headers=HEADERS, params={
    "from": "2024-01-01",
    "to": "2024-01-31",
})
bundle = r.json()

with open("january_proof.json", "w") as f:
    json.dump(bundle, f)

Bulk Export

Export receipts for an audit period as JSON or CSV:

python
r = requests.get(f"{TORK_API}/receipts/export", headers=HEADERS, params={
    "from": "2024-01-01",
    "to": "2024-01-31",
    "agent_id": "agent-123",   # Optional filter
    "format": "csv",           # or "json"
    "limit": 1000,
})

with open("january_receipts.csv", "w") as f:
    f.write(r.text)

Receipts and the On-Device SDK

Supply an API key and the SDK additionally reports a metadata-only attestation of each decision — the action taken, PII type labels and counts, a risk classification, policy labels and a salted fingerprint. It never sends input text, output text or PII values. The decision itself is still made on-device and is never delayed or changed by reporting. Those attestations appear in your dashboard and are included in the daily on-chain anchor — each one recorded as a client attestation (capture_mode=edge, attested_by=client), a claim Tork recorded but did not execute and cannot independently verify. Requires tork-governance 0.24.0+ (PyPI) or 0.11.0+ (npm).

A decision reported by an on-device SDK is recorded as a client attestation (capture_mode=edge, attested_by=client): a claim Tork recorded but did not execute and cannot independently verify. A decision made by @torknetwork/sdk is recorded as capture_mode=cloud, attested_by=tork — Tork made that call itself. Both are equally immutable once anchored; they differ in what is immutable. A client attestation freezes your claim. A server-governed receipt freezes Tork's own decision.

Local governance is free and unlimited — decisions made on your own machine are never metered. Evidence is what is metered: attestations, receipts and anchoring.

Compliance Tip: Receipts are retained for 7 years by default. Configure retention in Admin Settings.

Documentation

Learn to integrate TORK

Upgrade Plan

Current: free

Support

Get help from our team