paseo-plugin-secure-input 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/OVERVIEW.md +30 -0
- package/README.md +252 -2
- package/SECURITY.md +79 -0
- package/assets/icon.png +0 -0
- package/client/card.tsx +74 -0
- package/client/codes.ts +32 -0
- package/client/diagnostics-rows.ts +139 -0
- package/client/dialog-state.ts +59 -0
- package/client/dialog.tsx +292 -0
- package/client/envelope-cache.ts +85 -0
- package/client/fields.tsx +255 -0
- package/client/file-entry.ts +142 -0
- package/client/form-state.ts +198 -0
- package/client/globals.d.ts +19 -0
- package/client/outcome.ts +96 -0
- package/client/presentation.ts +114 -0
- package/client/sealing.ts +27 -0
- package/client/self-test.ts +96 -0
- package/client/settings.tsx +160 -0
- package/client/submit.ts +92 -0
- package/client/text.ts +47 -0
- package/client/tone.ts +36 -0
- package/client/web.ts +184 -0
- package/index.client.tsx +29 -0
- package/index.server.ts +6 -0
- package/npm-shrinkwrap.json +60 -0
- package/package.json +68 -4
- package/paseo-plugin.json +6 -0
- package/server/core/continuation.ts +151 -0
- package/server/core/entries.ts +89 -0
- package/server/core/outbox.ts +555 -0
- package/server/core/registry-store.ts +185 -0
- package/server/core/registry.ts +1031 -0
- package/server/core/selftest.ts +60 -0
- package/server/core/view.ts +38 -0
- package/server/io/atomic.ts +119 -0
- package/server/io/deadline.ts +28 -0
- package/server/io/descriptor.ts +36 -0
- package/server/io/directory.ts +40 -0
- package/server/io/drop.ts +434 -0
- package/server/io/legacy-shim.ts +108 -0
- package/server/io/ownership.ts +8 -0
- package/server/io/private-file.ts +86 -0
- package/server/paseo/bounded.ts +13 -0
- package/server/paseo/handlers.ts +124 -0
- package/server/paseo/hooks.ts +106 -0
- package/server/paseo/plugin.ts +341 -0
- package/server/paseo/runtime.ts +409 -0
- package/server/paseo/tools.ts +180 -0
- package/shared/bytes.ts +100 -0
- package/shared/canonical.ts +32 -0
- package/shared/card.ts +41 -0
- package/shared/contracts.ts +128 -0
- package/shared/errors.ts +48 -0
- package/shared/limits.ts +118 -0
- package/shared/request-id.ts +9 -0
- package/shared/request.ts +66 -0
- package/shared/sanitize.ts +101 -0
- package/shared/seal.ts +292 -0
- package/shared/shown.ts +12 -0
- package/shared/text.ts +39 -0
- package/shared/view.ts +42 -0
- package/skills/secure-input/SKILL.md +148 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dutchakdev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/OVERVIEW.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
secure-input lets an agent ask you for a password, an API key, a token or a whole credentials file through a form in the Paseo app instead of in the chat. What you enter is sealed in the app, opened on the daemon and written to a set of short-lived files, one for each value, that only your OS user can read. The agent is given the paths, never the values, and moves each value where it belongs without reading it.
|
|
2
|
+
|
|
3
|
+
## What you see
|
|
4
|
+
|
|
5
|
+
- **A pill in the agent's chat** for each request, with the key names and never a value. Nothing opens by itself: pressing the pill opens the form, and the agent says why it asks in its own message.
|
|
6
|
+
- **The form**: a hidden row for each key the agent asked for, with an eye to show the value, and rows of your own for keys it did not name. A file row takes a whole file of up to 128 KiB, binary included: picked or dropped on the desktop, pasted on the desktop and on the phone. A file the agent asks for as JSON or PEM is checked in the app before anything is sent. ✕ declines the request.
|
|
7
|
+
- **The Secure input settings screen**: a check that seals the largest submission one request can carry on this device and has the plugin open it, the plugin's state (the sets on the daemon, the requests that wait for you, the first problem), and a button that deletes every set at once.
|
|
8
|
+
|
|
9
|
+
The texts of the pill, the form and the settings screen are in Ukrainian only.
|
|
10
|
+
|
|
11
|
+
## What the agent sees
|
|
12
|
+
|
|
13
|
+
- The agent has four tools, which Paseo serves beside its own: `request_secret` to ask, then `request_status`, `cancel_request` and `release_secret`. The daemon names the agent that makes each call; nothing the call itself says counts.
|
|
14
|
+
- A request answers at once that it is pending. Once you have submitted, the agent gets a message with the path of each file. No tool result, message, status or log holds a value: the agent's model provider gets key names, paths and states, never a value.
|
|
15
|
+
- The skill that comes with the plugin tells the agent to move each value only by redirection or by copy, into an `.env` file that git ignores, a file of its own, a tool's stdin or a server, and never to read it.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
- Paseo 0.14.0-beta.1 or later on the daemon and in the app: an older app does not load the pill, the form or the settings screen. A macOS daemon, where the plugin is developed and run, or a Linux one, where its tests pass, with Node.js 22.12 or later.
|
|
20
|
+
- Paseo must give its tools to agents (`daemon.mcp.injectIntoAgents`): while that is off, no agent has the plugin's tools.
|
|
21
|
+
- Link the skill where your agents read skills, as the [README](https://github.com/dutchakdev/paseo-plugin-secure-input#install) shows.
|
|
22
|
+
- Answer from the app over the relay or Tailscale: a direct LAN connection with a password is not encrypted.
|
|
23
|
+
|
|
24
|
+
## When the files go
|
|
25
|
+
|
|
26
|
+
Each delivery is a directory of mode 0700 with a file of mode 0600 for each key you filled in. It is deleted when the agent releases it, at the end of the agent's turn that its message starts, 15 minutes after the write (on a machine that slept, within a minute of waking), and at every start and stop of the plugin; a set that a crash left behind goes at the next start. The files are removed, not overwritten first.
|
|
27
|
+
|
|
28
|
+
## What it does not protect against
|
|
29
|
+
|
|
30
|
+
While a file exists, any process of your OS user can read it, the agent included, and on Paseo 0.14.0-beta.1 a process that can reach the daemon's MCP endpoint for agents can ask in another agent's name: what keeps a value out of the model is the skill's rule and the plugin's silence, not a lock. The plugin's SECURITY.md names every case where its promise does not hold.
|
package/README.md
CHANGED
|
@@ -1,3 +1,253 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
secure-input is a [Paseo](https://paseo.sh) plugin through which an agent asks you for a password, an API key, a token or a whole credentials file in a form in the Paseo app, instead of in the chat. The request is a pill in the agent's chat: a small button that names what is asked for and opens the form. What you enter is sealed in the app, opened on the daemon and written to a set: a short-lived directory with a file for each value, which only your OS user can read. The agent gets the files' paths, never the values, and moves each value where it belongs without reading it. The texts of the pill, the form and the settings screen are in Ukrainian only.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
You need Paseo **0.14.0-beta.1 or later** in two places. The daemon runs the plugin's server half; the app, on the desktop and on the phone, loads the pill, the form and the settings screen, and checks the version on its own. `paseo plugin ls` showing `running` says nothing about the app: an older app shows no pill. Paseo 0.14.0-beta.1 is a pre-release: on 2026-10-28 npm had it under the Paseo CLI's `beta` dist-tag, and `latest` was still 0.13.2 (`npm view @getpaseo/cli dist-tags`). The desktop and phone apps you answer from must be on 0.14 too. Check both:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
paseo daemon status # daemonVersion
|
|
11
|
+
/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' /Applications/Paseo.app/Contents/Info.plist # the macOS app
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The daemon's Node.js must be 22.12 or later. macOS and Linux are declared supported; the plugin is developed and run on macOS, and its tests pass on Linux too.
|
|
15
|
+
|
|
16
|
+
Plugins must be enabled daemon-wide first, under **Settings → Plugins → Enable plugins** (the root `pluginsEnabled` field in the daemon's `config.json`). Agents must also get Paseo's own tools, which bring this plugin's with them:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
paseo daemon config set daemon.mcp.injectIntoAgents true
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
While `daemon.mcp.injectIntoAgents` is off, no agent has any of Paseo's tools, so none has this plugin's. A fresh home of Paseo 0.14.0-beta.1 has it off (whether an upgraded one has it on was not checked); setting it takes effect without a restart. An agent gets the tools when its session opens.
|
|
23
|
+
|
|
24
|
+
Then install the plugin from one of these sources:
|
|
25
|
+
|
|
26
|
+
| Source | Command |
|
|
27
|
+
|---|---|
|
|
28
|
+
| [Plugin directory](https://paseo.sh/plugins), the reviewed version, once the plugin is listed there | `paseo plugin add dutchakdev/secure-input` |
|
|
29
|
+
| npm, the newest release, also before the directory has reviewed it | `paseo plugin install npm:paseo-plugin-secure-input` |
|
|
30
|
+
|
|
31
|
+
`paseo plugin ls` should then show `secure-input` as `running`. `paseo plugin update secure-input` pulls later releases from the same source, and `paseo plugin remove secure-input` stops and removes the plugin; its data directory stays ([Where things are](#where-things-are)). To run it from a checkout instead, see [Development](#development).
|
|
32
|
+
|
|
33
|
+
Then link the skill, which tells agents to use the form and how to move a value without reading it. Paseo hands no plugin's skill to agents, and the copy of the plugin it installs moves to a new directory at every update, so link the skill from a clone of this repository. Agents that read `~/.agents/skills` take it from there; Claude Code reads `~/.claude/skills`:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/dutchakdev/paseo-plugin-secure-input.git
|
|
37
|
+
cd paseo-plugin-secure-input
|
|
38
|
+
mkdir -p ~/.agents/skills ~/.claude/skills
|
|
39
|
+
ln -sn "$PWD/skills/secure-input" ~/.agents/skills/secure-input
|
|
40
|
+
ln -sn ../../.agents/skills/secure-input ~/.claude/skills/secure-input
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`ln -sn` replaces nothing: where a name is already a file or a link, that line fails with `File exists`; where it is a real directory, the new link lands inside it, so look with `ls -ld` first. Links you made for v1 keep working, since the skill is at the same path. v1's second skill, `secure-input-setup`, is gone; remove its links (`rm` removes a link, not what it points to):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
rm ~/.agents/skills/secure-input-setup ~/.claude/skills/secure-input-setup
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Last, on every device you will answer from, open the plugin's settings screen, **Secure input**, and press «Перевірити». It seals the largest submission one request can carry in the app and has the plugin open it, the way a real value goes.
|
|
50
|
+
|
|
51
|
+
Use the app with the daemon over the relay or Tailscale. A direct LAN connection with a password is not encrypted ([SECURITY.md](SECURITY.md)).
|
|
52
|
+
|
|
53
|
+
## How it works
|
|
54
|
+
|
|
55
|
+
```mermaid
|
|
56
|
+
sequenceDiagram
|
|
57
|
+
participant A as Agent
|
|
58
|
+
participant D as Paseo daemon
|
|
59
|
+
participant P as Plugin (daemon)
|
|
60
|
+
participant U as You (Paseo app)
|
|
61
|
+
A->>D: request_secret {reason, fields}
|
|
62
|
+
D->>P: the tool call, and which agent made it
|
|
63
|
+
P-->>U: a pill in the agent's chat
|
|
64
|
+
P-->>A: pending, end your turn
|
|
65
|
+
U->>U: you type or pick, the app seals it
|
|
66
|
+
U->>P: RPC with the ciphertext only
|
|
67
|
+
P->>P: open it, write drop/si-secret-r_…/KEY, wipe the buffers
|
|
68
|
+
P-->>A: message with KEY → path, no value
|
|
69
|
+
A->>A: command < path, or cp path destination
|
|
70
|
+
A->>D: release_secret, or rm -r the directory
|
|
71
|
+
P->>P: delete the set (also at the end of the turn, 15 minutes after the write, at start and at stop)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Nothing opens by itself: the request is a pill in the agent's chat, and the form opens when you press it. The agent says why it asks in its own message; the form shows no reason.
|
|
75
|
+
|
|
76
|
+
## The tools
|
|
77
|
+
|
|
78
|
+
Paseo serves four tools to every agent that has Paseo's tools. Each call carries the agent that made it, as the daemon names it from the agent's connection to its MCP server, and nothing the call itself says of who is asking. On Paseo 0.14.0-beta.1 that name is not bound to a credential: it keeps agents apart that use the connection Paseo gave them, and not a process that can reach the daemon's MCP endpoint for agents and calls it as another agent. On a daemon with no password that takes no credential at all; on one with a password, the token Paseo puts in the configuration of every agent it starts, or the password itself, lets such a call in ([SECURITY.md](SECURITY.md#a-hostile-process-that-runs-as-you)).
|
|
79
|
+
|
|
80
|
+
| Tool | Input | What it does |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `request_secret` | `reason`, `fields` | Puts a pill in the agent's chat and answers at once with `"status": "pending"`. A message with the paths follows when you have submitted |
|
|
83
|
+
| `request_status` | `requestId` | The state, the keys and the `tamper` flag; while the files exist, each file's path (`files`) and when they go (`deleteBy`). Never a value |
|
|
84
|
+
| `cancel_request` | `requestId` | Withdraws the agent's own pending request |
|
|
85
|
+
| `release_secret` | `requestId` | Deletes the files of the agent's delivered request now |
|
|
86
|
+
|
|
87
|
+
The input of `request_secret` is `{ reason, fields }`, and each field is `{ key, label?, optional?, kind?, format? }`:
|
|
88
|
+
|
|
89
|
+
| Member | Rule |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `reason` | At most 300 characters. Kept with the request and shown nowhere: the agent says why in its own message |
|
|
92
|
+
| `label` | At most 80 characters. A screen reader reads it as the hint of the field: of a text field's input, and of a file field's buttons and paste area; it is not shown |
|
|
93
|
+
| `fields` | At most 32 fields, or none. You can always add keys and files of your own |
|
|
94
|
+
| `key` | `[A-Za-z_][A-Za-z0-9_]*`, at most 128 characters, not `__proto__`, `constructor` or `prototype`. Each key names a file, so keys that differ only in letter case are refused |
|
|
95
|
+
| `kind` | `"text"` (the default): one line, at most 64 KiB of UTF-8. `"file"`: a whole file, at most 128 KiB, binary included |
|
|
96
|
+
| `format` | For a file: `"json"` or `"pem"` is checked in the app, `"any"` (the default) is not |
|
|
97
|
+
| `optional` | You may leave it empty; it then gets no file |
|
|
98
|
+
|
|
99
|
+
An agent has one pending request at a time. A request nobody answers expires after 8 hours.
|
|
100
|
+
|
|
101
|
+
### What agents see
|
|
102
|
+
|
|
103
|
+
Checked on Paseo 0.14.0-beta.1 with real agents:
|
|
104
|
+
|
|
105
|
+
| Agent | The tools are named | Permission |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| Claude Code 2.1.311 | `mcp__paseo__request_secret`, `mcp__paseo__request_status`, `mcp__paseo__cancel_request`, `mcp__paseo__release_secret`. They are deferred: the agent loads one with `ToolSearch` (`select:mcp__paseo__request_secret`) before its first call | In the `default` mode ("Always Ask"), every call of these tools waits for your permission, and so does each `cp` of a delivered file |
|
|
108
|
+
| Codex 0.164.0 | The same names, as nested tools of its `exec` tool: listed in `ALL_TOOLS`, called as `tools.mcp__paseo__request_secret(…)`. Paseo's timeline shows the calls as `paseo.request_secret` | In the `auto` mode ("Default Permissions"), every call asks through an MCP elicitation: `Allow the paseo MCP server to run tool "request_secret"?` |
|
|
109
|
+
| Kimi | Not checked | Not checked |
|
|
110
|
+
|
|
111
|
+
Other modes were not tried. One Codex model, `gpt-6-luna`, did not find the tools until it was told to look in `ALL_TOOLS`; the skill tells agents where to look.
|
|
112
|
+
|
|
113
|
+
An agent without Paseo's tools cannot use the plugin: every agent, while `daemon.mcp.injectIntoAgents` is off. A provider whose configuration switches Paseo's tools off (`paseoTools.enabled: false`, or a tool named in `disabledTools`) has the plugin's tools left out without an error; this is read in Paseo's source and was not tried. Without the tools the skill has the agent say so, and never take the secret in chat.
|
|
114
|
+
|
|
115
|
+
## The pill and the form
|
|
116
|
+
|
|
117
|
+
### The pill
|
|
118
|
+
|
|
119
|
+
| State | The pill |
|
|
120
|
+
|---|---|
|
|
121
|
+
| Waiting for you | «Секрет для агента» and the key, or «Секрети для агента» and how many keys. The only state you can press: it opens the form |
|
|
122
|
+
| Delivered | Green «Передано» and how many keys got a file |
|
|
123
|
+
| Files deleted | Grey «Передано» |
|
|
124
|
+
| Declined, cancelled, expired, not accepted | Dim, the count struck through: «Відхилено», «Скасовано», «Час минув», «Не прийнято» |
|
|
125
|
+
| A second, different submission came | Red «Підозріле подання» |
|
|
126
|
+
|
|
127
|
+
The pill has the same height in every state, and holds key names, never a value.
|
|
128
|
+
|
|
129
|
+
### The form
|
|
130
|
+
|
|
131
|
+
The form opens over the chat in the app's own dialog. At the top: «Секрет для агента» or «Секрети для агента», the badge «X25519 · ChaCha20-Poly1305», and ✕, which declines the request. Closing the form any other way declines nothing: the pill opens it again. Then a row for each key: the key's name inside the field on the left, the value hidden, and the eye that shows it. An optional key has a dimmer name. + adds a row of your own, a name and a value; in such a row the paperclip makes it a file row, and ✕ removes it. → sends. There is no other text: no reason, no captions. Every icon has a Ukrainian label for screen readers, and so do the name of a key you add and the paste area. On the desktop and on Android a screen reader is told each line under a row, and the line at the top, as it appears; VoiceOver on iOS reads them where they stand.
|
|
132
|
+
|
|
133
|
+
| Where | Line | When |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| Under a row | «Лише A–Z, 0–9, _» | A name of yours is not a key |
|
|
136
|
+
| Under a row | «Вже є STRIPE_KEY» | The name is used above, also in another letter case |
|
|
137
|
+
| Under a row | «Ім'я зарезервоване» | `__proto__`, `constructor` or `prototype` |
|
|
138
|
+
| Under a row | «Не довше 64 КіБ» | A text is too long |
|
|
139
|
+
| Under a row | «Некоректний символ» | A text holds a broken character |
|
|
140
|
+
| Under a file row | «Не довше 128 КіБ», «Це не JSON», «Це не PEM» | The file fails its check |
|
|
141
|
+
| Under the rows | «Разом не довше … КіБ» | Everything together would not fit one submission |
|
|
142
|
+
| At the top | «Плагін зараз недоступний. Натисни «→» ще раз.» | The plugin did not take what was sent, and the request may still be open |
|
|
143
|
+
| At the top | «Запит уже закрито.» | The request is closed: what you typed stays, and → is disabled |
|
|
144
|
+
|
|
145
|
+
A required row that is empty has no line; → just stays disabled. While the form sends, the rows dim and → spins; on success the form closes and the pill turns green. After a reply that never came, → sends the same sealed data again; if you changed a value, the form first reads the request, and sends nothing if it was answered meanwhile. A submission the plugin cannot open counts against the request, which is closed after three failed attempts (`retry_limit`). Closing the form throws away what you typed, and the bytes of every file are wiped.
|
|
146
|
+
|
|
147
|
+
### File fields
|
|
148
|
+
|
|
149
|
+
For a JSON key, a PEM, a kubeconfig or a `.p12`, the agent asks for a field of `kind` `"file"`, and that key gets a file row. Text rows hold one line, so a value of several lines comes through a file row, which keeps its line breaks.
|
|
150
|
+
|
|
151
|
+
| | Desktop app | Phone |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| Pick a file (the paperclip) | Yes | No: Paseo gives plugins no file picker there |
|
|
154
|
+
| Drop a file on the row | Yes | No |
|
|
155
|
+
| Paste (the clipboard) | Yes | Yes |
|
|
156
|
+
|
|
157
|
+
Paste opens a text area under the row: paste into it with the system menu or the keyboard, and when it loses focus its text becomes the file and the area closes. The plugin reads no clipboard; what you paste is visible while the area is open.
|
|
158
|
+
|
|
159
|
+
A row with a file shows the file's name («вставлено» for a paste), its size and, for `json` or `pem`, a ✓ or a ✗; never the content. ✕ takes the file out. Before anything is sealed the app checks every file: at most 128 KiB; for `json`, that it parses; for `pem`, that it has a `-----BEGIN` line and an `-----END` line. `any` is not looked into. The bytes travel inside the sealed payload and land in the file on the daemon byte for byte.
|
|
160
|
+
|
|
161
|
+
## Files and when they go
|
|
162
|
+
|
|
163
|
+
Each delivery is a set: `<data>/drop/si-secret-<requestId>/`, mode `0700`, with a file for each key, mode `0600`, named after the key. A text's file holds the UTF-8 you typed, with no newline added; a file field's file holds the file's bytes. An optional key you left empty gets no file; a key you added gets one. The set is built under a temporary name and renamed into place, so nobody finds half of it.
|
|
164
|
+
|
|
165
|
+
It is deleted at the first of these:
|
|
166
|
+
|
|
167
|
+
| Event | `releasedBy` | What the agent is told |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| The agent calls `release_secret`, or deletes the directory itself | `agent` | Nothing |
|
|
170
|
+
| The end, with any outcome, of the agent's turn that its delivery message starts | `turn` | Nothing more |
|
|
171
|
+
| 15 minutes after the write, and on a machine that slept through that, within a minute of waking | `time` | If its delivery message is still waiting: that the files were deleted, instead of their paths |
|
|
172
|
+
| The plugin starts: everything in `drop/` goes | `restart` | The same, with this reason |
|
|
173
|
+
| The plugin stops: everything in `drop/` goes | `stop` | The same, with this reason |
|
|
174
|
+
| You press «Видалити всі файли секретів зараз» | `human` | The same, with this reason |
|
|
175
|
+
|
|
176
|
+
The deletion at the end of a turn is armed by the first turn of the agent that begins after its message was handed over, so a late end of the turn before it does not take the files early. If the agent is busy for more than 15 minutes after you submit, the files go at their deadline, and the agent, once idle, is told to ask again. The request then reads `released`; a set that cannot be deleted keeps it `delivered`, and the plugin tries again.
|
|
177
|
+
|
|
178
|
+
Deletion is `unlink` and `rmdir` only, follows no link, and overwrites nothing first. [SECURITY.md](SECURITY.md) says why, and names the windows in which a process of your user can still race it.
|
|
179
|
+
|
|
180
|
+
## The settings screen
|
|
181
|
+
|
|
182
|
+
**Secure input**, in the plugin's settings, shows the version and three parts.
|
|
183
|
+
|
|
184
|
+
**«Шифрування».** The badge «X25519 · HKDF-SHA256 · ChaCha20-Poly1305», and «Перевірити» on «Цей пристрій». It seals in the app a dummy payload of the largest size one submission can have, and the plugin opens it: «✓ … мс», or «✗ дані не збіглися», «✗ не вдалося зашифрувати», «✗ плагін не відповів».
|
|
185
|
+
|
|
186
|
+
**«Стан».** «Стан» has four rows, read again while the screen is open. Only a red row has a line under it.
|
|
187
|
+
|
|
188
|
+
| Row | Says |
|
|
189
|
+
|---|---|
|
|
190
|
+
| «Плагін» | «Працює»; «Запускається» until the plugin has met the daemon and read its requests; «Не запустився», with the reason |
|
|
191
|
+
| «Секрети на сервері» | «Немає», or how many sets are on the daemon and when the nearest goes («… · найближчий зникне о …»); red, «… · не все видалено», when something in `drop/` could not be deleted |
|
|
192
|
+
| «Запити, що чекають» | «Немає», or how many requests wait for you |
|
|
193
|
+
| «Помилки» | «Немає», or «Є» with the first problem: requests or messages that cannot be saved, a request file that cannot be read, a pill that has not reached its chat, a hook that failed |
|
|
194
|
+
|
|
195
|
+
**«Видалити всі файли секретів зараз»**, with «Видалити». Shown while there are sets on the daemon, or something in `drop/` could not be deleted. It deletes every set now (`releasedBy` `human`) and sweeps `drop/`. When the plugin refuses the deletion as a whole (it is stopping, or `drop/` cannot be swept), «Не вдалося видалити» stands under it until a press is not refused.
|
|
196
|
+
|
|
197
|
+
## When something is wrong
|
|
198
|
+
|
|
199
|
+
| Symptom | Cause |
|
|
200
|
+
|---|---|
|
|
201
|
+
| The agent says it has no `request_secret` tool | `daemon.mcp.injectIntoAgents` is off (Install); the provider switches Paseo's tools off; or the agent's session opened before the plugin ran. A Codex agent may have to look in `ALL_TOOLS` |
|
|
202
|
+
| The agent reports `the plugin is busy; retry in a few seconds` | A tool call waits for its turn in the plugin's work queue for at most 10 seconds, and only a disk that stalls holds the queue that long. Nothing the call asked for is done later, so the agent can ask again |
|
|
203
|
+
| The agent reports `the plugin did not start (…)` | The start-up failed, and the tools refuse in those words until it succeeds. «Плагін» reads «Не запустився» with the reason, and `paseo plugin logs secure-input` has it too: for example a data directory or a `drop/` that is not a private directory of your user. Remove the cause and reload the plugin |
|
|
204
|
+
| No pill in the chat, or no **Secure input** screen | The app is older than the plugin requires (Install), or the plugin does not run: `paseo plugin ls`, `paseo plugin logs secure-input`. A pill that did not land is tried again once a minute and whenever the daemon next calls the plugin, and only once in five minutes while the daemon has left three appends of it unanswered; «Помилки» shows it meanwhile. `paseo logs` never prints the pill |
|
|
205
|
+
| The agent stops to ask for permission | Claude Code and Codex ask before every call of these tools in the modes that were checked (What agents see), and Claude Code before each `cp` of a delivered file. Allow it |
|
|
206
|
+
| The agent never continued after you submitted | A message for a busy agent waits in `outbox.json` until the daemon has answered that the agent is idle; [SECURITY.md](SECURITY.md#crashes-stops-and-restarts) says how long it waits and when the plugin asks. A message is sent once and is lost only in these cases: the plugin dies before the message was saved; it dies or is stopped after the message was taken out of `outbox.json` and before the send finished; the one send fails or is not answered in time (it is never tried twice); the message waited longer than a day, or more than 256 messages wait and it is the oldest, or the clock was set back by more than a minute while it waited; the agent is archived; the plugin no longer has the request the message is about, because `requests.json` could not be read at a start or the request left the history of the last 200 closed ones first; the change of state was still being saved when a stop of the plugin ran out of its time; or `outbox.json` was replaced by something the plugin did not write. Tell the agent to continue: it can call `request_status` |
|
|
207
|
+
| «Секрети на сервері» is red | Something in `drop/` could not be deleted. A set delivered since the plugin started is tried again at its deadline, and after that once a minute; anything else that could not be deleted, such as what an earlier run or a failed write left, is tried again once a minute. After a press of «Видалити всі файли секретів зараз» that could not sweep `drop/` at all, the row stays red until a sweep runs: the next press, or the next start. Press «Видалити всі файли секретів зараз», or delete `drop/` in the data directory by hand |
|
|
208
|
+
| The daemon log has `Agent MCP transport error: … Unsupported protocol version …` when a Claude agent starts | Seen on Paseo 0.14.0-beta.1; those agents got the tools all the same |
|
|
209
|
+
|
|
210
|
+
## Where things are
|
|
211
|
+
|
|
212
|
+
The data directory is `${PASEO_HOME:-~/.paseo}/secure-input`:
|
|
213
|
+
|
|
214
|
+
| Path | Holds |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `requests.json` | The open requests and the history of the last 200 closed ones: states, key names, who asked, how each ended. No value |
|
|
217
|
+
| `outbox.json` | Messages waiting for an idle agent, as references: the words are built from the plugin's own record of the request when a message is sent |
|
|
218
|
+
| `drop/` | The sets, `si-secret-<requestId>/<KEY>`. Empty while nothing is delivered |
|
|
219
|
+
| `bin/` | Only where v1 was installed: a stub in place of v1's bridge, written at every start, for agents created under v1. Their stored configuration still starts `bin/secure-input` as an MCP server; the stub lists no tools, and a call, or the old command line, gets `secure-input now gives its tools through Paseo itself. This old server has none. Do not ask for the secret in chat instead.` Keep `bin/` while such agents are in use |
|
|
220
|
+
|
|
221
|
+
v1 left more, which v2 neither reads nor touches and you can delete: `tmp/`, `staging.log`, `commands.json`, `bindings.json` and `run/`.
|
|
222
|
+
|
|
223
|
+
The plugin never deletes its data directory. Its log, `paseo plugin logs secure-input`, holds codes and fixed phrases only.
|
|
224
|
+
|
|
225
|
+
## Security
|
|
226
|
+
|
|
227
|
+
What you enter leaves the app only sealed to a one-time key of the request, and on the daemon's disk it exists in the clear only in those short-lived files, which the plugin shows to nobody. Any process of your OS user, the agent included, can read such a file while it exists, so what keeps the value out of the model is the skill's rule and the plugin's own silence, not a lock. Which agent asks is the daemon's to say, and on Paseo 0.14.0-beta.1 any process that can reach the daemon's MCP endpoint for agents can make the daemon say another agent's name, and so put a request in that agent's chat: on a daemon with no password it needs no credential, and on one with a password, an agent's token or the password itself. [SECURITY.md](SECURITY.md) says what is promised and every case where it does not hold.
|
|
228
|
+
|
|
229
|
+
A rule in your agent's harness that refuses its file-reading tools on paths containing `si-secret-` adds a lock where that harness can enforce one. Write it in that harness's own syntax, and leave `cp` and `<` redirection working, or the agent cannot move the value.
|
|
230
|
+
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
To run the plugin from a checkout instead of a published source:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/dutchakdev/paseo-plugin-secure-input.git
|
|
237
|
+
cd paseo-plugin-secure-input
|
|
238
|
+
npm ci
|
|
239
|
+
npm run check # typecheck the daemon half, the app half and the tests, then test
|
|
240
|
+
paseo plugin install "$PWD"
|
|
241
|
+
paseo plugin ls # secure-input running
|
|
242
|
+
paseo plugin reload secure-input # after each edit: source edits are not picked up by themselves
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`tests/canary.test.ts` sends recognisable values (a text, a JSON file and a binary file) through the tools and the whole plugin, and searches everything that left the trusted path for them: only the files in `drop/` may hold them. `tests/docs.test.ts` holds these documents to the code: the skill's examples, the messages it quotes, every word of the app they quote, and every number with a unit. The suite uses real files and real child processes, refuses to run as root, and passes on macOS and on Linux (Node 22, as a user that is not root); the plugin itself has been run on macOS only.
|
|
246
|
+
|
|
247
|
+
`docs/preview.png` is rendered from `docs/preview.svg` by `scripts/preview-png.sh` (Chrome and the Swift toolchain, macOS). `assets/icon.png` is the icon the manifest names.
|
|
248
|
+
|
|
249
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) has what a change needs, and how a release is cut; [CHANGELOG.md](CHANGELOG.md) lists what each release changed.
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
MIT, see [LICENSE](LICENSE).
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## What this plugin promises
|
|
4
|
+
|
|
5
|
+
With the daemon reached over the relay or Tailscale, and an honest but careless agent:
|
|
6
|
+
|
|
7
|
+
- **On its way, a value is sealed.** What you type, and a file you pick, drop or paste, leaves the app only as ciphertext: sealed to a one-time key of that request (X25519, HKDF-SHA256, ChaCha20-Poly1305), and bound to the request's id and to a digest of the keys it declared and whether each is optional. A file is sealed like text: its bytes travel as base64url inside the same sealed payload, so no RPC carries them in the clear, and the plugin keeps them nowhere but in their set in `drop/`. If sealing is impossible, nothing is sent: there is no plaintext fallback.
|
|
8
|
+
- **On the daemon, a value is a short-lived file.** On disk it exists in the clear only as a file of mode `0600` in a directory of mode `0700`, `<data>/drop/si-secret-<requestId>/<KEY>`, for at most 15 minutes after the write while the machine is awake, and within a minute of waking when it slept through that deadline. It goes earlier when the agent releases it, at the end of the turn its delivery message starts, and at every start and stop of the plugin. What a crash does to this is below.
|
|
9
|
+
- **Nowhere else.** No tool result, message to the agent, pill, status, RPC answer, log line, error, `requests.json` or `outbox.json` holds the value. The agent is given paths; no tool and no RPC returns a value.
|
|
10
|
+
- **The daemon names who asks.** A request belongs to the agent the daemon hands the plugin with the tool call, which the daemon names from the agent's connection to its MCP server. Nothing the call itself says (an argument, the agent's environment, a marker) is read. That keeps agents apart that use the connection Paseo gave them: none of them can put a request in another agent's chat. Of the four tools, status, cancel and release answer any other such agent, its parent included, as if the request did not exist. It does not hold against a process that calls the daemon as another agent: on Paseo 0.14.0-beta.1 the name a connection claims is not bound to a credential (below).
|
|
11
|
+
|
|
12
|
+
That is the whole promise. While a file of a set exists, any process of your OS user can read it, the agent included. What keeps the value out of the model is the agent's discipline (the skill: never read a `si-secret-` path) and the plugin showing the value nowhere: discipline, not a lock.
|
|
13
|
+
|
|
14
|
+
## When it does not hold
|
|
15
|
+
|
|
16
|
+
Each row is a condition and what follows from it. None is softened. The plugin flags one thing: a second, different submission to a request whose values were delivered is refused, marked on the pill and reported to the agent. Beyond that it neither prevents nor, in general, detects what a process that runs as you does.
|
|
17
|
+
|
|
18
|
+
### What the plugin cannot control
|
|
19
|
+
|
|
20
|
+
| Condition | What happens |
|
|
21
|
+
|---|---|
|
|
22
|
+
| The agent reads a file of the set | The value enters its context. The skill forbids it and the delivery message repeats it: a rule, not a lock. A rule in the agent's harness that refuses its file-reading tools on `si-secret-` paths adds a lock where that harness can enforce one |
|
|
23
|
+
| The agent feeds the value to a command that prints it | The value reaches the model through that command's output: a tool that echoes what it stored, a verbose flag, `set -x`, an argument repeated in an error. The skill lists moves that print nothing; which commands print is outside the plugin |
|
|
24
|
+
| Another process of your user reads the file while it exists | Nothing stops it. The modes `0600` and `0700` keep out other users only, and every agent of yours runs as you |
|
|
25
|
+
| The file system copies on write, or a snapshot or a backup runs while the file exists | Deletion is `unlink` and `rmdir`, and the content is not overwritten first: on a copy-on-write file system (APFS, Btrfs, ZFS) overwriting guarantees nothing. The blocks stay on the disk until they are reused, and a snapshot or a backup taken while the file existed keeps it |
|
|
26
|
+
| A value is held in memory | Byte buffers are wiped, in the app and on the daemon, but the strings made from them cannot be. The text you type is a string in the form for as long as it is open, and on the daemon the opened payload's values are strings until the garbage collector reuses their memory. Whoever can read that memory can read them |
|
|
27
|
+
| You paste into a file row, or pick or drop a file | The plugin reads no clipboard and moves no file. What you copied stays in your clipboard and in any clipboard history, and the file you picked or dropped stays where it was. While the paste area is open, what you pasted is on the screen |
|
|
28
|
+
| The value reaches its destination | Where the agent puts it (an `.env`, a secret store, a server) is outside the plugin. Whether that place is ignored by git, backed up or readable by others is for the agent and for you to check |
|
|
29
|
+
| You answer a truthful but harmful request | Inherent to the feature: the form shows the keys, and the agent's own message says why it asks |
|
|
30
|
+
|
|
31
|
+
### A hostile process that runs as you
|
|
32
|
+
|
|
33
|
+
An agent with a shell runs as your OS user, controls its workspace, and can read and write the plugin's data directory. Nothing here prevents what such a process does.
|
|
34
|
+
|
|
35
|
+
| Condition | What happens |
|
|
36
|
+
|---|---|
|
|
37
|
+
| A process calls the daemon's MCP endpoint for agents as another agent | On Paseo 0.14.0-beta.1 the daemon takes the calling agent's id from what the connection to that endpoint claims (`callerAgentId`), and lets the connection in with the one token it puts in the configuration of every agent it starts, with the daemon's password as the bearer token, or with nothing at all when the daemon has no password. So a process that can reach the endpoint (one of your user, which can read that token; one that knows the daemon's password; and any process at all on a daemon with no password) can call the plugin's tools as any agent whose id it knows: put a request, and its pill, in that agent's chat, a card that asks you for a secret on behalf of an agent that never asked (phishing), and look at, cancel or release that agent's requests. The plugin cannot tell such a call from the agent's own; the host is where it can be closed |
|
|
38
|
+
| Any owner session of the daemon calls the plugin's RPCs, an agent holding the daemon's local credential included | A handler is not told who is calling, so no call proves that a human acted. Such a caller can read a request's view (its keys, labels and public key, never a value), submit its own values before you do, decline a request, or send three submissions that cannot be opened and so close it (`retry_limit`). If it submits first, the files hold its values. Your own submission is then refused, the pill turns red, «Підозріле подання», and the agent is told to have you check what it did with the values and to rotate the secret. That flag is all the detection there is |
|
|
39
|
+
| A caller of `secure-input.drop.clear` | It deletes every set at once, as «Видалити всі файли секретів зараз» does. Agents lose the files they had not moved yet, and an agent whose delivery message was still waiting is told that the user deleted them. A denial, never a leak: the call answers two counts, and no path, name or value |
|
|
40
|
+
| A process plants `requests.json` or `outbox.json` | Both are read as hostile input: capped, never through a link, and entry by entry against a strict schema in which no field can hold a value. A planted outbox entry can at most make the plugin send a fixed message of its own again, to the agent whose request it is about, once per restart. A planted record that passes the schema is loaded. If it claims to wait or to be delivered, the next start ends it (`expired`, or `released` by `restart`) and puts a pill with the record's key names in the chat of the agent the record names; for one that claimed to wait, it also sends that agent the fixed message for a request the restart ended. A planted record that is already closed is announced by nothing on its own; with a planted outbox entry for it, the plugin sends that record's fixed message to the agent it names. No value can ride along, and nothing can be opened or written for such a record: the key to open it never existed in this run |
|
|
41
|
+
| A process plants entries or links in `drop/` | The start's sweep removes everything in `drop/`. A link is unlinked as a link and never followed, and removal goes at most 8 levels deep; what is deeper was not made by the plugin, and is left and reported. A `drop/` that is itself a link, or not a directory of your user, fails the start-up; put in its place while the plugin runs, it is refused by every write and every removal, nothing behind it is touched, and what was to go stays reported until it can go. Anything planted at a set's path but an empty directory makes that write fail (`write_failed`); an empty directory there is replaced by the set |
|
|
42
|
+
| A process swaps a directory for a link in the instant before a removal | Node has no `unlinkat` or `openat`, so every removal goes by path. Before each entry the plugin looks at the entry's directory again, and goes on only if it is still the directory it read (the same device and inode); `drop/` itself is held to this as well, and has to be a directory of your user, never a link. A swap that lands between that look and what it guards is not caught: for a file, its `unlink`, which then removes a file of the same name wherever the link leads; for a directory, its own first look, after which its removal goes on there, at most 8 levels deep. A write holds `drop/` when it begins and looks at it once more right before the rename that puts the set in place; between the two its files go by path into the directory it staged them in, so a `drop/` swapped for a link in that time leads those files to the same names where the link points. A process that can win these races can read or delete what they reach by itself |
|
|
43
|
+
| The data directory is inside a workspace (`PASEO_HOME` there) | The sets are files in that workspace while they exist, and a `git add -A` there can stage one. The plugin does not check where its data directory lies |
|
|
44
|
+
| `bin/`, where v1 was installed | It holds what agents created under v1 run: the stub and the shim that starts it. A process of your user can replace them between two starts, as it can change the plugin's own code. Each start writes the stub again, and under Node the shim too; under Electron the shim stays as v1 wrote it |
|
|
45
|
+
|
|
46
|
+
### Crashes, stops and restarts
|
|
47
|
+
|
|
48
|
+
| Condition | What happens |
|
|
49
|
+
|---|---|
|
|
50
|
+
| The plugin or the daemon is killed, or the machine loses power, while a set exists | The set stays in `drop/` until the plugin next starts: while it does not run, nothing deletes the set, not even 15 minutes after the write. The first thing a start does, once it has made sure the data directory is its own, is to sweep `drop/`, before anything else that can fail; a start that fails after that has still swept. What that sweep cannot remove is reported, and each such entry is tried again once a minute, by itself, until it goes; the sweep is not repeated, since it would take the sets delivered since. A plugin that never starts again leaves the set where it is |
|
|
51
|
+
| The plugin is stopped | Paseo 0.14 gives a stopping plugin 2 seconds before it sends SIGTERM. Within them the plugin wipes the keys of the requests that wait, releases every set as `stop`, saves, and sweeps `drop/`: the releases and the save get at most 1 second, and the sweep after them at most 500 milliseconds, whatever the work queue is still doing, so `drop/` is emptied even when a task in that queue is stuck. What the sweep cannot remove in that time stays for the next start. A record whose release the stop could not save reads `restart` at the next start, and an agent's waiting message then says the files went when the plugin restarted |
|
|
52
|
+
| The stop comes while the start-up hangs (a disk that stalls) | The stop waits up to 5 seconds for the start-up, longer than the 2 seconds Paseo gives the stop, and then goes on without it. Such a start-up has delivered no set, since every tool call waits for the start-up, so what can be cut short is only the sweep of what an earlier run left, which the next start makes. A start-up that comes back later begins no further step, and the step it was in asks, right before each thing it would still do in `drop/` or `bin/`, whether its plugin is still wanted |
|
|
53
|
+
| A write fails, and its clean-up cannot remove what it staged | The request is rejected (`write_failed`), and the half-written set stays in `drop/` under its temporary name, `si-secret-<requestId>.<random>.tmp`. The plugin keeps its name: «Секрети на сервері» turns red, and it is tried again once a minute, by itself, until it goes. The plugin's stop, its next start and «Видалити всі файли секретів зараз» take it too. Nobody is given its path |
|
|
54
|
+
| A set cannot be removed when its time comes | The request stays `delivered`, it is tried again once a minute, and «Секрети на сервері» turns red. «Видалити всі файли секретів зараз» tries again; so does deleting `drop/` by hand |
|
|
55
|
+
| A disk that stalls holds up the plugin's work queue | Every deletion but the stop's sweep waits in that queue, the deadline's included, so for as long as the disk stalls a set can outlive its deadline. The stop's sweep does not wait for the queue (above). A tool call waits there for its turn for at most 10 seconds and is then refused, `the plugin is busy; retry in a few seconds`, and what it asked for is not done later; neither is what a call that was canceled while it waited asked for. An operation that has begun is waited for to the end |
|
|
56
|
+
| The plugin restarts while a request waits for you | The request becomes `expired`, because the key to open it lived in memory only. The agent is told that the restart ended it, which is not the message for a request nobody answered in time |
|
|
57
|
+
| The plugin restarts while a set exists | The start's sweep removes it, and the request reads `released` (`restart`). A delivery message that still waits becomes the message that the files went when the plugin restarted; one already sent is not sent again. A set the sweep cannot remove keeps its request `delivered`, and «Секрети на сервері» red: the set is tried again once a minute, and the request reads `released` (`restart`) once the set is gone. Until then the request is like any delivered one, and a delivery message that goes out meanwhile gives the paths of the files that are still there. For as long as `requests.json` cannot be saved after a start, the file still shows the requests that waited as waiting, and every further start ends them and announces them again |
|
|
58
|
+
| A message to the agent is late or lost | A message for a busy agent waits, up to a day, in `outbox.json`. It is sent only after the daemon has answered that the agent is idle: when the agent's turn ends, or within about a minute of the agent becoming idle some other way (the plugin asks once a minute). A check that fails or is not answered is not taken for "idle", and the message stays. Agents that have a message waiting are asked one after another, those that did not answer last time after the others; a call to the daemon for one of them may take 30 seconds, or what is left of the 45 seconds one round may take, and 1 second once those are used up. The plugin checks that the agent is idle and then sends, so a turn that starts in between can be interrupted; rare. A message is sent once and is lost only in these cases: the plugin dies before the message was saved; it dies or is stopped after the message was taken out of `outbox.json` and before the send finished; the one send fails or is not answered in time (it is never tried twice); the message waited longer than a day, or more than 256 messages wait and it is the oldest, or the clock was set back by more than a minute while it waited; the agent is archived; the plugin no longer has the request the message is about, because `requests.json` could not be read at a start or the request left the history of the last 200 closed ones first; the change of state was still being saved when a stop of the plugin ran out of its time; or `outbox.json` was replaced by something the plugin did not write. A message about delivered files is not sent at all when the agent released those files before it went out. The agent may then need a nudge from you |
|
|
59
|
+
| The plugin is stopped while messages or pills wait | No further pill is put on a timeline, and no agent is asked whether it is idle. One send can still start: that of a message that was being taken out of `outbox.json` at that very moment. A message that was not sent stays in `outbox.json` for the next start. A change of state whose save was still under way when the stop ran out of its time is saved and announced by nobody, by this start or the next: no message for it, and the pill goes on showing the state before it. In each of these cases the form behind the pill shows the true state |
|
|
60
|
+
| A pill cannot be put on the agent's timeline | The pill is the only way to the form, so it is tried again once a minute and whenever the daemon next calls the plugin, until it lands, and only once in five minutes while the daemon has left three appends of it unanswered. Until then nobody can answer the request. An older state that lands late is followed by the latest one |
|
|
61
|
+
| The plugin is removed, or never starts again | What the next start would have swept stays in `drop/`: the sets of a run that was killed, and what a failed write left. Nothing else of the plugin's holds a value |
|
|
62
|
+
|
|
63
|
+
### The channel and the versions
|
|
64
|
+
|
|
65
|
+
| Condition | What happens |
|
|
66
|
+
|---|---|
|
|
67
|
+
| A direct LAN connection with a password | The WebSocket is not encrypted. An active attacker can swap the request's key and read what you type. Enter secrets over the relay or Tailscale only |
|
|
68
|
+
| Someone sees the size of what you send | The sealed payload is padded to a multiple of 1 KiB, so its size tells how much you sent, rounded up to that multiple, and not how long any one value is |
|
|
69
|
+
| The app is older than the plugin requires (0.14.0-beta.1) | The plugin runs on the daemon, but the pill, the form and the settings screen do not load, so that device cannot answer requests. `paseo plugin ls` does not show it. The daemon must be at that version or later too |
|
|
70
|
+
| The reply to your submission is lost, and you press → again with other values | The form first reads the request again, and sends nothing if the request has been answered. That narrows the window and does not close it: a first submission still waiting in the plugin can win after that reading, and your second one is then refused and flagged as a second, different submission, though both were yours. With unchanged values the form sends the same sealed data again, which is never flagged |
|
|
71
|
+
| Linux | Developed and run on macOS. Linux is declared supported, and the test suite passes on it (Node 22, as a user that is not root); the plugin has not been run on a Linux daemon |
|
|
72
|
+
|
|
73
|
+
## Why approval is not a button
|
|
74
|
+
|
|
75
|
+
A Paseo plugin's RPC handlers are not told who is calling, and any process that can open an owner session of the daemon can call them. A plain "approve" RPC would prove nothing: an agent could press it. In this design the act of typing a value nobody else has is the approval, and no RPC returns a typed value.
|
|
76
|
+
|
|
77
|
+
## Reporting
|
|
78
|
+
|
|
79
|
+
Report a vulnerability privately, through GitHub's private vulnerability reporting on [dutchakdev/paseo-plugin-secure-input](https://github.com/dutchakdev/paseo-plugin-secure-input): the **Security** tab, then **Report a vulnerability**. Do not open a public issue for it, and do not include real secrets in a report: use test values, and leave out the content of any `si-secret-` file.
|
package/assets/icon.png
ADDED
|
Binary file
|
package/client/card.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
2
|
+
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Pressable, Text } from "react-native";
|
|
5
|
+
import type { CardData } from "../shared/card";
|
|
6
|
+
import { RequestDialog } from "./dialog";
|
|
7
|
+
import { MONO } from "./fields";
|
|
8
|
+
import { A11Y, PILL_HEIGHT, pill, pillColor } from "./presentation";
|
|
9
|
+
import { tone } from "./tone";
|
|
10
|
+
|
|
11
|
+
/** The moment the form was opened, or null while it is closed. */
|
|
12
|
+
type Opening = number | null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The pill in the agent's chat: a shield, the title and the keys, in one row of one height. Its look comes
|
|
16
|
+
* from the timeline row alone, which holds names and state (agents can read it), and nothing that happens in the form
|
|
17
|
+
* reaches it: the chat's list does not take a row whose height changes, and it unmounts rows while it scrolls
|
|
18
|
+
* (getpaseo/paseo#7486). Only a pill that waits can be pressed; it opens the form, which reads the request itself. The
|
|
19
|
+
* host has already checked `item.data` against the strict schema given at registration.
|
|
20
|
+
*/
|
|
21
|
+
export function RequestCard({ item, theme, host, layout }: PluginTimelineItemProps<CardData>) {
|
|
22
|
+
const colors = tone(theme.colors);
|
|
23
|
+
const [session, setSession] = useState<Opening>(null);
|
|
24
|
+
const look = pill(item.data);
|
|
25
|
+
const { color, opacity } = pillColor(look.tone, colors);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<Pressable
|
|
30
|
+
accessibilityRole={look.pressable ? "button" : undefined}
|
|
31
|
+
accessibilityLabel={look.pressable ? A11Y.enter : undefined}
|
|
32
|
+
disabled={!look.pressable}
|
|
33
|
+
onPress={() => setSession(Date.now())}
|
|
34
|
+
style={{
|
|
35
|
+
height: PILL_HEIGHT,
|
|
36
|
+
borderRadius: PILL_HEIGHT / 2,
|
|
37
|
+
alignSelf: "flex-start",
|
|
38
|
+
maxWidth: "100%",
|
|
39
|
+
flexDirection: "row",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
gap: 8,
|
|
42
|
+
paddingLeft: 10,
|
|
43
|
+
paddingRight: 14,
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
borderColor: color,
|
|
46
|
+
backgroundColor: colors.raised,
|
|
47
|
+
opacity,
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<Icon name={look.icon} size={16} color={color} />
|
|
51
|
+
<Text numberOfLines={1} style={{ color, fontWeight: "600", flexShrink: 0 }}>
|
|
52
|
+
{look.title}
|
|
53
|
+
</Text>
|
|
54
|
+
{look.detail === "" ? null : (
|
|
55
|
+
<Text numberOfLines={1} style={{ color, fontFamily: MONO, fontSize: 12, flexShrink: 1, textDecorationLine: look.struck ? "line-through" : "none" }}>
|
|
56
|
+
{look.detail}
|
|
57
|
+
</Text>
|
|
58
|
+
)}
|
|
59
|
+
</Pressable>
|
|
60
|
+
{/* Mounted only while it is open, and keyed by the request as well as the opening: a different request is a different form, and closing discards everything this one held. */}
|
|
61
|
+
{session === null ? null : (
|
|
62
|
+
<RequestDialog
|
|
63
|
+
key={`${item.data.requestId}:${session}`}
|
|
64
|
+
requestId={item.data.requestId}
|
|
65
|
+
session={session}
|
|
66
|
+
onClose={() => setSession(null)}
|
|
67
|
+
theme={theme}
|
|
68
|
+
host={host}
|
|
69
|
+
layout={layout}
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
}
|
package/client/codes.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ErrorCode } from "../shared/errors";
|
|
2
|
+
import { MAX_RETRIES } from "../shared/limits";
|
|
3
|
+
import { afterFailedAttempts, attemptsFailed } from "./text";
|
|
4
|
+
|
|
5
|
+
/** The end of the sentence about a refusal that counts: the limit is the plugin's own number, said in words. */
|
|
6
|
+
const CLOSES_AFTER = `${afterFailedAttempts(MAX_RETRIES)} запит закривається.`;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* One sentence for the human for every code the plugin can answer with, so a new code is a compile error until it has
|
|
10
|
+
* one. The settings screen says them, with the code, about a start-up or a hook that failed. The form says none of
|
|
11
|
+
* them: every refusal there is one of its two lines (`./outcome`).
|
|
12
|
+
*/
|
|
13
|
+
export const CODE_SENTENCE: Readonly<Record<ErrorCode, string>> = {
|
|
14
|
+
invalid_request: "Запит або надіслані значення не вдалося прочитати.",
|
|
15
|
+
request_already_pending: "Від агента вже є ще один відкритий запит.",
|
|
16
|
+
unknown_agent: "Плагін не зміг визначити, який агент надіслав запит.",
|
|
17
|
+
service_unavailable: "Плагін зараз не може прийняти запит.",
|
|
18
|
+
write_failed: "Файл не вдалося записати.",
|
|
19
|
+
retry_limit: `${attemptsFailed(MAX_RETRIES)}: зашифровані значення не вдалося розкрити.`,
|
|
20
|
+
request_closed: "Запит уже було закрито, коли ви відповіли (наприклад, плагін перезапускали).",
|
|
21
|
+
decrypt_failed: `Плагін не зміг розкрити зашифровані значення — можливе втручання в канал. Перевірте, що з'єднання йде через relay або Tailscale, і спробуйте ще раз. ${CLOSES_AFTER}`,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const UNKNOWN_SENTENCE = "Невідома помилка.";
|
|
25
|
+
|
|
26
|
+
/** A map, so a name from the prototype (`constructor`, `__proto__`) finds nothing. */
|
|
27
|
+
const SENTENCES: ReadonlyMap<string, string> = new Map(Object.entries(CODE_SENTENCE));
|
|
28
|
+
|
|
29
|
+
/** The sentence first; the code after it, in parentheses, for whoever the human asks for help. */
|
|
30
|
+
export function describeCode(code: ErrorCode): string {
|
|
31
|
+
return `${SENTENCES.get(code) ?? UNKNOWN_SENTENCE} (${code})`;
|
|
32
|
+
}
|