Real Security Rests on Private Keys, Public Algorithms
When we documented the Pretense mutation algorithm in full, the first reaction from some advisors was: "Can attackers just reverse your mutations once they read the spec?"
The answer is that the spec alone gets them nowhere. And understanding why reveals something important about how Pretense actually works.
How Mutation Actually Works
The mutation algorithm takes an identifier name and produces a deterministic synthetic using a keyed hash:
function mutate(identifier: string, kind: 'fn' | 'v' | 'cls', key: string): string {
// PretenseMut: key-seeded hash
const hash = hmac(key, identifier).slice(0, 4);
return `_${kind}${hash}`;
}
// With key "project-alpha-2025":
mutate('getUserToken', 'fn', key) // -> _fn4a2b
mutate('processPayment', 'fn', key) // -> _fn9k2m
// With key "different-key":
mutate('getUserToken', 'fn', key) // -> _fn7x1q (completely different)
The algorithm is documented. The key is private. This is exactly how SSL/TLS works. The protocol specification is public. Your private key is private. Publishing the protocol leaves your encrypted traffic just as safe as before.
Why a Documented Algorithm Makes Us Stronger
1. Security teams can audit it
Black-box security tools ask you to trust them. Tools with documented algorithms let you verify them. For an enterprise security product, auditability is a feature and a strength.
2. Trust through transparency
A CISO evaluating Pretense can review the mutation engine documentation and understand exactly what it does. Every behavior is documented, every mode is visible, and all data handling is explained.
3. Accelerated enterprise procurement
Large enterprises require code review before approving vendor tools. Enterprise customers can request a full technical security review session with our engineering team. A documented algorithm makes that review straightforward and accelerates procurement.
4. The key is the secret, the algorithm is public
The security comes from the mutation keys, which are generated locally and stay on your machine. Knowing the algorithm while lacking a key yields only random-looking hashes.
What Stays Private
A documented algorithm still keeps everything important on your side:
- -Your mutation keys: generated locally, kept on your machine and off Pretense servers
- -Your mutation maps: stored in .pretense/ on your machine
- -Your audit logs: local unless you enable SIEM export
- -Your code: stays on your machine, with Pretense infrastructure kept out of the data path
The cloud service (dashboard, billing, compliance reporting) is commercial. The local-first protection layer is fully documented for enterprise security review.
The GitHub Copilot Comparison
GitHub Copilot is trained on code including potentially your code. The training process is opaque. What data was used, and how the model uses your patterns, stays hidden from you.
Pretense's mutation engine is the opposite: fully documented, deterministic, and free of any training component that could absorb your code. The synthetic identifiers Pretense sends to LLMs are mathematically disconnected from your real identifiers for anyone who lacks the key.
How to Verify the Mutation Engine
Enterprise customers receive a full technical documentation package. To verify the core claim, that mutations stay irreversible for anyone who lacks the key, request a security review session and our team will walk through the full algorithm, key derivation, and audit logging with your security team.
How I run Pretense on my own code
I build Pretense with Claude Code, and my sessions run through it. Here is the setup I give a new engineer, in order.
- -Run the agent through the proxy. Type
pretense run claudewhere you would typeclaude. It starts a local proxy on port 9339, points Claude Code at it and stops the proxy when the session ends. Detected secrets and PII leave the laptop as stand-in tokens. - -Put hooks on every repo.
pretense installadds a pre-commit and a pre-push hook. A key that never lands in git is a key an agent never reads. - -Scan before an agent reads the repo.
pretense scan path .lists what it finds. In CI,pretense scan ciexits 0 when clean, 2 on findings and 3 when it examined nothing. Treat 3 as a failure. - -Preview the swap.
pretense review .shows what would be mutated.pretense mutate <file> --previewprints one file mutated and leaves the file on disk as it was. - -Round-trip a file you need to share.
pretense mutate <file> --map <map>swaps the secrets in place.pretense reverse <file> --map <map>turns it back into the original, byte for byte, from the encrypted map on your machine. We run that round trip on real files before every CLI release and compare sha256 hashes.
One thing I learned the hard way: inside a session the agent sees stand-ins, so a file the agent writes can hold a stand-in where you expected a real value. Grep what the agent wrote before you ship it.
What Pretense will not do is put a secret back into the model's answer. Code identifiers come back byte-exact. Secrets and PII stay as stand-ins in the response. That is deliberate: a prompt-injected model can echo a token into a link, and reversing it there would hand over the real key.
What this means if you lead an engineering team
The outcome: your team keeps asking AI assistants about real systems, configs and connection strings, and detected secrets leave each laptop as stand-ins.
- -No new workflow. Engineers type
pretense run claudein place ofclaude. Other AI CLIs run the same way, for examplepretense run gemini. - -Guard the repo as well as the prompt.
pretense installadds pre-commit and pre-push hooks.pretense scan ciin the pipeline fails on findings (exit 2) and on an empty scan (exit 3). - -Answers stay usable. Identifiers inside fenced code blocks go out as stand-ins and come back byte-exact, so the code the model writes still uses your names.
- -Measure before you mandate. Run it on your own repo for a week.
pretense auditshows what it swapped and when.
Try it on your own repo: create a free account, then run npm i -g @pretense/cli and pretense run claude. If you need a security review first, talk to me.