Repository navigation
feat: agents ask for keys on a private card instead of in chat - #1000
Merged
Merged
Conversation
An agent that needed an API key asked for it in chat, so a pasted key landed in the thread's events, the database, logs and every connected app. A new secret_request tool puts a card above the message box. The user's answer goes over its own RPC to one destination: a NAME=value line in a git-ignored env file in the thread's folder, or an owner-only file for the agent's commands that is removed after 24 hours. Events, projections, logs and other clients hold only the name and the outcome. The first device to press Save wins, a retry gets the stored answer, values are never trimmed, and a save interrupted by a restart settles without writing again. The existing secret store now removes leftover temp copies and creates its files owner-only. Design: docs/design/secret-requests.md. Step 2 (hiding a printed key) is not built.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…acktracking regex CodeQL flagged js/polynomial-redos: a multi-line key with a long run of tabs made the edge-whitespace regex slow. Both helpers now scan the closing line breaks and spaces directly.
This branch was previously 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.
An agent that needed an API key asked for it in chat, so a pasted key landed in the thread's events, the database, logs and every connected app.
A new
secret_requesttool puts a card above the message box. The user's answer goes over its own RPC (secretRequest.respond) to one destination, chosen when the agent asks:env_file: aNAME=valueline in a git-ignored, untracked env file in the thread's folder. The request is bound to real paths when asked and checked again at the write, which is always a rename. In a repository the temp copy sits under.git/threadlines-secret-saves, so a checkpoint'sgit addcan't stage it.commands: an owner-only file under<state>/agent-secrets/<thread hash>/<request>/value, removed after 24 hours, on Remove now, and on archive, delete or move.Events, projections, logs and other clients hold only the name and the outcome. The first device to press Save wins, a retry gets the stored answer, values are never trimmed, and a save cut off by a restart settles without writing again. The asking agent gets one message with the outcome; Not now and cancels reach it as a note at its next turn. The card says plainly that the agent can still read the key: it runs as the user.
Also in this PR:
secret_requestis loaded up front, so agents don't fall back to asking in chat. That adds about 1.3 KB to every Claude request (agentContextBudget.json updated on purpose).allowedToolsgainedsecret_request.projection_threads.secret_requests(nullable, no backfill).Design:
docs/design/secret-requests.md. Step 2, hiding a key a command later prints, is not built.