Without the identity wall, the engine's key is the port's one gate (README), and a
request without it still had its body read whole and, when large, counted by the
engine on the proxy's own key before the engine's 401. The proxy now applies the
engine's own rule first (measured on the live engine: bearer in any case, one space,
the key exactly) and answers the engine's own 401, before the body and before an
Expect: 100-continue invitation; /health and /metrics stay open. The test harnesses
decide which key their proxy holds, whatever HOME holds: those that give it one
present it, as every real client does, and those whose clients send none give it
none (the CI's offline step gives HOME a key). The cockpit knows the new outcome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGLang's /server_info repeats the engine's whole command line in
launch_command, the API key included, and the proxy took out only the
key fields (api_key, admin_api_key, at the top and in every internal
state). Behind the identity wall, a named client could read through the
proxy the one secret the wall keeps from it; without the wall the
caller already holds it.
Every string of the answer now goes through mask_secrets: the value of
--api-key, --admin-api-key and --ssl-keyfile-password, in any form a
command line gives it, and the engine's own key wherever it shows (not
looked for by value under 8 characters, which no real key is and which
would garble unrelated strings). ssl_keyfile_password joins the key
fields.
Found by the flash audit of 2026-10-03; checked on the reference box:
through the proxy the key was in launch_command and in no other answer
(/v1/loads, /v1/models, /metrics, /model_info). The fake engine now
answers as the real one does; the server-info test and two new ones
fail against v6.31.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P3: an Anthropic body goes to the engine's own /v1/messages/count_tokens
(its conversion, tools included), each image priced from its header and
replaced by an empty text block (an empty list is a 500 there). Measured on
the box: five screenshots in tool_result blocks were counted 2,044,251 and
refused, the engine serves 28,463 (28,458 counted now); 8 tools, 422 counted
before, 2,709 now and served
- P4: a raw control or non-ASCII byte in the query is a 400, not a dropped
socket and a "client vanished" line
- P5: the logged-once memories keep 16-byte digests, 512 at most; the moved
effort is printed 40 characters long (five 20 MB values: 22 -> 346 MiB and
a 20,000,137-character journal line each, before)
- P7: a client named by the identity wall is named on the request's first
line too, as one word; the cockpit's feed accepts the label after the peer
- P6: the cockpit greps the banner in its current shape ("on 0.0.0.0:30001");
it showed v6.20 while v6.24 ran. U7: the too-old-to-abort warning compares
versions part by part, server-side (as floats, v6.2 to v6.9 passed)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cockpit: a non-digit Content-Length is a 400 before any read (-1 read an
unlimited body before login)
- proxy v6.24: the identity wall covers every route and method but /health;
a path still escaped after one decode is refused; relayed /server_info loses
the engine key fields; an unreadable keys file says so
- docs/clients.md: the keys file is installed owned by the user, the engine
key goes in an EnvironmentFile
- image unit: After= on the text units, so a switch stops before it starts
- lifecycle: a down unit with a live container is an orphan, busy for the gate
- cockpit: its own /health probe no longer counts as activity (the canary
never ran)
- install.sh: sudo asked at step 1 and renewed at step 8 with a prompt;
CONTEXT_MODE=1m refused on a flash box after the convergence; the flash
engine bind is read from the launcher
- switch-model.sh: downloads into the cache the installed unit mounts
- uninstall.sh, install-image.sh: remove only venv/ and sglang/ of the lane
- opencode limits hold the engine window (205000/32000 flash,
173000/64000 native), fit() and the cockpit's verdict and autofit use the
same rule, the 27B entry of a flash install comes from the table;
collect_opencode has its @guard back
- Setup's Fit button has a click handler
- bench-agent: the TTFT slope is in the unit it prints
- CI: negated grep, generated script lists, exact sudoers argv, flash flags
read from install.sh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reading logprobs is what /v1/systemone does, so an audit went looking at what
else can ask for them. OpenAI documents top_logprobs as "an integer between 0
and 20"; SGLang declares it Optional[int] with no constraint and hands it to
logprobs.topk(max_k), where a number past the vocabulary raises "selected index
k out of range" INSIDE the scheduler. One request from one client ends the
engine for everybody, and this box needs about nine minutes to come back
(sglang#40076, open). It was then reproduced the hard way here, by relaying one
such request during a test of the refusal meant to prevent it.
sglang#31597 catalogued the same family in July with reproductions, and both
PRs that bounded them were closed without being merged, which is why the first
had to be reported again in September. Checked one by one in the served
v0.5.19: stop_token_ids indexes a scatter_add_ out of bounds whenever
min_new_tokens > 0; input_ids indexes the embedding, and the validator that
would stop it has zero callers; n becomes parallel_sample_num unbounded. All
reachable from an ordinary chat request.
So the proxy refuses them, on the three relayed routes that carry the logprob
count under three names, element by element when a batch sends a list. The two
id fields need the vocabulary, which the engine publishes nowhere, so it is
asked for the only way it is offered: an out-of-range logit_bias is refused
with a message that names it. One probe an hour, built to be refused, never
reaching the scheduler; it matched the checkpoint's config.json to the digit.
A negative id is refused whatever happens, and a probe that fails stands the
rest of the guard down rather than refuse traffic it cannot judge.
Three defects of this route's own, found in the same audit and in review:
* the retry that asks a second, wider time went straight to the engine
without the door, and ignored SYSTEMONE_TOP_K_MAX, the clamp an operator
sets because their build refuses a wide top-k
* a percent-encoded non-ASCII byte in any path decoded to something
http.client encodes as ASCII, raising UnicodeEncodeError, a ValueError no
arm here catches: an empty reply and a traceback, before any key is checked
* a lone surrogate outside the state cost a full fan-out and returned 500;
the check now runs over the whole parsed request, before any inference, and
never echoes the text it cannot encode
* a branch still queued for a slot was aborted with a rid the engine had
never seen, then sent anyway when a slot freed
And one trap written down rather than fixed, because the code was already right
and nothing said why: on the speculative path this lane runs, the engine
divides the logprobs it returns by the request's temperature, and on the
ordinary path it does not. Only the 1.0 this route sends makes the two agree.
keepalive-proxy.py at 84% branch coverage, floor raised to 83.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
v6.16 named WHO and admitted no one: the client's bearer went upstream
verbatim and met the engine's own --api-key there, so every labeled
request died with the engine's 401 past a wall that had correctly
identified it. Found live on the reference box against the real engine,
not in any test, because every fake engine in the suite lets everything
through: that is the hole's whole biography, and the fix carries its own
enforcing fake engine so it cannot reopen unnoticed. QWEN38_UPSTREAM_API_KEY
names the engine's key to the proxy; when both halves are set, the
client's bearer names them on the journal line and the engine's key admits
them upstream, on relays and on abort calls alike (the abort path had the
same verbatim habit). Without the upstream key the old verbatim behavior
stays, for an engine with no check of its own or one shared key on
purpose, and the banner warns loudly about the combination. Three new
admission scenarios (substitution observed engine-side, verbatim pinned as
the documented fallback, upstream key dormant with the wall off); root
proxy coverage 78% over its 74% floor.
Co-Authored-By: Qwen3.8-flash-next via opencode <noreply@opencode.ai>
Two opt-in walls, both because local production asks them and both
designed so the loopback/tailnet default does not notice their
existence. TLS: name QWEN38_TLS_CERT (QWEN38_TLS_KEY when the key is
separate) and the socket speaks the operator's certificate, TLS1.2
floor, and refuses to start rather than half-wrap. Per-client identity:
QWEN38_CLIENT_KEYS_FILE, a JSON map of bearer token to label; when set
a /v1/ request without a listed key gets a 401 in its own dialect
(authentication_error parses on the Claude side, error.type on the
OpenAI side), /health stays open because a monitored endpoint behind an
identity wall stops being monitoring, and the label rides every journal
line of the request, which is the question one shared key can never
answer. Both walls fail closed: a cert that cannot load or a keys file
that is missing, empty or malformed boots nothing, because a wall that
vanished silently is worse than no wall. Authorization is still
forwarded verbatim, so this is identity in front of the engine's
--api-key, not a second key to rotate in two places. Nine tests drive
the real subprocess and socket (handshake, plain-rejected-beside-TLS,
the dialects of the 401, open /health, the refuse-to-start trios); the
guard crashed once already in development on ssl.TLSVersion.TLS1_2
against TLSv1_2, the exact class of bug these tests exist to catch
before an operator meets it at 2 a.m. on a unit whose Restart=always
respawns it into the same crash. The closed outcome vocabulary names
its own new member: the 401 registers as the fail kind, the same
reading its 400 and 413 siblings got, and the vocabulary gate pointed
at it before this line was written.
Co-Authored-By: Qwen3.8-flash-next via opencode <noreply@opencode.ai>