Value types
A value the proxy finds is replaced in one of two ways. Most become a typed marker that holds nothing of the value. Certificates and keys, which programs parse and check, become a working stand-in.
Markers#
__redacted_<type>_<32 hex>__
__redacted_apikey_8eb80264f15a26eaa6875de564eb49e1__
__redacted_hostname_1ab0c5889561f6997bec59dc32aaf918__- Type is one word from the list below, so the model knows what it is holding.
- ID is a keyed HMAC-SHA256 of the value, cut to 128 bits (32 hex characters). The same value always gets the same marker, and because the HMAC is keyed, a short value can't be brute-forced back out of it.
- The frame is plain ASCII: it needs no escaping in a shell, a URL, a header or JSON.
- A value keeps the type of its first registration. After a detection change, move the project's
store.binaside to start fresh.
The types#
| Type | Covers | In the sandbox |
|---|---|---|
password | Values under password-like keys, the password in URL userinfo, the password field of a connection string | Marker |
passwordhash | Password hashes | Marker |
privatekey | PEM, OpenSSH and PGP private keys | Marker; a key in the same file as its client certificate gets a dummy key |
publickey | Public keys | Marker |
apikey | Provider API keys, by format (vendored gitleaks rules) | Marker |
token | Tokens by format or key-name context, long cookies, kubeconfig tokens | Marker |
jwt | JSON Web Tokens | Marker for the whole token |
certificate | X.509 certificates | CA certificate: the proxy CA. Client certificate with its key in the same file: a dummy certificate. Otherwise a marker. |
ip | IP addresses | Marker |
hostname | Internal hostnames (*.svc.cluster.local, internal, corp, names learned at runtime) | Marker |
email, phone, card, iban, nationalid | Personal data | Marker, never put back |
name, address | Personal data, reserved: no detector emits these yet | Declare such strings yourself |
declared | Your own exact strings: codenames, customer names, anything no detector could know | Marker |
Stand-ins#
A program in the sandbox that loads a certificate or checks that a key matches it fails on a marker. Only real objects pass, so the scrub writes real objects that aren't yours:
- A CA certificate becomes the proxy CA. The proxy trusts the real one for its own connections only when it came from a credential file you mounted, and only for that launch: a workspace file can come from a cloned repository, which must not add trust anchors.
- A client certificate and its key in the same file become a dummy pair: RSA-2048, signed by the proxy CA, with the real certificate's marker as its subject. The store keeps the pair with the real one, so the next launch writes the same dummy.
- Upstream, the proxy presents the real certificate only to the destination of the connection, which the gateway allowlisted, and only when that server asks for a certificate from the real one's issuer. The real key signs inside the proxy's own handshake.
A stand-in is written only where the file stays valid: base64-encoded where the value was base64, escaped inside a JSON string, as-is where the value was a line of its own (a PEM file). In an indented YAML block the marker stays.
A certificate and key in separate files (client-certificate: and client-key: paths) get no stand-in; they stay markers. IPs, hostnames and passwords are markers too, not format-preserving: a tool that parses an IP address gets a marker and breaks. Format-preserving stand-ins for them are not built.
How each kind is handled#
API keys and tokens#
Found by format (gitleaks rules) and by context (key names such as token or secret, JSON keys, environment variable names). Put back per the rules. A provider rule binds some keys to their provider's host, for example a GitHub token to github.com, a Stripe key to api.stripe.com, an OpenAI key to api.openai.com. In paranoid mode, a token a host returns is put back only toward that host.
Passwords and connection strings#
- In a URL, only the userinfo password becomes a marker; the rest of the URL stays readable. The password is not bound to that host: in paranoid mode its first use waits for approval.
- In a keyword connection string (ADO.NET, ODBC, libpq), only the password field becomes a marker. Server and database stay visible, so the agent can still tell where to connect.
- Database wire protocols are out of scope: a marker password is not put back on a database connection, and the login fails.
JWTs#
The whole token is one marker. It can't be decoded inside the sandbox.
Private keys#
PEM, OpenSSH and PGP blocks become markers, put back by the same rules as other markers. SSH keys you give with -ssh-key never enter the sandbox; they stay in the proxy and are usable through the agent's ssh-agent socket. A key alone in a file, with no certificate beside it, stays a marker.
IP addresses and hostnames#
IP addresses (IPv4 and IPv6, not version numbers) and internal hostnames become markers. A hostname or IP marker still works as an address: it resolves through the sinkhole, and the gateway connects to the real host. A kubeconfig's server becomes https://<marker>:6443. Public hostnames aren't secrets and stay as they are.
Base64 and other encodings#
- Detection decodes up to two layers (base64, percent-encoding,
\uand\xescapes, hex) before scanning. - Known values are matched in their encoded forms too: base64 in all three alignments, URL and JSON escapes, chunks.
- Kubernetes Secrets keep their shape: each data value becomes base64 of a marker.
- HTTP Basic
user:<marker>stays base64, so docker and npm auth keep working; the proxy re-encodes it with the real value.
Cookies#
A Set-Cookie value of 16 characters or more becomes a token marker. In paranoid mode it is put back only toward the host that set it, in the auth position; in default mode it resolves toward any allowlisted host, like any other marker.
Personal data#
Emails, phone numbers, card numbers, IBANs and national IDs become markers and are never put back to any host. Names and postal addresses have marker types but no detector yet; declare the ones that matter. A tool result with more personal-data values than the proxy's -dump-limit (default 50) is withheld.
Git output#
Every email in git's output is redacted, authors' included. Tracked secret files are read-only for the agent. See Git.
Declared secrets#
Exact, case-sensitive strings you name yourself, for values no detector could know. The proxy reads them with -declared-file, and redactproxy discover -out writes such a file. redactproxy launch does not take a declared-secrets file yet.