fix: make secret redaction one-way and fail closed#1
Open
datj9 wants to merge 1 commit into
Open
Conversation
datj9
force-pushed
the
security/one-way-secret-redaction
branch
from
July 18, 2026 05:04
c42b426 to
ce52915
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this improves
This PR turns dotmask from reversible response rewriting into one-way, fail-closed request redaction. It addresses the security review findings as follows.
Security impact
The most important change closes the response-side secret oracle. Previously, a model that received a fake token could place it in a shell command such as an encoding or network command. Dotmask would restore the real value before local execution, allowing the model or another endpoint to receive it. Version 2 never materializes real secrets from provider-controlled responses.
The proxy now also blocks intercepted request formats it cannot safely inspect instead of forwarding them unchanged.
Breaking change
This is intentionally versioned as 2.0.0. Model-generated commands containing fake credentials no longer become usable credentials automatically. Tools must obtain real credentials from a trusted local environment at execution time.
Dotmask remains defense in depth rather than a sandbox or DLP boundary. Provider authentication headers still reach the provider, non-allowlisted hosts are passed through, and agents with local filesystem or shell permission must still be constrained with approvals, sandboxing, least-privilege credentials, and network controls.
Verification