Real keys, not examples

A redaction rule tested on a handful of examples passes the examples. So the test does not use examples. It makes real keys with real cryptography: RSA, RSA with extra primes, elliptic curve, Ed25519 and symmetric keys. It writes each one the ways real tools write keys, as JSON, YAML and flow YAML, then encodes each in every layout the test covers: base64 on one line or wrapped, base64url, inside a JSON string with \n escapes, folded in a quoted YAML value, inside a URL, as UTF-8, UTF-16 and Latin-1 text. That is 4,642 encoded keys.

Every path a secret can take

Each key goes through every path where Ghost Architect™ redacts: when it loads your files, in what it writes or sends, and in a model's answer as it streams. The answer is streamed in pieces of many sizes, and cut off after every line, because a secret split across two pieces is where redaction usually breaks.

The test then asks a few plain questions. Is any private value shown, anywhere? Is the key replaced by one marker, and only the key? Does running redaction twice change nothing?

Against the release before

The same keys go through 8.1.30. It showed a private value for 4,553 of the 4,642 cases. A test that the old release passes proves nothing, so this one has to fail on 8.1.30 and pass on 8.1.31. And 648 ordinary documents, base64-encoded, must come out exactly as 8.1.30 left them, so the fix does not start redacting things that are not keys.

Every part of the change is needed

The change has 34 parts. For each one, the test takes that part out of a copy of the code and runs again. Every time, some check must fail. A part that no check needs is either untested or not needed, and we found two of those and took them out. This is how we know the tests watch the code and not the other way around.

Three reviews, each looking for a way past it

Each review read the change fresh, with one job: find an input that gets a private value past it. The first review found layouts we had not tested: a run inside a JSON string, a word right next to a run, a key in a URL path, Latin-1 and UTF-16 text. The second found that one pattern took quadratic time on a crafted input, so a hostile file could slow a scan, and that random bytes could decode to text that looked like the start of a key. The third found one more limit, and the manual now names it. Each shape a review found became a permanent check, 17 in all. A last check proves the time stays linear: twice the text never takes more than three times as long.

What it does not catch

A key encoded twice, compressed or encrypted. A key written as TOML or as .env lines and then encoded. Base64 split across strings joined in code. Chapter 6 of the manual lists the rest. We would rather tell you the limits than let you find them.

Why this much

Ghost Architect™ Local reads your code so that a model can reason about it. The one promise underneath everything else is that your secrets stay yours. A fix that is right for the inputs we thought of is not good enough for that promise, so this is the standard for every redaction change, however small it looks. If you think a key stored this way was sent before 8.1.31, replace it.

Ghost Architect™ Local runs on your own hardware.

The download page tells you how to get the tarball, verify it, and start the evaluation trial on your own hardware.

Request Ghost Architect™ Local

EJ Wisner, founder of Ghost Architect™. Local is a monthly license, per team size, with no per-token bill; the numbers are on the pricing page.