This document states, as plainly as we can, what the AI copilot in Smart SSH can and cannot see, where your data lives, which network connections the app makes, which actions always need your confirmation, and which risks remain. Every statement links the spec, ADR or code that backs it. Specs and ADRs are written in German; file and section references are given so you can check each claim.
If a statement here disagrees with the code, the code is wrong or this
document is wrong — please open an issue. To report a vulnerability, do not
open an issue; follow SECURITY.md.
Scope. The Community edition in this repository: the desktop app, its local database, its connections to SSH servers and to the AI providers you configure, and the optional local MCP server. Out of scope: the security of your SSH servers themselves, of the AI provider you choose, and of the operating system account Smart SSH runs under. Anyone who controls your OS account (or can read process memory while the app is unlocked) is outside what this app can defend against.
When you chat in a session, the active AI provider receives:
- A system prompt with the server's display name, the allow rules that
apply to this server, and the server and group notes. Hostname, user name
and tags of the profile are not part of the prompt.
(
crates/app-logic/src/system_prompt.rs,crates/app-shell/src/commands/connect/mod.rs,crates/app-logic/src/compaction.rs) - The remote OS banner (
uname -a) read at connect time, as fenced untrusted content. - Your chat messages and the chat history of the session (redacted before sending, see section 2).
- Output of commands that ran (stdout/stderr) and contents of remote files the AI asked to read — both redacted, then fenced as untrusted content.
- The commands themselves that the AI proposed or that you approved.
Structurally, a provider only accepts a RedactedContext
(crates/core/src/ai/redacted_context.rs):
it has private fields and can only be built by RedactedContext::seal (seals
extension content, then redacts the whole history again, as the last step
before sending) or by one named exception, the risk second opinion, which
sends the command or path text as is (see above). A new request path cannot
skip redaction without failing to compile.
Content that comes from the server is treated as untrusted data, never as
instructions: it is wrapped in tagged fences with <, > and & escaped,
and the system prompt tells the model not to follow instructions inside them
(Spec 0039,
ADR 0027,
ADR 0034,
crates/core/src/ai/fencing.rs).
Fencing makes prompt injection harder; it does not make it impossible —
which is why the confirmation boundaries in section 5 exist.
Besides the chat itself, the app makes further AI calls inside a session you
started, only to providers you configured: history compaction, session
title, note suggestion, note shortening, and — if you enable them — a risk
second opinion and an injection check. The full list with triggers is in
docs/netzwerkverbindungen.md. Compaction,
title, note suggestion and note shortening send redacted history; the
injection check receives redacted output. The risk second opinion receives
the proposed command or path text as is, without redaction
(crates/app-logic/src/second_opinion.rs).
- Credentials from the credential store: SSH passwords, private keys,
key passphrases, certificates, stored sudo passwords, AI provider API keys
and the MCP token are never put into a prompt. The prompt is built from the
server name, rules, notes and session content only
(
crates/app-logic/src/system_prompt.rs). - Identity files on disk: a key file referenced by path is read only to
authenticate, its buffer is zeroed afterwards
(Spec 0076,
crates/app-logic/src/key_files.rs). - A stored sudo password: when a command needs it, the command is
rewritten to
sudo -S …and the password is written to the command's stdin. The command text that reaches the result, log and AI context contains-Sbut not the password. The session's redactor additionally knows the password as an extra pattern, so if the server echoes it, it is masked (crates/app-logic/src/orchestration/action_exec.rs,crates/app-logic/src/server_redaction.rs). The elevated file browser (Spec 0067) uses it too, but only whensudo -n -lsays a password is required: the channel runssudo -S -k -p '<random marker>' …, and the password is written once, and only after the marker was read from stderr. If the marker does not appear, the channel is closed with nothing written, so the password cannot reachsftp-server. The password is not in the command, log, audit line or any error; the audit line records onlysudo_authandserver_logging. The elevatedsftp-serverruns with the fixed arguments-l INFO -f AUTHPRIV(the suggested sudoers rule allows exactly these, or none for older rules), so the server's own auth log records every file request; the arguments are a constant, never user input. Elevated rights end on their own as well: a per-channel idle timer (default 15 minutes,elevatedIdleTimeoutMinutes∈ 5/15/30/60/0 = never, a security setting only changeable through its own validated command) revokes the channel exactly like the manual switch-off. An invalid or missing stored value falls back to 15 minutes, never to "never"; a running elevated operation postpones the switch-off. The webview is told by an event and shows a toast; the audit line recordsreason = "inactivity". A per-server switch (elevation_allowed, default on, issue #1194) can forbid the mode altogether: enabling is refused before any probe or sudo call, an unreadable profile counts as forbidden, and turning the switch off revokes a running channel at once. It only restricts; it never lifts a check.
"Never sees credentials from the credential store" does not mean "never sees a secret". The AI sees whatever the server prints and whatever you type into the chat, minus what the redactor recognises (section 2). Examples:
- a secret in a configuration file the AI reads, if its format is not one the redactor knows;
- a password you paste into a chat message;
- a secret you wrote into a server or group note (notes are sent as written, fenced but not redacted, because you authored them).
Before content leaves the app towards an AI provider, it passes through the
output redactor
(crates/core/src/ai/redactor.rs).
Redaction also runs before note suggestions are stored and before an activity event reaches an observer (the core keeps no activity record of its own, ADR 0161); MCP-driven actions reach observers with source mcp-agent and the same redaction; the MCP client name from the handshake is only a label in the session-start event, shortened to 64 characters, and is never used as an instruction or put into a prompt,
and before server notes are returned to an MCP client
(ADR 0103).
The redactor recognises a finite list of known secret formats:
- private key blocks (
-----BEGIN … PRIVATE KEY-----); password=,token=,api_key=-style assignments;- well-known token formats: AWS, GitHub, GitLab, Slack, Stripe, Google, npm,
Anthropic, OpenAI, OpenRouter, Hugging Face, Twilio, SendGrid, JWTs,
Azure
AccountKey=; Authorization: Bearer/Basicandx-api-keyheaders;- credentials in URLs and database connection strings, including
@inside the password and credentials as query parameters (Spec 0078, ADR 0069); - password hashes (crypt/shadow formats, Argon2, phpass);
- the formats of common secret files:
.netrcentries (any field order, quoted values, also a single entry line),.pgpasslines, Dockerauthvalues, kubeconfigclient-key-data; - passwords on common command lines:
mysql -p…,sshpass -p,curl -u,htpasswd -b,redis-cli -a,smbclient -U,openssl -pass(Spec 0095, ADR 0087); - the stored sudo password of the current server, if one exists.
New patterns were added in Spec 0068, Spec 0078 and Spec 0095.
If the profile store fails while the app determines which extension secrets
apply to a server (server or group lookup), or the stored sudo password
cannot be read, or a secret cannot be compiled into a pattern, the session
keeps masking what it already knew (a rebuild extends the set instead of
replacing it), masks at least the server-level secrets, and shows one chat
notice REDACTION_INCOMPLETE. The sessionless note summary uses the same
lookup and shows the same notice once (via the note-shrink failure toast). If
the profile store fails while the server
tags are read for rule evaluation, the rules run on the tags from connect
time and an action that would run automatically asks for confirmation
(FILTER_SERVER_TAGS_UNAVAILABLE) — never the other way
(crates/app-logic/src/session_extension.rs,
crates/app-logic/src/orchestration/escalation.rs).
A registered session extension can also refuse a connection before any
transport, host-key prompt or credential read (SessionExtension::check_connect).
The same check runs before the reconnect of an existing session (manual and
automatic), so a refusal cannot be bypassed by connecting first and
reconnecting later; a refused automatic attempt is not retried.
It only restricts: it runs outside the filter engine, cannot change a filter,
risk or confirmation result, and fails closed (an unresolved or incomplete
server scope refuses the connect or reconnect). Without an extension nothing changes.
We redact known secret formats. Unusual formats can slip through. Do not connect production servers with unusual secret layouts to external AI providers.
Concretely, the following can reach the AI provider in plaintext:
- proprietary or in-house token formats the redactor has no pattern for;
- connection strings or config lines that carry a secret without a
recognisable key such as
password=; - unusual hash layouts;
- an ad-hoc password that appears on its own, without a recognisable context.
A generic "high-entropy string" fallback was considered and rejected
(Spec 0068;
see the comments in
crates/core/src/ai/redactor.rs): it
would mask commit hashes, checksums, IDs and similar values the copilot
needs to do its job, while still not reliably catching short or low-entropy
secrets. Known edge cases of individual patterns are documented, e.g.
values that stop at ,, ; or "
(Spec 0078), one URL
shape where a password prefix stays visible
(ADR 0069, §6),
and chains of three or more command-line secrets in one line
(ADR 0087).
If you need the AI on such a server, use a local OpenAI-compatible
provider (e.g. Ollama on 127.0.0.1): then nothing leaves your machine
(docs/netzwerkverbindungen.md).
- Commands are shown, stored and sent as they are, so you always see exactly what runs. A secret the AI writes into a proposed command is visible to you in the confirmation dialog.
- Filter decisions in activity events contain only text generated by the filter engine. The free-text reason of the AI second opinion is never stored for that reason (ADR 0084, §3).
- File reads and writes by the AI appear in activity events as path, size, SHA-256 and (for writes) backup path only — never the file content or a diff. Paths are redacted like command text. A SHA-256 of very short or low-entropy content (a PIN file, a single-token line) can be recovered by brute force, so the hash is not a secrecy boundary: the protection is the extension that stores the event, not the hash (ADR 0161).
- Your own chat messages are stored as you typed them (inside the encrypted database, section 3) and redacted only when they are sent.
The exact paths per platform are listed in
docs/datenpfade.md; the running app shows them under
Settings → Diagnostics → Data paths. A second instance can be pointed at its own
directory with --data-dir, SMART_SSH_DATA_DIR or a pointer file next to the
app (Spec 0115); then every file of that instance lives there, and an unusable
directory stops the start instead of falling back to the default one. The
pointer file only names a path and holds no secret. An instance with such an override keeps its keychain entries under its own service Smart SSH (<id>) (id = first 12 hex characters of the SHA-256 of the canonical data-directory path, Spec 0101 A25), so it cannot read, replace or delete the secrets of the default instance.
| Data | Location | Protection |
|---|---|---|
| Server profiles, groups, notes, rules, chat sessions, AI provider settings | Database smart-ssh.db |
Whole file encrypted with SQLCipher |
| Secrets: SSH passwords, private keys, passphrases, certificates, sudo passwords, AI API keys, MCP token | Database smart-ssh.db, table secrets |
Whole file encrypted with SQLCipher |
| Database key (root key) | OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) — or, if you set a master password, a key file smart-ssh.db.master-key next to the database |
Keychain: protected by the OS. Key file: root key wrapped with ChaCha20-Poly1305 under a key derived from your master password with Argon2id |
| Known host keys | host_keys.json next to the database |
Plaintext (public keys and fingerprints) |
| App settings (language, layout, MCP on/off and shared servers, risk settings, notes and tags of the local pseudo-server) | settings.json |
Plaintext, no secrets; the MCP token is not stored here |
| Logs | Log directory | Plaintext; no content at the default level (see below) |
| Edit copies of remote files you open in a local editor | User cache directory, one folder per data directory and session | Plaintext; owner-only permissions on Unix; removed when editing ends, the session disconnects, and at startup |
| Exports you save (e.g. diagnostics) | Wherever you save them | Plaintext, as you chose |
Backing documents:
- Database encryption: the whole database file is encrypted with
SQLCipher, keyed with HKDF-SHA256 of a random 32-byte root key. No file
outside the database holds host names, user names, header values, secrets
or the MCP token in plaintext
(Spec 0101,
ADR 0093,
ADR 0095,
crates/persistence-sqlite/src/encryption.rs). - Secrets in the database: credentials live in the encrypted database, the OS keychain holds only the root key (Spec 0096, ADR 0088, ADR 0094).
- Chat content: stored in the encrypted database. The earlier additional per-field encryption was removed in favour of whole-file encryption (Spec 0036, ADR 0112).
- Linux without a Secret Service: the app cannot use the keychain, so it asks you to set up a master password instead (Spec 0101).
- Logs: at the default level (
info), log lines carry no content — no commands, output, chat text or secrets. Content is logged only atdebug, which is off unless you enable it explicitly, and is redacted there too (Spec 0094, ADR 0086). - Edit copies: ADR 0114.
- Host keys: ADR 0012.
What encryption at rest protects against: someone who gets a copy of the data directory (backup, stolen disk) without access to your unlocked OS account or your master password. It does not protect against malware running as your user while the app is unlocked.
What the core stores. Nothing: since issue #1506 the core keeps no activity record. Earlier versions held a ledger and recorded sessions in the database; migration 0030 drops them, so old command output no longer stays on disk.
Who receives events. Extensions of an edition that register an observer. An observer is trusted code inside the process (see section 5); it is not a sandbox. What it stores, and for how long, is its own responsibility.
Residual redaction risk. An event holds what the redactor knew when it was built. A secret that became known later cannot be removed from what an observer already stored, and events marked "redaction incomplete" were built while a secret lookup had failed. The generic patterns are heuristics (see the explicit limit in section 2).
Rule for anything that leaves the device. Text that goes to a third party
(export, sync, upload, an AI provider) must be redacted again with
redact_for_server, which uses the server's current redactor including the
secrets session extensions contribute. For a deleted server only the generic
patterns apply, and the result says so ("generic only"); callers must treat
such text as less protected. A failed secret lookup is reported as "incomplete"
instead of being hidden.
Activity observers. An edition can register observers that receive each event of a session as it happens (commands, decisions, AI messages, file reads and writes, failed file writes, connection changes, session start and end, and a content-free "user was active" tick at most once a minute per session). Terminal input is never read for this: a keystroke only sets a flag, nothing of what is typed is stored, counted or put into an event; connection events carry no error text. The core builds these events from redacted content; file events carry path, size and hashes, never content. Delivery runs on its own worker behind a bounded queue and never blocks a command: a slow observer makes events drop (counted), a panicking observer is caught. With no observer registered no event is built. What an observer does with an event is outside the core; it is trusted code inside the process, and the rule for anything that leaves the device above applies to it.
Smart SSH makes no network connection you did not trigger: no telemetry, no update check, no license check, no fonts or scripts loaded from the internet. The complete list — SSH, every AI provider call, the local Ollama probe and the local MCP listener — with destination, trigger and whether the connection leaves your machine is in docs/netzwerkverbindungen.md (issue #14).
In short:
- SSH goes to the servers (and jump hosts) in your profiles, when you connect or test a connection.
- AI calls go only to the base URL of providers you configured. With a local provider they stay on your machine.
- Model discovery in the provider form goes to the base URL entered there, triggered by leaving the API key or base URL field with a key entered, or by the click on "Modelle laden" (Load models).
- The Ollama probe goes to
127.0.0.1:11434only, once when the AI settings open and no Ollama provider exists. - The MCP server is off by default; when enabled, it listens on
127.0.0.1only and requires a bearer token (Spec 0028). The token is held as a secret type and compared in constant time; input types that carry secrets have a redactingDebug, so they cannot leak through a?valuelog field.
This is enforced by tests: the webview's Content Security Policy allows only
connect-src 'self' ipc:, and only an allowlisted crate may depend on an
HTTP client
(apps/smart-ssh-community/tests/network_boundary.rs).
Host keys. Unknown host keys are never accepted silently: the connection pauses and shows the fingerprint until you confirm it. A changed host key is a hard stop with a strong warning (Spec 0005, Spec 0100).
The webview that renders Smart SSH's own user interface is part of the
trusted base. Code running in it acts with your authority: it can type into
terminals, answer pending confirmations, regenerate the MCP token and change
settings, including safety settings such as "Always confirm on red risk".
This is by design: the interface is your hand. Two facts make it so. The
app's own Tauri commands are not restricted per command; the main window's
capability file grants no per-command limits and also allows reading the
key-value store that holds settings.json
(capabilities/default.json).
The capability grants read access to that store only: the webview can read
settings.json but not write it. Every settings change goes through a backend
command. Security settings (red-risk confirmation, the AI risk second opinion,
the MCP settings) have their own commands
(risk_second_opinion.rs); plain
UI preferences go through one command that accepts only registered keys and
value shapes and never a security key
(ui_preferences.rs).
The confirmation boundaries below protect you against the AI and against external tools, not against code running in the webview.
What keeps foreign code out of the webview:
- Content Security Policy.
default-src 'self'; script-src 'self': only scripts bundled with the app run; no inline or remote scripts (tauri.conf.json). A test fails if any directive or source in the policy changes (network_boundary.rs). - No remote content. No scripts, fonts or other resources are loaded from
the internet, and
connect-srcallows only the app itself and the Tauri IPC (section 4, docs/netzwerkverbindungen.md). - Server and AI content is not inserted as HTML. At the time of writing
the frontend sources contain no
dangerouslySetInnerHTML,innerHTML,outerHTMLorinsertAdjacentHTMLoutside tests (frontend/src); the one place that renders longer external text, the third-party licenses dialog, shows it in a plain-text element (ThirdPartyLicensesDialog.tsx). This is a property of the current code, not enforced by a test.
Every action the AI proposes passes the filter engine first. Its decision is
AutoExec, Confirm or Deny. Without a matching allow rule the decision
is Confirm: nothing the AI proposes runs automatically unless you
created an allow rule for it
(crates/core/src/filter/engine.rs).
Commands you type yourself in the terminal, and actions you trigger by hand
in the file browser, are yours and do not pass the filter
(Spec 0054).
The following cases require confirmation even when an allow rule
matches. Escalation only goes one way: these checks can turn AutoExec
into Confirm, never Confirm into AutoExec, and never lift a Deny
(crates/app-logic/src/orchestration/action_exec.rs).
| Boundary | Always? | Backed by |
|---|---|---|
| MCP / external tools: every action an external MCP client requests (run command, read/write file, note update). MCP is the interface for external tools | Always; not configurable | Spec 0028, Spec 0104, Spec 0039 |
| File writes proposed by the AI (SFTP write) | Always | Spec 0020, §4.2 |
| Overwrite or delete in the file browser (your own action) | Always | Spec 0054 |
Reading typical secret paths (SSH keys, .env, …) |
Always | action_exec.rs |
Starting sftp-server (elevated file browser) from an AI proposal |
Always | ADR 0058, §8 |
| Commands that use a stored sudo password | Always | action_exec.rs |
| Commands into which stored secret values are inserted right before sending (by an outgoing transform of the edition) | Always | Spec 0038 |
| Suspected prompt injection in content just read (if the injection check is enabled) | Always for the next action | Spec 0039, §5 |
| Any action after you rejected an earlier one in the same answer | Always | action_exec.rs |
| Commands too long, too nested or too opaque to check, including line continuations, shell comments and backslashes inside backticks (plain backslash escapes are resolved and checked against the rules) | Always | ADR 0107, ADR 0162 |
| Filter rules that cannot be loaded (unreadable rule store or failing rule source): all allow rules are ignored | Always | Spec 0002, §3.4 |
Hard-blacklisted commands (e.g. rm -rf /) |
Always | engine.rs |
| Content read from the server (post-ingest policy) | Per server: Strict always, Balanced for modifying actions, Standard never |
Spec 0039, ADR 0027 |
| Red risk: the risk indicator rates the proposal red on the server or the data axis — also when only the AI second opinion raises it to red | Setting "Always confirm on red risk", on by default | Spec 0092, ADR 0084 |
A command prepared for sending must keep the structure of the approved one: if it splits into a different number of top-level segments, nothing is sent.
About red risk. The setting is on by default, and a missing or unreadable value counts as on. With it on, a red-rated proposal never runs without your confirmation, even against an allow rule. You can switch it off in the AI settings; then red is shown as a warning only, from the next connection on. If you edit a command in the confirmation dialog and run it, your click is the confirmation: the edited text passes the filter engine again, but not the red-risk check (ADR 0084, §7–§8).
Risks we know about and accept, with the reason.
- Outdated SSH algorithms are negotiable
(Spec 0005, issue #1173). After all
current algorithms the client also offers legacy ones (SHA-1 key
exchange and MAC, CBC ciphers,
ssh-rsa) so old servers stay reachable. A downgrade needs a server that offers nothing better: current algorithms are listed first, and the key exchange hash covers both algorithm lists, so a man in the middle cannot strip modern ones unnoticed. Every negotiated legacy algorithm, and a missing strict key exchange (Terrapin), is shown to the user as a warning; the connection is not refused. Accepted so that legacy devices work; mitigation: update the server. - Redaction is pattern-based. Unknown secret formats reach the AI provider (section 2). Accepted because a generic entropy fallback would break the copilot's usefulness without closing the gap (Spec 0068). Mitigation: use a local AI provider for sensitive servers.
- Keyboard-interactive and multi-step SSH login (issue #1184). The
server can send arbitrary prompt texts and ask for several rounds of
answers. The prompt texts are untrusted input: they are only ever displayed
as plain text and never interpreted. A stored password is sent at most once,
and only to a single prompt that does not echo its input, when the server
does not offer
passwordat all; it is never sent to a visible or multi-field prompt. Answers are not logged, not put in the connect step log and not in error messages. Rounds (10 per method) and partial-success steps (3 per hop) are capped so a hostile server cannot keep a login going forever; the login time limit pauses only while the user is asked and a 5-minute answer limit applies. The login dialog (issue #1185) shows those texts as plain text only. The answers are secrets: they travel from the dialog to the backend only in the oneanswer_auth_promptcommand (never in an event, a log line or the connect step log), are read from uncontrolled fields that are cleared on submit, and are dropped by the transport right after sending. Answers whose count does not match the questions are not sent. Automatic reconnects and the connection test cannot be asked and fail instead of prompting. - RSA timing side channel (RUSTSEC-2023-0071, "Marvin attack"). The
rsacrate, pulled in by the SSH library, has a known timing side channel with no fixed release. Accepted because Smart SSH is a local client: RSA signing happens on your machine, and an attacker cannot trigger and time it repeatedly from outside. Replacing the SSH library would be the larger risk. Re-evaluated wheneverrusshorrsaupdate (ADR 0028,.cargo/audit.toml). - The risk classifier is pattern-based. Its pattern lists are starting points without a claim to completeness. A dangerous command that matches no pattern is not rated red and, with an allow rule, runs automatically. The filter engine's deny rules and hard blacklist are unaffected (ADR 0084, §4).
- The webview is trusted. A script-injection flaw in the app's own user interface would equal full control over connected sessions and the safety settings (section 5, "Who is trusted inside the app"). Accepted because the interface is your own and the protections listed there keep foreign code out. Hardened: the webview can read but not write the settings store. Security settings ("Always confirm on red risk", the AI risk second opinion) change only through backend commands that validate the value, and UI preferences only through a command with a registry of allowed keys. A script in the webview can still call those commands, so it can change the safety settings; it cannot write the store file directly.
- Allow rules are your decision. An allow rule lets matching proposals run without asking (except for the boundaries in section 5). A rule that is broader than intended widens what the AI can do on its own.
- Prompt injection is mitigated, not solved. Fencing, the optional injection check and the post-ingest policy reduce the risk that content on a server steers the AI. They cannot rule it out; the confirmation boundaries are the last line (Spec 0039).
- The AI provider sees your session content. With a cloud provider, redacted output, your messages and notes leave your machine and are subject to that provider's terms. The risk second opinion receives command text without redaction (section 1).
- Plaintext outside the database.
settings.json,host_keys.json, edit copies and exports are not encrypted (section 3). - Unlocked app, compromised OS account. While Smart SSH is running and unlocked, malware with your user's rights can read its memory or drive the UI. Encryption at rest does not help there.
- Local MCP clients. Any local process that has the MCP token can request actions on the servers you shared via MCP. Every such action still needs your confirmation (section 5) (Spec 0028, ADR 0094).