Repository navigation
Inbox: run a command with one press, keep secrets on the computer - #3675
Merged
Merged
Conversation
An agent writes a :::run block (a title, a reason, a folder, one fenced command) or a :::secret block (a name, a reason, where to find it). The window draws each as a card. Run runs the stored block's exact bytes on the computer that owns the thread, as the person, with their login-shell env and the project's saved secrets as $NAME; output streams to the card, Stop ends the process group, and the exit code and the output's tail go to the agent at once. Save keeps a value in the Keychain, the Secret Service, Windows DPAPI or a file only the person can read; the agent gets the name. Only the person's window, phone or a window on a linked machine can press; a command with a hidden character is refused.
…undled tool list has the run and secret text
A run gets only the secrets it names ($NAME, ${NAME}, $env:NAME or a Uses: line), shown on the card.
Names programs start from can't hold a secret (one list for parser, card and server); the shell and argv
come from the login env only. The hidden-character check runs on the card too, and on the folder.
Output buffering is bounded and linear. Windows prefers Git Bash, then PowerShell with $NAME set.
The login env is kept and refreshed behind; secrets are read in parallel with a bound, and a run that
can't read one does not start. The tool description carries a short text; --help keeps the full guide.
Runs survive an Inbox restart in inbox/runs.json, and a lost run is told to the agent. No last4.
… before reading it
…view round two
The card no longer freezes after Run: the poll belongs to the message's entry
with a stable subscribe, and polls while a card is on screen (quick while a
command runs, slow otherwise, so a run pressed elsewhere shows). Focus stays on
the one main button (Run, Stop, Run again) and moves to Replace after Save. A
run that needs an unsaved secret waits for it ("Save and run"); the route
refuses too. One field per secret per thread. Run and secret cards stay open
when a thread folds.
A secret is hidden before a long line is cut. The refused-names list grows,
with an exemption for token-like names caught only by a prefix. Windows gets
the exact bytes (Git Bash through an env var, PowerShell through
-EncodedCommand). A lost run is looked for by pid and start time and can be
stopped. Expected failures are 4xx; the card says the real folder, the
computer's name on a phone, and a true line for each way a run ends.
…crets # Conflicts: # packages/server/inbox.ts
…er Save
The run card's inline field now says what the secret card says: which
computer keeps it and in which store ("in its Keychain" when the computer is
named, from a phone or a linked machine), that the agent gets only the name,
and what happens next. The saved line names the same store. The agent's help
says the card tells the person where it is stored.
…n, and the confirm-read fixes
- Stop on a lost run looks again before each signal and signals only a confirmed match; a card that says it still runs is looked at again when read (at most every 5 s). A ps that fails is unknown, and that card offers no Stop. The agent is told when the person stops one; the status then reads "Stopped".
- Cards read their state when they come on screen (IntersectionObserver) and again when the Inbox's new `runs` event names them. Only an on-screen running card polls; a hidden window reads nothing; a closed thread's entries are dropped. Fifty idle cards went from about 17 reads a second to none.
- Windows: PowerShell's stdin is closed and it is not watched for a prompt; a command too long for Windows says so in plain words.
- Credential hiding also covers PGPASSWORD, MYSQL_PWD, *APIKEY, *PASSWD, *AUTH_TOKEN and passwords in URLs.
- A login shell that does not answer: its stand-in serves presses for a minute.
- A name the person's shell sets is not waited for ("Uses NAME from your shell"), and its value stays hidden.
- "Save it above / below / in its card", per where the field is.
- Terminal failure: "No terminal app could be opened on {computer}."
- The trust-file names get their own reason; a Uses word is quoted once, as written.
- A long command box fades at its foot while it has more below.
- `_JAVA_OPTIONS` dropped; the doc says values may hold tabs; the run card's Stop is data-run-card-stop.
- A lost run's group whose leader is gone counts as its own only when a live process of it started while the run ran (by when the journal last wrote it down); otherwise unknown, and no signal. - One ps that cannot tell keeps "still running"; only a definite end drops Stop. - The event stream reconnecting has the run cards on screen read again. - The note after Open in terminal leaves out names the person's shell sets. - A URL password that is its user name, or shorter than 8 characters, is not hidden in output. - The command box's fade does not clip its focus ring. - A Save or Remove reads each card once; a poll timer that fires hidden or off screen reads nothing. - `Uses: "API_KEY"` reads as API_KEY. - Doc comments back on their code; the tests restore IntersectionObserver and kill their sleep.
| expect(redactSecrets(`a=${SENTINEL}b`, [SENTINEL])).toBe("a=••••b"); | ||
| expect(redactSecrets("pin 42 and 420", ["42"])).toBe("pin •••• and 420"); | ||
| }); | ||
|
|
| test("a value with a control character cannot be saved (it would slip past hiding)", () => { | ||
| expect(checkSecretValue("abc\u001b[0mdef")).toMatchObject({ ok: false }); | ||
| expect(checkSecretValue("tab\tok")).toMatchObject({ ok: true }); | ||
| expect(checkSecretValue(`${SENTINEL}\n`)).toEqual({ ok: true, value: SENTINEL }); |
| expect(loginEnvCredentials({ OPENAI_API_KEY: "sk-abcdefgh123", SSH_AUTH_SOCK: "/tmp/agent.sock", GH_TOKEN: "short", HOME: "/home/p", NPM_TOKEN: "npm_abcdefghij" })).toEqual(["sk-abcdefgh123", "npm_abcdefghij"]); | ||
| // Named by how they end: an author's email or a session manager's name is not a credential. | ||
| expect(loginEnvCredentials({ GIT_AUTHOR_EMAIL: "[email protected]", GIT_COMMITTER_NAME: "Person Name", SESSION_MANAGER: "local/host:@/tmp/.ICE", AUTHOR_KEYWORDS: "plannotator", AWS_SESSION_TOKEN: "FwoGZXIvYXdzEJr", AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMIK7MDENG" })).toEqual(["FwoGZXIvYXdzEJr", "wJalrXUtnFEMIK7MDENG"]); | ||
| // Names that end without an underscore, and the short forms. |
| expect(loginEnvCredentials({ OPENAI_API_KEY: "sk-abcdefgh123", SSH_AUTH_SOCK: "/tmp/agent.sock", GH_TOKEN: "short", HOME: "/home/p", NPM_TOKEN: "npm_abcdefghij" })).toEqual(["sk-abcdefgh123", "npm_abcdefghij"]); | ||
| // Named by how they end: an author's email or a session manager's name is not a credential. | ||
| expect(loginEnvCredentials({ GIT_AUTHOR_EMAIL: "[email protected]", GIT_COMMITTER_NAME: "Person Name", SESSION_MANAGER: "local/host:@/tmp/.ICE", AUTHOR_KEYWORDS: "plannotator", AWS_SESSION_TOKEN: "FwoGZXIvYXdzEJr", AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMIK7MDENG" })).toEqual(["FwoGZXIvYXdzEJr", "wJalrXUtnFEMIK7MDENG"]); | ||
| // Names that end without an underscore, and the short forms. |
…ost run's own end is told - "Save it above/below/in its card" is looked at again when the thread changes around the card (a message folded, opened or hidden), and counts a folded message's line as where its field is. The route says which message holds each field (`field_at`). - Pressed while that message is folded, it opens the message, then scrolls to and focuses the field. - A lost run the agent last heard was still running, found ended by itself (a card read, or the next start), is told once more, the same way: it has ended since. - A saved Secret card says Saved once: the head says it; the line under it gives the time and the store. Storage lines wrap with text-wrap: pretty.
…for its group to go (no race with reaping)
…crets # Conflicts: # apps/hook/hooks/mod/inbox-default-tools.ts # apps/mobile/contract/generated/swift/Wire.swift # docs/agent-guides/server-and-storage.md # packages/inbox/eventFrames.ts # packages/inbox/sharedEvents.ts # tests/dom-test-list.txt
…heir own lines; Uses: none is no Uses line
backnotprop
marked this pull request as ready for review
November 20, 2026 01:26
…crets # Conflicts: # apps/hook/hooks/mod/inbox-default-tools.ts
1 task
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.
Two Inbox-only blocks, per the owner's picks ("Run here and the Secret box together"; "anywhere I am signed in to my own Inbox"; no opt-in, no confirmations, no Steps list).
:::run: a card with the command (Copy), where it runs ("On your Mac · in ~/projects/x") and one Run. It runs the stored block's exact bytes on the computer that owns the thread, as the person, with the login-shell env and the project's saved secrets as$NAME. Live output (ANSI stripped, secrets shown as ••••, last 500 lines), Stop (process group), exit code and duration; the result goes to the agent at once as the person's reply. Open in terminal is always there. A prompt that waits for typing says so. A command with a hidden or direction character cannot be run or copied, and the card says why.:::secret: a password field (a password manager can fill it) and Save. Values in the macOS Keychain (security -i, hex on stdin), the Secret Service (secret-tool, stdin), Windows DPAPI (PowerShell, stdin) or an owner-only file. The agent gets only the name; no value in any record, log, read or note.now(never held in the outbox).Docs:
docs/agent-guides/inbox-run-and-secrets.md, the Server API table. Agent text: send_message's body description,plannotator inbox --help,/llms/inbox.md.