Fix/auth secret hygiene#14
Merged
Merged
Conversation
The agentic loop previously auto-injected memory_read/write/search into the authorized set of EVERY skill on an agent that had a memoryBank configured. A jailbroken read-only summarizer skill could persist arbitrary content via memory_write that the developer never granted it. Now Skill exposes useMemory() (private setter for the field). AgenticLoop detects whether ANY skill on the agent has opted in: - If yes: only opted-in skills get memory_* tools. - If no: legacy default-on behavior (every skill gets memory if memoryBank is set) is preserved so existing single-skill agents keep working. This is the security fix without breaking backward compatibility. A follow-up ticket should flip the default to off in a major release. New MemoryToolPerSkillOptInTest covers: - Legacy single-skill auto-inject (regression). - Two-skill agent: one opts in, the other does NOT — non-opted skill's tool set must NOT include memory_*. - Opted-in skill receives memory tools. - Agent without memoryBank ignores useMemory() entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default data-class toString() printed the raw token. Any println(auth), Throwable.message capturing the auth instance, or default-formatted log line leaked the credential. Override toString() to render "Bearer(token=<redacted>)". data-class semantics (equals, hashCode, .token property) are preserved — only the log/debug surface is hardened. Future work (out of scope): store token as CharArray and expose close() that wipes it. That requires the transport to know its lifetime and is better tackled in a separate ticket. New McpAuthRedactionTest covers the redaction, the interpolation case, and confirms equals/hashCode/.token property still work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.