Repository navigation
Conversation
Transcripts often carry API keys, bearer headers and .env values from tool output. Replace known token formats, PEM private keys, Authorization values, secret-named assignments and URL passwords with [redacted: <kind>] before rendering. On by default; --no-redact opts out. Dry runs and publishes report the count per kind.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Summary
Shared sessions no longer carry API keys, tokens and passwords from the transcript. Before rendering,
push-sessionreplaces known secret formats with[redacted: <kind>], and the dry run tells you how many it caught before anything uploads. It is on by default;--no-redactkeeps the raw transcript.Why this matters
Coding-agent transcripts are full of tool output:
cat .env,gh auth token, curl calls withAuthorizationheaders, connection strings. Today that text is published verbatim, and the README can only warn ("Sessions can contain code, file paths, commands, and secrets"). On one machine, agent sessions from the past month held 39 strings shaped like Anthropic API keys, and each of them would have reached the share link.Demo
Simulated demo (HyperFrames), built from a real dry run on a fixture session with fake keys:
Changes
src/redact.jsis a pure pass over every string in the loaded messages (text, tool input, tool output) plus the session title. It runs once inrun()beforerenderSessionWithArtifacts, so pages, artifacts and the viewer get the same redacted data.Authorization: Bearer|Basicvalues; URL passwords; andKEY=valueor"key": "value"where the key name looks secret. There is no entropy guessing.process.env.API_KEY,getToken(),/regex/,$VAR,<token>and other placeholders.--dry-runand the publish summary printredactions: N (kind: n, ...), and--jsonaddsredactionsandredactionCounts. Local session files are never modified.Recovered artifact and Site source files are not scanned in this change. Sites already filter by filename.
Testing
npm run checkpasses 94 tests, including a newtest/redact.test.jswith a positive case and a near-miss per rule, plus CLI cases for the dry-run counts and--no-redact.redactions: 4 (anthropic: 1, github: 1, bearer: 1, url-password: 1), and--no-redactreports 0.anthropic: 2. A long coding session full of source code came out with no false hits after the expression and placeholder rules went in.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.