Technical Documentation

GateWall Developer & Security Docs

Comprehensive guide to integrate GateWall as a drop-in replacement, configure in-flight DLP redaction, and ensure enterprise compliance.

Quickstart

1. Quickstart & Drop-in Integration

Switch from official OpenAI API to GateWall in 1 line of code. Zero refactoring required.

curl https://gatewall.eu/v1/chat/completions \  -H "Content-Type: application/json" \  -H "Authorization: Bearer gw_live_YOUR_VIRTUAL_KEY" \  -d '{    "model": "mistral-large-4",    "messages": [      {        "role": "user",        "content": "Audit client Alice Martin, email: alice@banque.fr, IBAN: FR7630006000011234567890189."      }    ]  }'
Drop-in Replacement Guarantee

GateWall exposes the exact OpenAI API schema (/v1/chat/completions). You do not need to install custom SDKs or rewrite prompts.

Zero-Leak DLPRAM-Only · < 20ms

2. In-Flight DLP & PII Redaction Engine

Automatic regex and NLP masking executed in volatile RAM before prompt transmission to upstream providers.

Concrete In-Flight Encoding & Decoding Walkthrough

See how GateWall intercepts raw prompts, masks sensitive data into tokens before sending to the LLM, and restores original data on egress in volatile RAM.

Zero-Leak Upstream StreamUpstream: Zero-Egress Safe
> Draft an audit summary for client ⟪AG:NAME:1:5ab0⟫ (⟪AG:EMAIL:3:5ab0⟫) - IBAN ⟪AG:IBAN:4:5ab0⟫ on confidential project ⟪AG:PROJECT:2:5ab0⟫.
Substituted Tokens:⟪AG:NAME:1:5ab0⟫ ➔ Alice Dupont⟪AG:EMAIL:3:5ab0⟫ ➔ alice.dupont@bank.com⟪AG:IBAN:4:5ab0⟫ ➔ FR76300...0189
OpenAI / Mistral / Claude receives strictly anonymized tokens. Plaintext PII never leaves your security perimeter.
Pipeline Flow:Client AppGateWall RAM (<8ms)LLM ProviderRehydrate (<2ms)Client App

Anatomy of an In-Flight Token

Format: ⟪NAMESPACE:TYPE:INDEX:SALT⟫

GateWall uses syntactically isolated tokens that frontier LLMs naturally treat as typed variables without hallucinating.

⟪AG:NAME:1:5ab0⟫
⟪AG⟫Boundary Delimiters

Mathematical angle brackets prevent token fragmentation in standard BPE tokenizers.

NAMESemantic Category

Preserves grammatical role (NAME, EMAIL, IBAN) so the model maintains accurate syntax.

1Occurrence Index

Maintains referential consistency when the same entity is referenced across multiple sentences.

5ab0Ephemeral Salt

Cryptographic 16-bit salt generated per stream in RAM, preventing cross-session correlation.

Zero Disk Persistence: The lookup map Map<Token, Value> lives strictly in volatile RAM (< 20ms) and is purged when the HTTP socket closes.

Volatile Memory Pipeline (< 20ms overhead)

Zero Disk Write · In-Memory Map
1. Client Request< 1ms

Client sends raw prompt with sensitive customer data to GateWall.

2. RAM Tokenization< 8ms

Identifies PII (email, IBAN, SSN, IP, NDA) and swaps with reversible tokens in RAM.

3. Upstream Provider0ms

OpenAI / Mistral receives only anonymized tokens. Zero plaintext exposure.

4. Egress Rehydration< 2ms

Upstream response is rehydrated with original data before returning to client.

Supported PII Entites & Tokens

7 Built-in Detectors
Data TypeSample InputRedacted In-Flight TokenDetection MethodReversible on Egress
Email Addressesalice.dupont@bank.com⟪AG:EMAIL:1:5ab0⟫RFC 5322 Regex + Domain CheckYes (RAM-only)
Phone Numbers (FR & Int.)+33 6 12 34 56 78⟪AG:PHONE:1:5ab0⟫E.164 + National Formats (FR/EU/US)Yes (RAM-only)
Bank Account (IBAN / RIB)FR7630006000011234567890189⟪AG:IBAN:1:5ab0⟫ISO 13616 Modulo-97 VerificationYes (RAM-only)
Credit Cards (PAN & CVV)4532 •••• •••• 8891⟪AG:CARD:1:5ab0⟫Luhn Algorithm (Visa, MC, CB, Amex)Yes (RAM-only)
Social Security (NIR / SSN)1 85 12 75 108 245 42⟪AG:SSN:1:5ab0⟫INSEE NIR 15-digits & US SSNYes (RAM-only)
Internal IP Addresses192.168.1.42 / 10.0.4.1⟪AG:IP:1:5ab0⟫IPv4 Private & Public CIDRYes (RAM-only)
Custom NDA Project NamesProject Titan / QuantumVault⟪AG:PROJECT:1:5ab0⟫Exact & Soundex MatchYes (RAM-only)
Open Source Core

3. Supported by Open Source Core

Zero-dependency, MIT-licensed in-flight redaction engine running in volatile RAM.

Open Source Corev2.6.0 · MIT License

Powered by avantGate

GateWall's zero-leak in-flight redaction and reversible tokenization algorithms run on avantGate, our auditable open-source engine. Inspect the code, audit detection patterns, or use the standalone library in your local pipelines.

Run avantGate Standalone (TypeScript / Node.js)

Install via npm and anonymize prompts in 3 lines of code directly inside your local application runtime:

import { createInFlightRedactionSession } from "avantgate";// 1. Initialize an ephemeral in-memory session (RAM only)const session = createInFlightRedactionSession();// 2. Anonymize user prompt before calling any upstream LLMconst rawPrompt = "Audit user Alice Martin (alice@corp.eu), IBAN: FR7630006000011234567890189";const maskedPrompt = session.mask(rawPrompt);console.log(maskedPrompt);// Output: "Audit user Alice Martin (⟪AG:EMAIL:1⟫), IBAN: ⟪AG:IBAN:1⟫"// 3. Upstream model processes only synthetic tokens...// Then restore plaintext on egress response:const restoredText = session.restore("Confirmed transfer for IBAN: ⟪AG:IBAN:1⟫");console.log(restoredText);
When to choose avantGate vs GateWall Cloud?

Choose the right architecture based on whether you need a local in-process library or a managed team gateway.

Capability / Feature
avantGate (OSS Library)
GateWall (Managed Gateway)
Deployment ModelIn-process SDK (npm i avantgate)Universal HTTP Proxy (Zero SDK, drop-in OpenAI)
In-Flight PII RedactionLocal RAM buffers (in-process)Volatile RAM (< 20ms, purged per stream)
Multi-Provider RoutingSelf-implementedUniversal (OpenAI, Claude, Mistral) + HA Fallback
Virtual Keys & Budget QuotasNoneIsolated Virtual Keys + HTTP 402 Circuit Breaker
FinOps Telemetry & ObservabilityNoneRealtime Cockpit, p95 latency, token spend & margins
Cryptographic DPO AuditNoneHMAC-SHA256 Audit Proofs & GDPR Art. 28 DPA
Best Suited ForSolo devs, local pipelines, R&D scriptsB2B teams, SMEs, scale-ups, DPO & production
Zero Black Box: 100% of PII detection logic, regex rules, and Luhn checksum validation algorithms are publicly inspectable and verifiable.
GDPR & AI Act

4. Zero-Data Retention & DPO Cryptographic Proof

Proof of zero disk storage and tamper-evident audit certificates for GDPR and AI Act compliance.

Volatile RAM Guarantee

Prompt and completion payloads strictly exist in volatile memory buffers for the duration of the stream. Once the HTTP stream terminates, RAM buffers are immediately flushed. No disk writes, no vector databases, no model training.

Cryptographic DPO Audit Certificates

Every session receives a cryptographically verifiable HMAC-SHA256 signature containing token count, masked PII types, and latency metrics for compliance audits without storing payload content.

Legal, DPO & GDPR Architecture

5. Trust Center, Legal & DPO Compliance Guide

Clear legal guarantees, processor duties under GDPR Art. 28, zero-training commitments, and real encryption architecture.

Data Processor Status (GDPR Article 28)

GateWall acts strictly as a data processor on behalf of your organization. You remain the sole Data Controller and retain exclusive ownership over your business data. A standardized Data Processing Agreement (DPA) compliant with EU SCCs is readily provided.

Contractual Zero-Training & Anti-Resale

Customer prompts and completions are never sold, shared, or used to fine-tune foundation models. In-flight tokenization guarantees that no identifying records leave your secure EU boundary.

Real & Rigorous Cryptography (Transit & At Rest)

All client traffic is strictly enforced over TLS 1.3 with Perfect Forward Secrecy. Upstream BYOK keys are encrypted at rest with hardware-accelerated AES-256-GCM. Session audit proofs are cryptographically signed via HMAC-SHA256.

In-Flight Neutralization & Zero-Trace Mode

Sensitive data (SSN, payment cards, phone numbers, IP addresses) are neutralized into synthetic tokens before reaching external models. For maximum confidentiality, the 'Zero-Trace' mode guarantees instant volatile RAM destruction with zero payload persistence.

Need a signed DPA or compliance review?

Review our standard terms or contact our legal team at legal@gatewall.eu for our EU Standard Contractual Clauses (SCC) Data Processing Agreement.

OWASP LLM Security

6. Agent Guardrails (Tool Health & HITL)

Prevent runaway agent loops and supervise high-risk autonomous actions in production.

Anti-Loop Circuit Breaker (OWASP LLM06)

Monitors tool execution sequences. When an AI agent invokes the same tool with identical or oscillating parameters more than 3 times, GateWall trips an immediate circuit breaker to protect budgets.

Human-in-the-Loop Supervision (OWASP LLM03)

Critical actions (database migrations, fund transfers, email blasts) are paused in PENDING state awaiting human operator validation via the Cockpit or API webhook.

API v1

7. Universal API Reference

OpenAI-compatible endpoints served by GateWall.

POSTPOST /v1/chat/completions

Universal chat completions proxy with in-flight DLP, spend controls, and automatic fallback.

GETGET /api/v1/models

Catalog of 100+ available LLM models with pricing and context windows.