Hugging Face Access Token

Detects Hugging Face user access tokens (hf_ prefix), used to authenticate to the Hugging Face Hub API. A leaked token grants access to private models, datasets and Spaces, and can incur inference billing.

Type
regex
Engine
universal
Confidence
high
Confidence justification
High confidence: the distinctive hf_ prefix with a fixed 34-character body is highly specific to Hugging Face access tokens.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, SOC 2
Data categories
credentials, security
Scope
narrow
Risk rating
8
Platform compatibility
Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, Palo Alto: Unsupported, Netskope: Unsupported

Pattern

(?<![A-Za-z0-9_])hf_[A-Za-z0-9]{34}(?![A-Za-z0-9])

Corroborative evidence keywords

hugging face, huggingface, HF_TOKEN, access token, api token, transformers, inference api

Proximity: 300 characters

Should match

Should not match

Known false positives

References