Repository navigation
AI Bridge: let an assistant change a server, with permission - #15
Merged
Merged
Conversation
The server's sshd hands the whole command line to the account's login shell. Values were embedded in POSIX single quotes, where nothing is special. fish reads a backslash inside single quotes as an escape, so a value ending in a backslash escaped its closing quote and the rest of the line could be re-read by the shell. Paths and file-name patterns come from the assistant, so on a host whose login shell is fish a read-only tool could be made to run text the app did not intend. The outer command line is now quoted so that no backslash is ever left inside single quotes. Text read by /bin/sh inside the wrapper keeps POSIX quoting, which is correct there. A comment says which shell reads which layer. Tested against real sh and bash with hostile values. fish is not installed where this was written, so its rules are checked against a model; a test runs the same check through real fish when it is present.
1.6.0 let a paired assistant read from the hosts the user shares. This lets it change them, and only with the user's yes. Everything new ships off, and a shared host stays read-only until the user switches more on. - Tools: run_command, write_file, service_action, run_on_hosts, and a terminal (open_terminal, send_input, read_screen, close_terminal). - A change needs the user's approval on a card in the app that shows exactly what will run, with hidden and direction-changing characters made visible. Deny has the focus, the Allow buttons wait a second, and an unanswered card is a denial after two minutes. - Two exceptions the user sets up beforehand: an exact-match list of allowed commands per host, and an approval for a limited time given on a card. A terminal always asks. - One policy function still decides every call. Hosts and settings are read again after planning and after a yes, so a host edited while its card waited, or stepped down meanwhile, is refused. Approvals, timed approvals and terminals end at once when the bridge goes off, the app locks, the assistant is revoked or the host changes. - A file is written through a temporary file with a random name and is refused if it changed after the card. A stop sends TERM, then KILL. Changes have their own run slots, apart from reads. - No bridge connection carries the user's SSH agent or X11, and the bridge does not borrow an open session that forwards either. - Commands are quoted so a fish login shell cannot reopen a value. - Per-host switches, the allowed-command editor, "Allow for a while", the list of approvals in force, the banner on an assistant's terminal and the activity labels, in nine languages. - Skill, architecture notes, privacy policy, change notes and the 1.7 release checklist. Plugin version 1.7.0. Also: tests that waited a fixed time for a save now wait for the save, which is what failed on slower runners.
…e wait The wrapper around every bridge command has a watcher that sends it USR1 when stdin reaches end-of-file, which is how a stop is signalled. A trapped signal cuts a shell's `wait` short with a status above 128, so if USR1 arrived while the wrapper waited for the command, it exited 138 whatever the command's status was. The wrapper now repeats the wait until the command has really been reaped. A command that died of a signal is already reaped, so its own status stands. The test that caught this started its command with stdin at end-of-file, so the watcher raced the command; it now holds stdin open as the app does. New tests pin both sides: stdin held open gives the command's status, and stdin closed from the start is a stop.
The test ran the supervised wrapper with its input already at end-of-file. That is the wrapper's stop signal, so on a slow runner the command was ended before it printed and the test failed. Run it as the app does, with the input held open until the command has finished.
The backup fix, the fish quoting fix and the departed-peer fix all ship in 1.6.0, so their notes move from docs/changes into the 1.6.0 section of CHANGELOG.md. The release date is 16 November 2026 in the changelog, the Debian changelog, the Flatpak metadata and the privacy policy.
Version 1.7.0+17 in pubspec.yaml (and the MSIX version), the snap, the About box and the Flatpak metadata, with a new Debian changelog entry. The AI Bridge notes move from docs/changes into CHANGELOG.md under 1.7.0, dated 16 November 2026. The README names 1.7.0 as the latest release.
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.
What this adds
1.6.0 let a paired assistant read from the hosts the user shares. This
lets it change them, and only with the user's yes. Everything new ships
off, and a shared host stays read-only until the user switches more on.
run_command,write_file,service_action,run_on_hosts,and a terminal (
open_terminal,send_input,read_screen,close_terminal).will run, with hidden and direction-changing characters made visible.
Deny has the focus, the Allow buttons wait a second, and an unanswered
card is a denial after two minutes.
allowed commands per host, and an approval for a limited time given on
a card. A timed approval covers every change tool on that host for
that assistant. A terminal always asks.
changes", "Allowed commands", "Full control terminal". In Settings:
"Allow for a while" and "Approvals in force". Nine languages.
How it stays safe
read again after planning and after a yes, so a host edited while its
card waited, or stepped down meanwhile, is refused.
goes off, the app locks, the assistant is revoked or the host changes
(address, port, user, connection type or jump host).
allowed list and the string that runs.
refused if it changed after the card.
bridge does not borrow an open session that forwards either.
Changes outside the bridge
HostStore.changes, a stream of the host list after each change.SessionManager.open(activate:)and a marker on a session anassistant drives. Nothing changes for ordinary sessions.
SystemdCommands.reload.copyWith, so a field added later is kept.is what fails on
mainon Linux arm64 and Windows x64.Tested
flutter analyze: no issuesflutter test: 5828 passed, 491 skippedSSGO_SSHD=1): 36 passed, including a plantedlink at the temp file's name, a command that ignores TERM, the
terminal end to end, and no agent socket in a bridge command
with no card; a near miss, a file write and a service action each
waited for approval and ran nothing when cancelled; the terminal and
unknown hosts were refused; the activity log recorded each call
Not verified
tests, including keys held down and clicks already in flight.
bash and against a model of fish's rules.
store/release-checklist-1.7.md.Known limits
blocked-path list does not apply inside it.
Overlap with open PRs
This branch contains the fixes in #13 (backups keep every setting) and
#14 (fish quoting). Whichever lands second will need a small merge.
Before release
Version strings still say 1.6.0, and the plugin is already at 1.7.0.