Sovereign Security Architecture

Enterprise Security & Cryptography

Project Pak-LLM is built upon a defense-in-depth security model combining an AES-256-GCM credential vault, HMAC integrity tags, HMAC-SHA256 webhook verification, hybrid sovereign data boundaries, and automated PII redaction.

Domestic Control Plane

Hybrid Sovereign Cloud & Data Flow

Pak-LLM operates a hybrid sovereign model: account governance, PII scrubbing, RAG metadata, and domestic payment clearing reside under Pakistani jurisdiction, while inference executes via audited Zero-Data-Retention accelerators.

  • Domestic control plane: Karachi tenant boundaries with PII scrubbing
  • Confidential inference: Ephemeral in-memory execution via Groq, Hugging Face, Render
  • Zero Data Retention (ZDR): Customer prompts are never stored or used to train models
  • Air-gapped on-premise option: Full local appliance deployment for banking and defense
Private Foundation

Model Provenance & Attestation

PakLLM_Coder is a private, sovereign enterprise foundation model (not public open-weights) licensed exclusively for on-premise hardware and sovereign cloud deployments.

  • Private bilingual model served only through the platform; weights are not distributed
  • Cryptographic SHA-256 integrity attestation for platform release artifacts
  • Strict internal audit guarantee: ZERO customer code or prompt training
  • PECA 2016 and Wasatiyyah Shariah algorithmic alignment
SHA-256 Sealed

Cryptographic API Gateway

All API keys generated via the Admin Dashboard are hashed immediately using one-way SHA-256 with salted tenant identifiers. Raw keys are never stored in plaintext and cannot be recovered if lost.

  • Granular RBAC scopes (chat:completions, embeddings, models:read, admin:all)
  • Sliding-window token bucket rate limiting (10 to 600 RPM)
  • Optional client IP address allow-listing and auto-expiry schedules
  • Instant zero-downtime key revocation from the Admin Console
Signed Delivery

HMAC-SHA256 Webhook Dispatcher

Every outbound event dispatch (chat completions, workflow approvals, courier dispatches) is cryptographically signed with a tenant-unique secret using HMAC-SHA256.

  • Standard signature header: x-pakllm-signature-256 (sha256=...)
  • Replay attack prevention with strict unix timestamp validation
  • Automated exponential backoff retries with delivery status audit logs
  • Payload integrity verification compatible with standard enterprise receivers
AES-256-GCM + HMAC

Credential Vault & Integrity Controls

Credentials are sealed with AES-256-GCM and every execution carries a keyed HMAC integrity tag. Post-quantum (ML-KEM / ML-DSA) migration is on the roadmap and is not implemented yet, so we do not claim FIPS 203/204 conformance.

  • AES-256-GCM authenticated encryption for Sovereign Vault secrets
  • HMAC-SHA3-512 integrity tags on workflow execution receipts
  • TLS 1.3 and HSTS Preload at the public edge (no application-level lattice KEM)
  • AES-256-GCM authenticated symmetric encryption at rest
Deterministic Filter

Amanah Gate PII & Shariah Redaction

Built-in domestic interceptor scanning inbound prompts and outbound completions in real time to scrub sensitive citizen information before it ever reaches volatile memory.

  • Automated Pakistani CNIC format redaction (XXXXX-XXXXXXX-X)
  • Domestic banking IBAN and account number sanitization
  • Proactive blocking of usurious (Riba) and deceptive (Gharar) financial schemes
  • Zero model training — prompts execute under strict Zero Data Retention (ZDR) terms
Webhook Signature Verification Pattern
RFC 2104 HMAC-SHA256

When Pak-LLM dispatches an event to your webhook URL, inspect the x-pakllm-signature-256 header and verify using your webhook secret:

import crypto from "crypto";

export function verifyPakLlmSignature(payloadRawBody: string, signatureHeader: string, secret: string): boolean {
  const expectedSignature = `sha256=${crypto.createHmac("sha256", secret).update(payloadRawBody).digest("hex")}`;
  return crypto.timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expectedSignature));
}

Vulnerability Disclosure & Hall of Fame

We welcome independent security researchers to audit our public endpoints and reporting mechanisms under our coordinated vulnerability disclosure program.