ZTDS.ai Open AI Security Standard
Developer Engine · Apache 2.0 Dual License

Developer SDK & Pre-Built Connectors

Drop-in, client-side zero-trust data sanitization for modern AI pipelines. Choose between the open reference engine @ztds/core (Apache 2.0) and the enterprise production engine @privacyscrubber/sdk. Both execute in < 0.8ms in local host process memory with 0.00 bytes socket egress.

$ npm install @privacyscrubber/sdk
Architecture Definition (RFC v1.0)

ZTDS Developer SDK is an in-memory runtime engine and set of pre-built connectors that sanitizes sensitive data inside local host process memory prior to external network socket transmission, guaranteeing 0.00 bytes socket egress, sub-millisecond execution (<0.8ms), and lossless client-side detokenization for LLM pipelines.

Dual-Tier Implementation Architecture

Open Reference Engine & Enterprise Hardened Runtime

The ZTDS standard operates on a strictly demarcated two-tier model: choose between the community-governed open-source baseline engine (@ztds/core · Apache-2.0) and the enterprise-grade production runtime (@privacyscrubber/sdk · 30 Commercial Profiles).

Open Source (Apache-2.0)
@ztds/core
Free community baseline. 4 Invariants, universal regex rules.
npm i @ztds/core
Enterprise Engine
@privacyscrubber/sdk
SIMD WebAssembly, 30 sector profiles, offline air-gap node licensing.
npm i @privacyscrubber/sdk
Local Latency
< 0.8 ms
OSF Benchmark (10.17605/OSF.IO/5BYJF)
Socket Egress
0.00 Bytes
Zero outbound network telemetry
Memory Security
Volatile RAM
Wiped on process termination
Legal Exemption
Zero-DPA
GDPR Art. 28 computational utility
Data Plane Primitive

In-Memory Execution Architecture

Invariant 1 · 0.00 Bytes Egress
Step 01 · Client Host
Raw Ingestion in RAM

Cleartext PII, PHI, API secrets, or proprietary code loaded into process volatile memory before dispatch.

Client Volatile Memory
Step 02 · Local Tokenizer
In-Memory Sanitization

Generates deterministic surrogates ([NAME_1], [IBAN_1]) in <0.8ms. Maps cleartext keys in volatile sessionMap.

< 0.8ms · Invariant 2
Step 03 · Egress Wire
External AI Provider

OpenAI, Claude, Gemini, or Pinecone processes sanitized context. Zero bytes cleartext cross the socket perimeter.

0 Bytes Egress Exposure
Step 04 · Client Host
Local Lossless Reversal

Surrogate tokens restored to cleartext locally in volatile memory. Mapping destroyed on process termination.

Zero Disk Persistence
RFC v1.0 CANONICAL BLUEPRINTS

10 Canonical Architectural Integration Blueprints

Production-ready, copy-pasteable zero-trust connectors executing in <1ms in local memory.

ztds-langchain-callback.ts
Blueprint 01 · LangChain BaseCallbackHandler Middleware Transparently intercepts prompts and completions across any LCEL chain, ChatOpenAI, ChatAnthropic, or LangGraph agent with zero cleartext network egress.
// ztds-langchain-callback.ts
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
import { LLMResult } from "@langchain/core/outputs";
import { ZTDSEngine } from "@privacyscrubber/sdk";
import { ChatOpenAI } from "@langchain/openai";

export class ZTDSCallbackHandler extends BaseCallbackHandler {
  name = "ZTDSCallbackHandler";
  private engine: ZTDSEngine;
  private sessionMaps: Map<string, Record<string, string>> = new Map();

  constructor(profile: "general" | "healthcare" | "fintech" | "legal" = "general") {
    super();
    this.engine = new ZTDSEngine({ profile });
  }

  // 1. Intercept and sanitize prompts in volatile RAM before socket creation
  async handleLLMStart(llm: { name: string }, prompts: string[], runId: string) {
    for (let i = 0; i < prompts.length; i++) {
      const { sanitizedPrompt, sessionMap } = this.engine.sanitize(prompts[i]);
      prompts[i] = sanitizedPrompt; // In-place payload replacement
      this.sessionMaps.set(runId, sessionMap);
    }
  }

  // 2. Losslessly restore cleartext strictly inside local client RAM
  async handleLLMEnd(output: LLMResult, runId: string) {
    const sessionMap = this.sessionMaps.get(runId);
    if (!sessionMap) return;

    for (const generations of output.generations) {
      for (const gen of generations) {
        gen.text = this.engine.reveal(gen.text, sessionMap);
      }
    }
    this.sessionMaps.delete(runId); // Wipe volatile RAM sessionMap immediately
  }
}

// Drop-in usage:
const model = new ChatOpenAI({
  modelName: "gpt-4o",
  callbacks: [new ZTDSCallbackHandler("healthcare")]
});
JSON-RPC 2.0 · STDIO TRANSPORT

Model Context Protocol (MCP) Stdio Gateway

Air-gapped integration for Cursor IDE, Claude Desktop, and Claude Code CLI with 0.00 bytes external telemetry.

RFC v1.0 Compliant
MCP Stdio Communication Protocol
Claude Desktop / Cursor IDE Prompt & Code Buffers
← JSON-RPC 2.0 via stdio → Zero Socket Telemetry
@privacyscrubber/mcp-server Volatile RAM Sanitization Engine
ztds_sanitize_prompt

Intercepts developer prompt buffers, git diffs, and terminal logs, replacing cleartext secrets and PII with context-preserving surrogate tokens before LLM dispatch.

Returns: sanitizedPrompt, sessionKey
ztds_restore_response

Restores surrogate tokens back to original values within the IDE interface strictly in volatile RAM, immediately purging private mapping keys.

Returns: restoredPrompt
ztds_verify_compliance

Performs real-time AST linting on active editor files to detect un-sanitized LLM calls, hardcoded secrets, or storage persistence violations.

Returns: compliant, score, auditHash

1-Click Client Configuration

Select your AI development environment to copy the exact air-gapped stdio connector snippet:

.cursor/mcp.json
{
  "mcpServers": {
    "privacyscrubber": {
      "command": "npx",
      "args": ["-y", "@privacyscrubber/mcp-server@latest"],
      "env": {
        "ZTDS_PROFILE": "dev",
        "ZTDS_LOCAL_ONLY": "true"
      }
    }
  }
}
Zero Socket Calls · stdio Pipe Transport Only
Get Certified →
Ecosystem Coverage

AI Framework Compatibility Matrix

6 Supported Environments
Framework / Tool Integration Method Latency Budget Token Reversibility Air-Gap Status Audit Trail
LangChain & LangGraph ZTDSCallbackHandler < 1.1 ms Lossless Reversible 100% Offline Session Hash
LlamaIndex (RAG Pipelines) ZTDSTransformation < 0.9 ms Vector Immunized 100% Offline SHA-256 Checksum
Cursor & Claude Code CLI MCP Stdio Gateway < 1.5 ms Interactive In-IDE Local Stdio Only Local Audit Log
Ollama & Local vLLM Reverse Proxy Loopback < 0.8 ms Streaming Reversal Fully Air-Gapped Invariant Proof
Vercel AI SDK Stream Transform Hook < 1.2 ms Bidirectional Stream Edge Runtime Safe Zero-Telemetry
CrewAI & AutoGen Inter-Agent Role Filter < 1.0 ms Per-Agent Session Localhost Only State Isolation
Predictable Pricing SSOT

Licensing & Commercial Distribution

Calculate Enterprise ROI →
Open Specification

Open Source Core

$0 / Free Forever

Permissive Apache 2.0 reference implementation, community regex detectors, and CLI audit tooling.

  • ✓ Full ZTDS RFC v1.0 Spec
  • ✓ CLI Scanner (npx ztds-audit)
  • ✓ Baseline General PII Rules
  • ✓ Community GitHub Support
Read RFC v1.0 Spec →
Most Popular
Developer Pro

Developer Annual SDK

$1,990 / year ($199/mo)

Commercial license for production microservices, pre-built AI framework connectors, and verified registry listing.

  • ✓ Headless @privacyscrubber/sdk
  • ✓ LangChain & LlamaIndex Connectors
  • ✓ Cursor & Claude Code MCP Server
  • ✓ Verified Registry Badge & Backlink
  • ✓ Unlimited backend microservice nodes
Enterprise GRC

Air-Gapped & Enclaves

$12,000 / year

Sovereign confidential computing deployment, custom NER entity profiles, and turnkey CISO DPA exemption documentation.

  • ✓ AWS Nitro Enclaves Attestation
  • ✓ 30 High-ACV Industry Profiles
  • ✓ Turnkey Zero-DPA Compliance Pack
  • ✓ SIG Lite / CAIQ / VSAQ Responses
  • ✓ Dedicated SLA & Security Support
Enterprise Invariant Scope →
Asymmetric Cryptography · Ed25519 (RFC 8032)

Zero-Telemetry Offline License Activation

How commercial licenses ($1,990/yr and $12,000/yr) unlock enterprise nodes and 30 industry profiles strictly in local memory without external network calls.

0.00 B Egress <120μs Verification
# 1. Set environment variable in air-gapped node or Docker container:
export ZTDS_LICENSE_KEY="ZTDS-LIC-v1.eyJjdXN0b21lci...wKfZEL5HHw"
# 2. Or initialize directly in your microservice / LangChain handler:
const { ZTDSEngine } = require("@privacyscrubber/sdk");

const engine = new ZTDSEngine({
  licenseKey: process.env.ZTDS_LICENSE_KEY,
  profile: "healthcare" // Unlocked via Enterprise License
});

// Sanitizes prompts with zero external telemetry
const sanitized = await engine.sanitize(patientPrompt);
100% Offline Cryptographic Integrity

The engine embeds only the public verification key. Digital signatures are verified locally in volatile RAM in under 0.12ms. Zero phone-home beacons, zero telemetry, zero licensing heartbeats.

Anti-Cannibalization Profile Gating

Baseline consumer PII (REGEX_RULES) runs on the open tier. Specialized enterprise profiles (PROFILE_RULES: HIPAA Clinical PHI, Financial IBAN, Legal Privilege) are unlocked cryptographically via the Enterprise Air-Gapped license.

60-Day Accounts Payable Grace Period

Enterprise annual renewals include an automated 60-day operational grace period past expiration, ensuring mission-critical AI pipelines never suffer unexpected production outages during corporate procurement cycles.

Ed25519 Offline Token Decoder & In-Memory Verifier
Verification Latency: —
Automated Pre-Merge Assurance

Continuous Compliance in CI/CD (.github/workflows)

Prevent regression by failing pull requests that transmit unmasked PII or introduce network egress prior to sanitization.

GitOps Verified
.github/workflows/ztds-audit.yml
name: ZTDS Invariant Audit Gate

on:
  pull_request:
    branches: [main, master]
  push:
    branches: [main]

jobs:
  ztds-verification:
    name: Zero-Trust Invariant Conformance
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Codebase
        uses: actions/checkout@v4

      - name: Setup Node.js Runtime
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'

      - name: Install Dependencies
        run: npm ci

      - name: Execute ZTDS Invariant Auditor (CLI)
        run: |
          npx ztds-audit --dir ./src --strict --json > ztds-report.json
          cat ztds-report.json

      - name: Enforce Zero-Egress Pass Requirement
        run: |
          grep -q '"status":"PASS"' ztds-report.json || {
            echo "::error::ZTDS Invariant 1 (Zero-Egress) violation detected. Pull request rejected."
            exit 1
          }
Enterprise Security Evidence Binder Generation Run alongside npm test to automatically generate tamper-evident receipts for SOC 2 Type II and ISO 27001 auditors.
SOC 2 Evidence Controls →
Automated Pre-Flight

Codebase Invariant CLI Scanner

Verify whether your existing codebase satisfies the ZTDS specification before applying for certification. Executes in <10ms with zero network calls:

npx ztds-audit --dir ./src Free CLI
View Perimeter Scanner Documentation →
Empirical Attestation

Permanent Benchmark DOIs

All throughput metrics, entropy proofs, and volatile memory safety profiles are archived with permanent DOIs on CERN/Zenodo and Open Science Framework:

Throughput (10k tokens) < 0.8 ms
RAM Overhead < 4 MB
OSF Benchmark Archive DOI: 10.17605/OSF.IO/5BYJF →