Repository navigation
fix(security): keep security explanations private and stop their tool calls - #471
Draft
johnmatthewtennant wants to merge 9 commits into
Conversation
…leak updates Goose injects load_skill into every session, so removing extensions leaves a tool the model can call. Its permission request and the session's config updates reach the visible app handlers. Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
Mark the hidden session private as soon as it exists, so its updates stay out of the chat store and its permission requests are cancelled, and require chat mode before the prompt, so no tool call runs. Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
Goose allocates session ids from the highest remaining one, so deleting a private session lets the next chat take its id, and the private fence then drops that chat's updates and cancels its permissions. Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
Goose allocates session ids from the highest remaining one, so a chat created after a private session is deleted can take that id. The private fence then dropped the chat's updates and cancelled its permission requests. newSession now reveals the id it returns. Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
…ate id Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
…ate id Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
Another client, such as a scheduled job, can create a session with a deleted private session's id. Loading it means the app shows it. Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: John Matthew Tennant <jtennant@block.xyz>
…n/security-explanation-private Signed-off-by: John Matthew Tennant <jtennant@block.xyz> Co-authored-by: Gordon <6581f171b4f294207c04c83d43b057ea88caa717457980f756160f0212d4f429@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * jtennant/gordon/security-explanation-effort: fix(connections): remove retired Block Academy provider (#475)
This branch has not been deployed
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
This fixes a bug: the hidden session that generates a security explanation is meant to have no tools and to stay out of the app, but it can still run a tool and its updates reach the visible chat store.
inferSecurityExplanationremoves every session extension so the model has nothing to act with. Goose injectsload_skillinto every session itself, though, so the model is still offered that tool and the skills it can load. The session is also never marked private, so:load_skillcall in the default approve mode raises a permission request through the app's normal permission handler, for a session nobody can see;setModelgo to the chat store.This PR:
newSessionreturns. Its later updates are dropped and its permission requests are cancelled, as voice drafts already do.load_skill. If the mode can't be set, the explanation isn't prompted, and the failure is logged.load_skillis still offered to the model. Removing it needs a Goose change; with this PR a call to it is skipped.Related issue
None found.
Testing
Red/green through the production path: Berd's
inferSecurityExplanationand its real ACP connection ran against the pinned Goosegoose servein approve mode, with one user skill installed. The model was a local stub that answers the explanation prompt with aload_skillcall. The harness recorded what reached the app's permission and chat-store handlers, and it searched and listed sessions while the explanation ran.load_skillcallconfig_option_update)newSessionreturnsUnit tests in
inferExplanation.test.tscover the contract (all fail before this change):setModel;acpBackends.test.tscovers the id reuse: a created, forked, imported or loaded session that has a private id receives its updates and permission requests (fails without the fix).Not verified: opening an alert without a detector-written explanation in a packaged build. The harness above calls
inferSecurityExplanationwith the app's real permission and chat-store handlers rather than going through the alert UI.🤖 Generated with Claude Code