Skip to content

fix(services): redact 'private key' from the agent-action public-safe card (#8020) - #8027

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:fix/agent-card-redact-private-key-8020
Jul 22, 2026
Merged

fix(services): redact 'private key' from the agent-action public-safe card (#8020)#8027
JSONbored merged 1 commit into
JSONbored:mainfrom
real-venus:fix/agent-card-redact-private-key-8020

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

agent-action-explanation-card.ts's PUBLIC_FORBIDDEN_PATTERN — the redaction applied by sanitizePublicCardText to the only text the publicSafe card ever exposes (summary/whyNow/rerunWhen) — listed seed phrases?/mnemonics? but was missing private keys?. Every other public-safe redaction vocabulary in the codebase includes it (miner-dashboard-recommendations.ts:45, control-panel-roles.ts:297, decision-pack.ts:1438, weekly-value-report.ts:417, extension-contributor-context.ts:31), and src/signals/redaction.ts:18-22's doc comment claims both this surface and its sibling carry the term — but only the sibling actually did.

Concrete leak: an action whose why/blockedBy references an App-credential/private-key-rotation topic (a live concept — see src/github/app.ts) passed through publicSafe.whyNow unredacted.

Fix

Add the same private keys? alternative used by the sibling lists, in the same position (right after mnemonics?) — no new wording, no new redaction shape. A regression test builds a card whose public-safe text references a private key and asserts it is redacted to private context.

Scope

  • Narrow, single coherent change (one regex term + its regression test)
  • In wantedPaths (src/services/**, test/unit/**); no blockedPaths
  • No secrets/wallets/hotkeys/trust-scores/rewards in code, tests, or this text
  • No generated-artifact changes required (pure service-file regex constant)

Validation

  • npx vitest run test/unit/agent-orchestrator.test.ts — 21/21 pass (incl. the new #8020 regression test)
  • Sibling agent-domain suites green: agent-actions, agent-action-executor, policy-sanitizer — 524/524
  • typecheck — clean on changed files (only the 2 pre-existing local semver TS7016s remain)
  • git diff --check clean

Safety

  • Change strictly widens public redaction (more terms redacted; no term removed) — the public/private boundary is tightened, never loosened
  • Regression test asserts the previously-leaking term no longer reaches the public-safe card
  • No secrets or private-scoring terms introduced anywhere

Closes #8020

… card (JSONbored#8020)

PUBLIC_FORBIDDEN_PATTERN in agent-action-explanation-card.ts listed seed
phrases and mnemonics but not private keys, so an App-credential reference
in why/blockedBy leaked through publicSafe unredacted. The term is present
in all five sibling public-redaction vocabularies (miner-dashboard-
recommendations.ts, control-panel-roles.ts, decision-pack.ts,
weekly-value-report.ts, extension-contributor-context.ts); add the same
'private keys?' alternative here. Regression test pins the redaction.
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 13:28
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 17:23:49 UTC

2 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a one-token regex fix adding `private keys?` to `PUBLIC_FORBIDDEN_PATTERN` in `agent-action-explanation-card.ts:11`, matching the same term already present in five sibling redaction vocabularies elsewhere in the codebase. The regression test in `test/unit/agent-orchestrator.test.ts` builds a card with a private-key reference in `why`, `blockedBy`, and `publicSafeSummary` and asserts the public-safe `summary`/`whyNow` are redacted to `private context`, which does exercise the real `sanitizePublicCardText` path. The change is narrow, additive (widens redaction only), and directly closes the gap described in issue #8020.

Nits — 2 non-blocking
  • The test comment cites five sibling file:line locations for context, but nothing in the diff verifies those still contain `private keys?` — a stale comment isn't a functional issue but could mislead future readers if those files change.
  • Consider adding a drift-guard test similar to `extension-contributor-context.test.ts`'s canonical-vocabulary sync check, so this specific gap (public pattern missing a term present in siblings) can't silently reappear.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8020
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 104 registered-repo PR(s), 45 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 104 PR(s), 17 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The diff adds 'private keys?' to PUBLIC_FORBIDDEN_PATTERN in the exact same position as the sibling list, and includes a regression test asserting 'private key' text is redacted from publicSafe.summary and whyNow, matching both deliverables.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 104 PR(s), 17 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 22, 2026
@JSONbored
JSONbored merged commit 0cd7dc4 into JSONbored:main Jul 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-action-explanation-card.ts's public-redaction regex is missing "private key", present in 5 sibling redaction lists

2 participants