huggingface canary plants ~/.env.hf with a fake HF_TOKEN and HF_ENDPOINT redirected to Snare. Any HuggingFace Hub SDK call that picks up HF_ENDPOINT from this file routes to Snare instead of huggingface.co.
What gets planted
~/.env.hf
Reliability: Medium
Fires only when both conditions are true:- The agent reads and loads
~/.env.hf(or exports these variables into its environment) - The agent makes a HuggingFace Hub SDK call in a process where
HF_ENDPOINTis set
Trigger conditions
- Agent runs
load_dotenv("~/.env.hf")or equivalent - Agent calls
huggingface_hub.hf_hub_download(),snapshot_download(),InferenceClient(), or any Hub API method - Both in the same process where
HF_ENDPOINTis active
Side effect
If you use~/.env.hf in your own HuggingFace workflows, this canary will fire on your own SDK calls. Use a different env file for real HF credentials, or teardown before running legitimate HF workloads.
False positives
Only if your own tooling loads~/.env.hf and makes HF Hub calls. If you don’t use ~/.env.hf for anything real, false-positive rate is near-zero.
Plant
Teardown
HF_TOKEN and HF_ENDPOINT lines from ~/.env.hf. If the file was created by Snare and is now empty, it is deleted.