Curtly
Deterministic Syntax Shield

Safe Vault™ bit-for-bit syntax protection

Protect code blocks, JSON schemas, SQL queries, and parameter variables from token compression drift and syntax corruption.

Syntax Corruption Rate
0.00%

Zero broken brackets, corrupted strings, or missing delimiters.

Supported Formats
All Code & JSON

TypeScript, Python, Go, Rust, JSON, YAML, SQL, and regex.

Processing Overhead
< 1ms

Deterministic hash mapping executed directly in memory.

The production engineering challenge

Naive prompt compressors and small-model summarizers routinely damage code syntax by deleting essential quotes, breaking indentation, truncating brackets, or hallucinating variables, rendering automated coding agents and APIs unusable.

Technical architecture & mechanics

1

Multi-language AST detection

Accurately detects programming language structures, JSON payloads, YAML configurations, and SQL statements across inputs.

2

Bit-for-bit cryptographic isolation

Extracts code blocks into an in-memory vault with unique hashes before any compression pass, restoring them identically post-compression.

3

Template variable preservation

Protects Mustache, Jinja, and framework variables (e.g. {{user_id}}, $variable) from accidental truncation or renaming.

Safe Vault In-Memory Isolation Test

import { compressPrompt } from '@curtly/core'; const rawPrompt = ` Please review this critical SQL schema: ```sql CREATE TABLE users ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), metadata JSONB NOT NULL, created_at TIMESTAMPTZ DEFAULT now() ); ``` And verify if the {{tenant_id}} parameter is indexed properly. `; // Safe Vault guarantees SQL block and {{tenant_id}} survive unmodified const result = compressPrompt(rawPrompt, { safeVault: true }); console.log(result.output);

Architecture comparison

Evaluation metricCurtly.dev gatewayTraditional / naive approach
Code Block HandlingIsolated bit-for-bit and restored unchangedSubjected to destructive text summarization
JSON Schema Validity100% valid parseable JSON output guaranteedFrequent invalid JSON syntax errors and missing keys
Template VariablesPreserved with exact character boundariesFrequently mangled or merged into adjacent text

Frequently asked questions

Safe Vault combines markdown AST parsing, regex pattern matchers for curly brace/bracket balances, and heuristic token scanners to isolate code fragments cleanly.

Ready to optimize your AI infrastructure?

Start optimizing in 60 seconds with a 1-line baseURL change. Free tier available with zero credit card required.