hermes-bench: bind loopback by default, and stop logging the API key #3

Merged
hermes merged 1 commit from h7-loopback-default into main 2026-11-13 14:46:11 -06:00
Collaborator

External review 2026-11-13, finding H7. Keeping the tool (it is a good public artifact), fixing the two things the review found.

1. Bind address. The packaged launcher hard-coded uvicorn --host 0.0.0.0 --port 7420 while the README documented HERMES_BENCH_HOST defaulting to 127.0.0.1 — the docs described the intent, the binary ignored it. Now: a generated launcher that honours HERMES_BENCH_HOST/HERMES_BENCH_PORT (defaults 127.0.0.1:7420), warns loudly on any non-loopback bind, and passes extra args through. makeWrapper dropped.

Why it matters: the UI has no auth and its job is spawning llama-server with caller-chosen binary path, model path and flags. 0.0.0.0 turns a benchmarking toy into unauthenticated process launch on the host network.

Verified on the built binary: LISTEN 127.0.0.1:7499, refused on the host mesh IP; --help passthrough works; non-loopback bind prints the warning.

2. API key in logs. start_server logged the exact argv, which contains --api-key <value>. _redact_cmd masks every occurrence before logging (order/count preserved), with 3 tests.

Full backend suite: 143 passed.

External review 2026-11-13, finding **H7**. Keeping the tool (it is a good public artifact), fixing the two things the review found. **1. Bind address.** The packaged launcher hard-coded `uvicorn --host 0.0.0.0 --port 7420` while the README documented `HERMES_BENCH_HOST` defaulting to `127.0.0.1` — the docs described the intent, the binary ignored it. Now: a generated launcher that honours `HERMES_BENCH_HOST`/`HERMES_BENCH_PORT` (defaults `127.0.0.1:7420`), warns loudly on any non-loopback bind, and passes extra args through. `makeWrapper` dropped. Why it matters: the UI has no auth and its job is spawning `llama-server` with caller-chosen binary path, model path and flags. `0.0.0.0` turns a benchmarking toy into unauthenticated process launch on the host network. Verified on the built binary: `LISTEN 127.0.0.1:7499`, refused on the host mesh IP; `--help` passthrough works; non-loopback bind prints the warning. **2. API key in logs.** `start_server` logged the exact argv, which contains `--api-key <value>`. `_redact_cmd` masks every occurrence before logging (order/count preserved), with 3 tests. Full backend suite: **143 passed**.
External review 2026-11-13, finding H7. Two things.

1. The packaged launcher hard-coded `uvicorn --host 0.0.0.0 --port 7420`, while
   the README documented `HERMES_BENCH_HOST` defaulting to 127.0.0.1. The
   documentation was the intended design and the binary ignored it. The
   launcher is now a generated script that honours HERMES_BENCH_HOST and
   HERMES_BENCH_PORT, defaults both (127.0.0.1:7420), warns loudly on any
   non-loopback bind, and passes extra args through so `--help`/`--reload`
   still work. makeWrapper is gone with the flags it was setting.

   This matters more than an unused port: the UI has no authentication and its
   whole job is to spawn llama-server with a caller-chosen binary path, model
   path and flags. A 0.0.0.0 default turns "a benchmarking toy" into "unauthenticated
   process launch on the host's network". Verified after the change: the built
   binary listens on 127.0.0.1:7499 and is refused on the host's mesh address.

2. `start_server` logged the exact argv it launched, and that argv contains
   `--api-key <value>` whenever a key is set. The key is now masked by
   `_redact_cmd` before logging (every occurrence, order and length preserved so
   the log stays diagnostic), with tests for masking, no-secret passthrough and
   repeated flags.

Full backend suite: 143 passed.
hermes merged commit 7cf9bba578 into main 2026-11-13 14:46:11 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ymrtech/hermes-bench!3
No description provided.