You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
detection: credential-read-then-cloud-api fires on order, not on where the secret goes #431
credential-read-then-cloud-api (detection/rules.py) fires on order alone: the first credential access in a session, then any later successful call to a cloud or cluster CLI (hf, huggingface-cli, aws, kubectl, gcloud, az, and others in CLOUD_API). It does not link the two events, and it does not look at where the secret goes.
The critique (Hugging Face forum, 2026-11-15)
For the Hugging Face case the order is a thin signal:
hf and huggingface-cli read HF_TOKEN from the environment on their own, so a normal upload never names the token. The benign path leaves nothing to see, and so does an attacker using the same implicit path.
The explicit reads that do show up are mostly legitimate and still fire: hf auth login --token $HF_TOKEN, or an export in a setup script, followed by an ordinary hf upload.
The stronger signal is where the secret ends up: in argv, inside a URL, or sent to a host that is not Hugging Face.
Where that signal exists today
Partly, in credential-exfil: one command that names a credential and reaches a non-loopback host through a network client. It does not know Hugging Face hosts from any other, so curl to the Hugging Face API with the token in a header fires it too. No rule looks for a literal token value in argv or a URL.
Proposal for the detection pass
Tie the credential to its destination rather than to the next CLI call: a named token variable or literal token value that reaches argv, a URL, or a network client aimed at a host outside that provider's domains.
Keep the provider's own hosts (huggingface.co, hf.co) as expected destinations for the Hugging Face token, rather than as egress.
Corpus cases: the setup-script export followed by hf upload (must not fire); hf auth login --token $HF_TOKEN alone (must not fire); the token sent to a non-HF host by curl (must fire); a literal token in a URL query to a non-HF host (must fire).
Freeze
rules.py and traits.py are frozen and hashed into the ruleset fingerprint (15846a0915769d4a). This lands with #55, #172, #329 and #425 in one pass, not alone.
Follow-up from the Hugging Face discussion. Agentmetry 0.13.0 compares parsed Hugging Face hostnames against an exact list. The trailing-dot spelling huggingface.co. stays outside the expected-host exception. The separate high-severity literal-token alert still applies on expected hosts.
#446 adds a regression test for the trailing-dot behavior and has merged. It changes only the test and the measured README test count.
Remote staging: both hostname spellings matched the staging-host predicate in the isolated check. The reported missing alert is still open. The full rule also needs evidence of a staged artifact and successful tool results within the same session, so hostname matching alone does not establish the cause.
The next evidence needed is the Agentmetry version and two redacted event summaries showing whether the fetch was recorded as saving a file and whether both steps reported success. Please leave tool arguments and token values out.
Activity
detection: a key listing is discovery, a token sent to its issuer is …
redaction: scrub every token format the detection rules recognise
Fix Hugging Face token exposure and execution evidence
blitzcrieg1 commentedon Nov 19, 2026
Follow-up from the Hugging Face discussion. Agentmetry 0.13.0 compares parsed Hugging Face hostnames against an exact list. The trailing-dot spelling
huggingface.co.stays outside the expected-host exception. The separate high-severity literal-token alert still applies on expected hosts.#446 adds a regression test for the trailing-dot behavior and has merged. It changes only the test and the measured README test count.
blitzcrieg1 commentedon Nov 19, 2026
Follow-up to the Hugging Face report. I checked the two hostname predicates on
masterat65ad6f7using synthetic inputs.huggingface.co.falls outside the exact Hugging Face exception. Pin the Hugging Face trailing-dot hostname behavior #446 covers this behavior.The next evidence needed is the Agentmetry version and two redacted event summaries showing whether the fetch was recorded as saving a file and whether both steps reported success. Please leave tool arguments and token values out.