A sudo password (SUDO_PASSWORD, terminal.sudo_password or the interactive
prompt cache) is sent to whichever terminal backend runs the command. For
container, cloud sandbox, SSH and plugin backends, programs running in that
backend can read it there. Hermes sent it without saying so.
BaseEnvironment._prepare_command, which every backend goes through (managed
Modal included), now passes its result to
tools/environments/sudo_password_note.note_sudo_password_sent. The first time
a non-empty password is sent to a backend whose is_local is False, it logs one
WARNING per process per backend class, naming the backend (derived from the
class name, e.g. docker, ssh, vercel_sandbox) and advising a password that is
only valid there, or passwordless sudo in that environment's image. The
password itself is never logged. A lock guards the once-only state. Which
backends receive the password, the command text and the sudo stdin are all
unchanged.
The sudo docs in tools.md, cli-config.yaml.example and .env.example, and the
SUDO_PASSWORD row in the environment variable reference, now give the same
advice.
Tests (tests/tools/test_sudo_password_backend_note.py) go through real
execute / _prepare_command calls with a cached password: a non-local backend
logs exactly one warning across two commands, docker and ssh each log their
own, LocalEnvironment, a command without sudo, no password and an empty
password log none, and the message never contains the password. A control
test checks that the command text and stdin match the base output for
docker, ssh and local.
The real-pnpm cases spread process.env into pnpm, which also reads the
developer's global config; with ignore-scripts on there (or in
pnpm_config_ignore_scripts) pnpm skips the root preinstall and both cases
fail as if the guard broke. Pin ignore-scripts=false in the child env.
Narrow the docs sentence on pnpm_config_user_agent: the preinstall checks
the agent pnpm reports, so an override naming the pinned version passes.
Follow-up to #150301 (review nits).
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
core_lock_upgrades compared core's lock with the seed alone, so a plugin
holding a core transitive below core's pin (allowed within core's ranges)
was -P'd onto core's pin on every later rebuild, evicted, re-admitted by
the bisect retry and evicted again; `hermes pm install` raised
ResolutionConflict. Each fresh generation now records the core uv.lock it
was built from (core-uv.lock beside the resolved lock); a pin moves only
when core's lock moved past that record too. Generations built before this
keep the seed-only comparison.
`uv lock -P` unpins a name in every fork, so a core bump to a fork the
installing interpreter never selects floated the host's fork to the newest
index release. Forks whose resolution-markers do not hold for the
installing python are skipped.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
A generation with plugin members is seeded from the previous generation's
lock, and uv keeps every seeded pin that still resolves, so a transitive
core's uv.lock bumped (a security release) never reached a plugin-enabled
install. The lock step now passes `-P name==<core version>` for each index
package core's lock holds above every seeded pin; plugin-only pins and
plugin-vs-plugin choices keep the incumbent. A plugin that cannot take the
new pin fails the resolve and the update's existing eviction disables it.
Member-less, repair and replay builds stay frozen and unchanged.
Fixes#91424Fixes#91931
The desktop and dashboard consent dialogs promised 6-hour deletion, but a paste.rs
failure falls back to dpaste.com (1 day, not deletable early); say so. Translate the
two new desktop keys in every locale overlay (overlay-completeness ratchet), use an
interface for DebugShareButton props, and scope the /debug nous upload docs to the
classic CLI: TUI and desktop reach the gateway handler, which refuses it.
Refs #94876
The gateway only has the public paste, so a consent that names private Nous
storage must not be honoured there; point to hermes debug share --nous.
Fixes#94876
A bare `/debug` (classic CLI, TUI slash worker, gateway/messaging, Desktop
slash) and an empty POST /api/ops/debug-share (Desktop Maintenance "Debug
share", dashboard) uploaded logs to a public paste immediately; the privacy
notice was printed only after the paste existed. Typing a diagnostic command
is not consent to publish session logs.
- `/debug` and `/debug nous` now print the privacy notice and upload nothing;
`/debug upload` / `/debug nous upload` is the explicit consent. `/debug
local` is unchanged. The CLI parsing moves into hermes_cli/debug.py
(run_debug_slash) next to the share core.
- /api/ops/debug-share refuses (400) unless the body carries consent: true.
Desktop and the web dashboard ask through a destructive confirm dialog
first and only then send the marker.
- `hermes debug share` (TTY prompt / --yes) and the Nous diagnostics RPC
(caller-side consent) already gated correctly and are unchanged.
Fixes#94876
Review should-fix: the row described reading groups without membership; the adapter's
_telegram_guest_mode and the Telegram guide's guest_mode section say non-allowlisted
groups may trigger only by an explicit @mention. Also notes observe_unmentioned is
allowlisted chats/topics only.
The HERMES_TELEGRAM_HTTP_* / _INIT_TIMEOUT / _DISABLE_FALLBACK_IPS variables
gained rows in the HERMES_* table of environment-variables.md after this PR
was opened; keep that single entry instead of two.
The authz_mixin gate checks for 'mentions'/'all' against a 'none'
default, not a boolean. Update the env-var reference to match the
actual code contract.
Co-authored-by: René Rosenkranz <ninso112@proton.me>
Add TELEGRAM_WEBHOOK_HOST (webhook bind host, fixes IPv6-only
deployments such as Fly.io 6PN) to the env-var reference table and the
Webhook Mode configuration section of telegram.md.
Also document the previously undocumented adapter-read env vars:
HERMES_TELEGRAM_HTTP_POOL_SIZE / POOL_TIMEOUT / CONNECT_TIMEOUT /
READ_TIMEOUT / WRITE_TIMEOUT, HERMES_TELEGRAM_INIT_TIMEOUT,
HERMES_TELEGRAM_DISABLE_FALLBACK_IPS, TELEGRAM_ALLOW_BOTS,
TELEGRAM_GUEST_MODE, TELEGRAM_OBSERVE_UNMENTIONED_GROUP_MESSAGES.
Verified against plugins/platforms/telegram/adapter.py on main.
Closes#78697
Co-authored-by: René Rosenkranz <ninso112@proton.me>
`hermes -p <name> serve|dashboard --isolated` now stops advertising sibling
profiles: /api/profiles, /api/status profiles (+ new `isolated_profile`), the
unified /api/profiles/sessions{,/sidebar} fan-outs and gateway `profiles.list`
answer for the launch profile only, so Desktop's profile rail, sessions sidebar
and SOUL editor show just that profile.
This is listing UX, not a boundary: per the maintainer decision, `--isolated`
is a routing/ops convenience (SECURITY.md §2.2/§2.6). ?profile=<sibling>,
/api/fs/* and the agent's own tools still reach sibling homes; the docs and
SECURITY.md now say so and point tenants at separate OS users or containers.
The scope is captured once at start_server as the canonical launch home (not
get_active_profile_name(), whose default/custom sentinels collide with real
ids), before multi-profile activation can mirror a turn's profile into
HERMES_HOME. The root home and Desktop-owned backends (its SSH serve --isolated
multiplexes every profile per connection) stay unscoped. Launch-path idea from
#91381.
Refs #76932
Refs #91330
Co-authored-by: KeyArgo <daniel.laforce@argobox.com>
An absent key, a non-empty list and a list naming a server keep their MCP
behaviour, so the fail-closed guard for [] cannot overshoot. Documents the
no_mcp / named-server / empty-list semantics next to the MCP toolsets.
Fixes#143574Fixes#147025
Narrow #152653 to defaults only. CLI caps come from DEFAULT_CONFIG, TUI foreground resolution uses that same source, explicit/background budgets remain unchanged, and panels say unlimited. Timeout display uses the shared default without seeding terminal.timeout over a shell override.
Keep the original delegation fix with Max Freedom Pollards authorship. The ignored-config reader/writer policy, refusal and preflight machinery are not included. resolve_turn_limit remains in its original owner; config_turn_limit contains only the display formatter. Ten scoped guards pass; seven fail on base with three existing-behavior cases remaining green. Ruff clean; ty adds no diagnostics.
The reference said it delays a follow-up send after the agent finishes; the
variable actually holds a quick Telegram text follow-up in the queue instead of
interrupting the turn that just started (#152516 thread).
V1, GitHub (sha256=) and Linear signatures are the same body-only
HMAC under one route secret, so rejecting V1 alone still let a
captured V1 MAC replay as Linear-Signature or X-Hub-Signature-256.
A route `signature: generic|github|gitlab|linear` now accepts only
that scheme's headers and rejects every other family with 401; an
unknown value fails closed (startup error / dynamic route skipped /
403). Unset keeps the accept-any behaviour (V1 still rejected) so
existing provider routes keep working.
`hermes webhook subscribe` writes `signature: generic` for new routes
(`--signature` picks a provider; updates keep the existing pin), and
`hermes webhook test` signs V2 for generic/unpinned routes and the
provider scheme for pinned ones. Docs (en + zh-Hans) document the key,
pin the GitHub/GitLab examples and move the generic curl recipe to V2.
Refs #84265
Builds on @fangliquanflq's #83432 (cherry-picked first commit; the remaining
eight commits were re-applied by hand because the adapter has since been
refactored into _probe_bridge_health / _reuse_running_bridge / _bridge_req /
_standalone_send). Port prompted by qwibitai/nanoclaw#4013, which closed the
same class (an unauthenticated loopback webhook) on their Discord bridge.
Why: the bridge binds 127.0.0.1 and checks the Host header, but loopback does
not identify the caller — any local process could GET /messages (read every
inbound) or POST /send (send as the user), and a process that bound the port
first and mirrored /health with the derivable scriptHash was adopted as the
bridge (#83395, #80096).
What:
- bridge.js: every route except GET /auth-proof requires
`Authorization: Bearer <HERMES_WHATSAPP_BRIDGE_TOKEN>` (constant-time);
/auth-proof answers HMAC(token, challenge); express.json() runs only after
the gate; the bridge exits when spawned without a token; bridge_auth.js is
folded into scriptHash so stale auth code is never adopted.
- adapter: per-session secret at platforms/whatsapp/session/.bridge-token
(0600, created once under a cross-process lock), passed to the spawned
bridge via env; _probe_bridge_health is challenge-first so an impostor
never sees the bearer and is replaced; the long-lived aiohttp session
carries the bearer as a default header, so every send/edit/media/typing/
read/poll call is authenticated with no per-call-site change.
- _standalone_send (cron / `hermes send` out of process): READS the persisted
token, never mints one (a bridge spawned without it would not know it) and
reports "No WhatsApp bridge token" until the gateway has started once;
pinned to 127.0.0.1 like the bridge's bind.
- docs: whatsapp.md "Bridge API authentication" + env-var reference row.
Live repro (real bridge.js + real impostor HTTP server, real aiohttp):
origin/main: anon GET /messages 200, wrong bearer /health 200,
impostor accepted by probe = true
this branch: anon GET /messages 401, anon POST /send 401, wrong bearer 401,
adapter probe real bridge ok=true / wrong token ok=false,
impostor accepted = false, impostor saw bearer = false,
impostor requests = [/auth-proof] only
Tests: 2 impostor invariants + adopted-with-bearer in test_whatsapp_stale_bridge
(red on origin/main adapter, green here); token lock + proof binding in
test_whatsapp_bridge_auth; standalone harness answers the challenge.
Remove prospective migration instructions at the maintainer’s decision because the service-migration design is not signed. Keep present ownership facts and all detected service metadata.
The report never stops, restarts or kills anything, writes no service
file, unit, plist or ledger and opens no network connection, but normal
Hermes startup bookkeeping (HERMES_HOME layout, install record, logs,
scratch prune) still runs first, as for any hermes command. Say so in
the module docstring, help text and docs, and add a fresh-process test
through the real entry point that compares the files left behind with
gateway migrate --dry-run and checks every recorded systemctl/launchctl
call is a query.
Report the hermes serve / hermes dashboard background services on this
machine (systemd user/system units incl. Nix hermes-backend, launchd
jobs, s6 slots, containers, Desktop SSH/local backends, detached and
manual processes), the HERMES_HOME each serves, what a future backend
migration would do and why nothing is applied. Text or --json, exit 0,
never stops/restarts/edits/writes anything.
Second review round on the share/copy split:
- A named launch profile's single-use OAuth logins (Claude, Codex, xAI,
Nous) are stripped from its copied auth.json, so for those providers the
new profile reads the default profile's. provision_profile now returns a
warning naming them and the auth add command to fix it.
- The share decision uses the auth fallback's own root test
(_global_auth_file_path) instead of a second resolve() comparison.
- The CLI only suggests --isolated-auth where it would change something,
reuses the launch label it already computed, and the help, docs and the
Desktop bot hint say logins are shared with the default profile.
Review of the new create defaults found that share_auth works by not copying
auth.json, so the new profile reads the default root's (hermes_cli.auth
fallback). From a named launch profile that paired its API keys with the
root's logins and hid its own. A named launch profile's auth.json is now
copied (single-use OAuth grants stripped, as before).
mirrored["auth"] is now derived from the outcome: "shared" when the new
profile has no auth.json of its own. --clone-all no longer reports shared
logins it does not have, and --no-credentials says the root's logins stay
readable.
The CLI names the profile keys and model came from, uses cloned (so
--clone-from without --clone no longer says "no API keys yet"), and the
opt-out tests parse real argv. Docs list the new default and both flags.
`hermes fallback check [--live] [--json]` reports, per fallback entry, whether the switch
could use it:
- static (default): the entry resolves through resolve_runtime_provider with the switch's
own kwargs (fallback_entry_runtime_kwargs), no chain walk, then the session-readiness
credential predicate. No inference request; plugin installs held.
- --live: one minimal completion per statically ready entry, in parallel, on the client the
swap itself builds (route_binding.resolve_route_entry_client; Anthropic Messages, Codex
Responses, Bedrock and ACP on their own wire), shaped by the auxiliary request builder and
streamed where the provider is stream-only. Never through call_llm, whose recovery ladder
retries or answers from another provider and would hide a dead entry. SDK retries off, the
provider's request_timeout_seconds (else 30 s), the aux response shape check. An empty
answer fails as live_response; a provider-reported model other than the one sent (or a
dated snapshot of it) fails as model_mismatch, except where the reported id proves nothing
(adapter wires, Azure, local/private endpoints, router meta-models, Bedrock ARNs).
``auto`` and ``moa`` entries are not one fixed route and keep their static verdict.
run_probes gains ``aws_imds`` so an EC2 instance role counts for a Bedrock probe.
- exit 1 when any entry is not ready; --json carries profile, checked_at and a stable
per-entry record; credentials are never printed; error and model text are redacted,
including the entry's own key when it has no recognisable prefix.
- no AIAgent, session, prompt context or fallback notice.
Based on #63914 by @webtecnica, which proposed the command; rebuilt on the existing
resolvers instead of copied alias/env tables and a raw chat-completions POST.
Co-authored-by: webtecnica <75556242+webtecnica@users.noreply.github.com>
A message outside allowed_topics was dropped with no log line, so a topic
the operator meant to allow (often a thread-less General message read as
topic 1) looked like a dead gateway (#52635). The first drop per
(chat, topic) is now named at INFO with the allowlist. _topic_gates_pass
moves from adapter.py into the topic-routing mixin.
Add TELEGRAM_ALLOWED_TOPICS, TELEGRAM_FREE_RESPONSE_CHATS and
TELEGRAM_FREE_RESPONSE_TOPICS to the environment variable reference and
mention the matching telegram.* config keys in the Telegram user guide.
Documents the whitelist-before-ignore ordering and the General topic
normalization to ID 1.
Closes#78770
Co-authored-by: René Rosenkranz <ninso112@proton.me>
Telegram clients split a long paste into several messages that can reach the
gateway more than 0.3 s apart, so the first part flushed as its own turn and
the rest arrived as a mid-run steer. Text over 1,024 characters now waits
1.5 s for its continuation (2.0 s after a near-4,096 chunk); the 0.18/0.24 s
fast paths for normal-length text are unchanged.
Salvaged from #111162 by @100yenadmin.
Fixes#74752
`pm.build_env --python <system python> --out .venv` builds a checkout venv whose
pyvenv.cfg `home` is outside PM's tool store, so _built_by_pm read it as a main-era
venv and a data root with no recorded selection carried its extras (`all` and
whatever it holds) into every sync. PM now writes `hermes-pm-built = true` into the
pyvenv.cfg of every environment it creates; _built_by_pm accepts that key and keeps
the store-Python check for environments built before it.
38d0d66ee8 counted a checkout venv as pre-PM only when its
hermes_agent dist-info listed no `pm`. Pre-handoff updaters
(v2026.3.12..v2026.5.29.2) run `uv pip install -e .[all]` into the old
venv from the tree they just pulled, so that dist-info lists `pm`. Such
an install's first generation then selected only `[all]` on every path,
the takeover and launch migration included, which main already carried.
Provenance of the Hermes install says nothing. What sets a PM-built env
apart is its interpreter: PM builds every environment on its pinned
Python, so the venv's pyvenv.cfg `home` sits in a tool-store entry whose
facts.json holds a `python` row. No pre-PM installer had that store. The
carry now skips such a venv and reads any other in-tree venv that holds
Hermes. A bare `uv venv` still holds none.
The old-venv carry read any `venv/` or `.venv/` with a site-packages as
the install's pre-PM state. On a data root with no recorded selection (a
test's HERMES_HOME, a borrowing launch) beside a developer checkout, the
`.venv` that CONTRIBUTING.md has contributors build
(`pm.build_env --out .venv`) was unioned into every sync: a narrow
request gained `all` and the dev env's anchors, and CI's core-only
`--extras '[]'` would record `[all]`.
A main-era installer always installed Hermes into its venv from a tree
without `pm`. The carry now requires that: a `hermes_agent` dist-info
whose top_level lacks `pm`. A venv built from a PM tree lists `pm`, and a
bare `uv venv` holds no Hermes, so neither is carried.
tests/pm also stops reading the running checkout's venvs, and the legacy
fixtures build the main-era venv through one helper.
The justfile held per-workspace eslint recipes that duplicated lefthook and
ran whatever ruff was on PATH. It is now one menu of developer commands:
setup, check, fix, test, the JS workspace checks, the desktop and TUI dev
servers, the website build and the PM re-lock. Each recipe calls an existing
script or tool. Python recipes go through scripts/run-in-hermes-env, so they
work in a shell that never ran `source ./activate`.
`just test` requires at least one path, because scripts/run_tests.sh with no
arguments starts the full suite; `just test-all` is that explicit form.
`python -m scripts.code_health.ruff_runner ARGS` runs the pyproject-pinned ruff
that scripts/check resolves. `just fix` and the pre-commit `just ruff` recipe
use it, so the hook no longer depends on the ruff version on PATH.
lefthook.yml keeps its jobs, globs and roots; each job now runs `just ruff` or
`just eslint`. A shell without `just` on PATH fails the hook with "command not
found" rather than skipping the lint.
CONTRIBUTING.md, the developer guide, the package-management reference and the
desktop and TUI READMEs name the recipes beside the commands they run.
Inside a workspace folder npm treats the folder as its own project and
resolves it from the registry, past pnpm-workspace.yaml's overrides and
release-age gate; the root preinstall never runs there, and
--ignore-scripts skips it at the root. Each workspace folder and the root
now carry an .npmrc with engine-strict=true and an engines.npm that no
npm satisfies. npm checks engines only when it builds a dependency tree,
so install (with --ignore-scripts, --package-lock-only or --force), ci,
update, dedupe, uninstall and link fail with EBADENGINE on npm 10 to 12,
while npx, npm exec and npm run work. pnpm reads neither.
The root refusal needs the root devEngines gone (npm skips root engines
while it is set), so this builds on the single-source pnpm pin. The root
.npmrc also makes npx strict about engines anywhere in the checkout.
npm-shrinkwrap.json joins package-lock.json in .gitignore.
The skill drives the yb_* tools, which now ship in the yuanbao Labs plugin; the plugin carries
the skill (ctx.register_skill). Regenerated the skill pages, catalogs and sidebar with
website/scripts/generate-skill-docs.py, dropped yb_* from the ACP TOOL_KIND_MAP as the Home
Assistant move did for ha_*, and the boundary baseline's stale Yuanbao entries
(scripts/boundary_lint.py --update).
The Yuanbao gateway platform (plugins/platforms/yuanbao) and its yb_* tools
(tools/yuanbao_tools.py) now ship as the `yuanbao` plugin in
NousResearch/hermes-labs-plugins, a community-tier, Nous-built, unsupported
plugin. Platform name, toolset name (`yuanbao`), tool names, env vars,
config keys (platforms.yuanbao.*, legacy gateway.yuanbao) and
YUANBAO_HOME_CHANNEL are unchanged.
Migration: a LEFT_CORE row (hermes_cli/left_core_migration.py) installs the
catalog plugin for every home core ran Yuanbao for: YUANBAO_APP_ID (or the
legacy YUANBAO_APP_KEY) plus YUANBAO_APP_SECRET in its dotenv layers (the
process env too for the launch home), platforms.yuanbao on through the
gateway's own config loaders, or the yuanbao / hermes-yuanbao toolset
selected for another platform. The shipped `yuanbao: [hermes-yuanbao]`
platform_toolsets row is not use. The row keeps the yb_* tools off on every
platform whose core composite never carried them, keeps YUANBAO_APP_SECRET
stripped from children (secret_env) and the other YUANBAO_* settings on the
provider blocklist (private_env) while the plugin is absent, and its notice
carries the unsupported sentence.
Core wiring removed: toolsets (yuanbao, hermes-yuanbao, the hermes-gateway
include), Platform.YUANBAO (Platform('yuanbao') resolves once the plugin
registers it), the platform/toolset menu rows, the TUI special case, the
static session note (the plugin's platform_hint carries it), env/config-key
lists, webhook deliver set, startup allowlist list, locales strings and
yuanbao-only tests. Telemetry enum values stay.
`hermes pm update --pnpm` rewrites pnpm-lock.yaml but not the flake's
fixed-output store hash, and no doc named the second step. Document
`nix run .#update-pnpm-lockfile` (what it does and the CI fallback) in the
Nix setup guide, its zh-Hans translation, and the PM maintainer commands.
Container mode forwards every hermes invocation into the managed
container, so this command reads the container's clipboard (none) and
--out is a container path. It fails closed there. Say so in the docs;
keeping the command on the host is a separate change.
Suggested by @BearHuddleston in review.
The image is staged in a temp file and renamed onto --out, so an existing
file came back with the umask default mode: a private 0600 temp file from
mkstemp became 0644 and readable by other local users. Copy the existing
file's permission bits onto the staged file before the rename. New files
keep the old default. The docs now say so, and that a symlink at --out is
replaced by a regular file.
Suggested by @BearHuddleston in review (fix and test).
With a working clipboard tool and a read-only --out file, the command
reported no_image (exit 1) and the extractor's failure cleanup deleted the
existing file. The extractor now writes into a private temporary directory
beside --out and the result is renamed onto it, so an existing file is only
ever replaced by a complete image. A read-only or directory --out is
write_failed (exit 4) before the clipboard is read, and a failed rename is
write_failed too. The extractor itself is unchanged.
Also drops the FILE_LINES allow comment on main.py: the clipboard wiring
is offset by reflowing four short lines of the _BUILTIN_SUBCOMMANDS literal
(same set, same order), so main.py shrinks by one line against main.
Third-party clients read the clipboard image by running the TUI's private
helper script with PYTHONPATH pointed at the source tree. This exposes the
same extractor (hermes_cli.clipboard.save_clipboard_image) as a documented,
device-local command with a JSON reply and stable reason codes:
ok / no_image (exit 1) / no_tool (exit 3) / write_failed (exit 4).
The TUI helper and the extractor's existing functions are unchanged; the
extractor gains clipboard_image_tools(), the per-platform tool list used to
tell "no image" from "no tool".
source_build_env set NPM_CONFIG_USERCONFIG from its own path while
user_npmrc chose the file for everything else; both now use
hermes_npmrc(). The docs say the Hermes file replaces ~/.npmrc (npm
userconfig semantics) and name `hermes pm update` lookups, not update
checks, as its other download consumer.