Repository navigation
Description
Summary
infer insights sends verbatim session content to the analysis model and writes it into the report under ~/.infer/insights/, without redacting secrets:
digestSessionkeeps the first user message of each session as itsintent.foldFailureskeeps one verbatimSampleof each tool error (FAILED TOOL CALLS (verbatim errors ...)inbuildDigest).- Log failure groups keep a verbatim
Sampleline. - The memory index is included as-is.
A failed tool call whose error echoes a credential, such as an auth header, a token in a URL, or a .env value, or a log line that prints one, ends up in the model provider's request and in the saved report.
This matters more for insights run over collected sessions. The org's bots now save every run's conversations to a private .sessions repo, unredacted, and a weekly job runs infer insights over them. Redacting at insights time protects both the model call and the report, without redacting at every save point.
Proposed: pass the digest through a redactor before analyze, and before renderReport for the failure and log samples. Reuse the patterns infer-action already ships in src/redact.ts: the provider-secret env names, the always-on PEM private-key pattern, and GitHub token shapes. Also redact the values of those env vars when they are set in the environment.
Acceptance Criteria
- The digest sent to the analysis model has secret values and known credential shapes replaced with a fixed placeholder: provider API keys, GitHub tokens (
ghp_,gho_,ghu_,ghs_,ghr_,github_pat_), and PEM private keys. - The saved report under
~/.infer/insights/is redacted the same way, including failure and log samples. - Values of the provider-secret env vars (the list infer-action generates in
SECRET_ENV_NAMES) are redacted when present in the environment, both plain and JSON-escaped. - Redaction runs locally before any network call; counts and normalized error keys are unaffected.
- A test covers
buildDigestoutput containing a token in an error sample and asserts it is redacted.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Sep 26, 2026
@infer Can you work on this? use /ponytail:ponytail /domain-driven-design /clean-code
inference-gateway-maintainer commentedon Sep 26, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1339
✅ Infer Result: Success
Done. Issue #1338 is resolved in PR #1339 (ready for review, branch
fix/issue-1338, commitcfaaafa).What changed
internal/insights/redact.go(new) - Go port of infer-action'ssrc/redact.ts: theSECRET_ENV_NAMESlist (GITHUB_TOKEN, the generated provider API-key block, OTEL_EXPORTER_OTLP_HEADERS, MEMORY_TOKEN, MEMORY_DEPLOY_KEY), the always-on PEM private-key block pattern, and GitHub token shapes (ghp_,gho_,ghu_,ghs_,ghr_,github_pat_).redact()also masks the values of those env vars when set in the environment, both plain and JSON-escaped (values shorter than 8 chars are skipped, matching infer-action's default). Everything is local, before any network call.internal/insights/insights.go-buildDigestwraps its return inredact(...), so the payload reaching the analysis model (session intents, memory index, verbatim failure and log samples) is masked beforeanalyzemakes the model call.renderReportwraps its return inredact(...), so the saved report under~/.infer/insights/is redacted the same way, including failure and log samples. Counts and normalized error keys are untouched (keys are never rendered).internal/insights/redact_test.go(new) - the required test drives the full collect path with a GitHub token echoed in a tool error sample and asserts it is redacted inbuildDigestoutput with counts unchanged; plus a report-rendering test and table-driven tests for the credential shapes and env-value redaction (plain, JSON-escaped, short-value skip).Placeholder is the fixed
[redacted]- markdown-safe, and consistent with the browser tool's existing redaction convention (infer-action's***would render as a markdown rule in the report).Acceptance criteria
buildDigest.renderReport.buildDigestoutput containing a token in an error sample - done (TestBuildDigestRedactsSecrets).Tracking
Verification
go test ./internal/insights/and the fulltask testsuite pass.task precommit:runpasses (mod:tidy, mocks, fmt, golangci-lint 0 issues, markdownlint).Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 7m 41sTokens: 2,689,943 in · 29,164 out · 2,719,107 total (34 requests)
Tool calls: 51 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Sep 26, 2026
🎉 This issue has been resolved in version 0.210.0 🎉
The release is available on:
Your semantic-release bot 📦🚀