Source: Baseten's engineering post of 2026-11-24, "Deploy private Hugging Face models without sharing your access token" (Matt Howard, Yun Zou, Chloe Florit), announced the same day on the company's LinkedIn page.
The problem
Teams keep fine-tuned and proprietary weights in private Hugging Face repos. Deploying those weights on someone else's inference platform has usually meant handing that platform a long-lived access token. The post names three defects, and they generalize to every machine credential, not just this one:
It never expires. It works until someone deletes it in the issuing system, so a leak is exploitable until it is noticed.
It carries more access than the job needs. A classic Hugging Face read token can read every private repo the holder can reach, organization repos included. The blast radius of one deployment's credential is the whole account.
It is rarely rotated. Rotation means creating a token in one system, updating it in another, and deleting the old one — coordination across two products, which in practice means the token stays.
Hugging Face's Trusted Publishers already addressed the first and third by issuing short-lived tokens at deploy time instead of storing one. The gap this post closes is the second: those tokens could also write to the repo, which a weight download never needs.
The mechanism
The flow is standard workload identity, which is what makes it worth reading as a pattern rather than a product note:
At deploy time, the platform mints a signed identity token asserting which organization and team the deployment belongs to and what kind of workload it is — for example a model build, whose job is to download weights.
Hugging Face verifies the signature and compares those claims against the repo's Trusted Publisher settings.
On a match it issues a token scoped to a single repo, read-only, expiring within an hour.
Nothing long-lived is stored on either side. The three properties that matter are stacked deliberately: scoped to one repo (not the account), read-only (not read-write), and short-lived (not until revoked). Dropping any one of them leaves a familiar failure — a repo-scoped eternal token, an hour-long token that can rewrite your weights, an account-wide token that expires.
Configuration is three steps: read the platform's organization and team IDs from its CLI, add the platform as a read-only Trusted Publisher in the repo settings scoped to that organization and team, and point the deployment config at the repo with the OIDC auth method and the repo as the OIDC resource. The same OIDC support already existed for pulling weights from S3 and GCS, so the model-registry case was the hole.
Notable as an industry detail: the read-only option did not exist, Baseten asked for it, and Hugging Face shipped it within days. The constraint on least-privilege here was a missing feature in the registry, not a hard problem — which is worth remembering when a vendor says scoped access is unavailable.
What to take from it
Weights are a credential-governed asset like any other. The obvious controls for a database or an object store — workload identity, scoped roles, short TTLs — apply to model artifacts, and the ML tooling has been slower to offer them. If your pipeline pulls private weights with a stored token, that token is probably account-wide and immortal.
Write access is the quiet part. A leaked read token loses you your weights. A leaked write token lets someone replace them, which is a supply-chain compromise of everything served from that repo afterwards, and far harder to notice. Audit the direction of access, not only its lifetime.
The claims are the policy. Trust is expressed as organization, team and workload type, which means the strength of this control depends on how finely the platform scopes those claims and how narrowly you set them. "Trust this vendor" and "trust this team's model builds" are very different grants through the same mechanism.
Vendor-specific, pattern-general. The implementation is one provider and one registry. The reusable content is the three-way scoping and the observation that the registry side had to add read-only before least privilege was even expressible.
Failure modes and open questions
The post does not cover these, and they are what an adopter should ask:
Revocation during the window. A one-hour token cannot be unissued; if the identity itself is compromised, the control is the identity provider's, not the registry's.
Claim spoofing is the whole threat model. Everything rests on the signed identity token. If a platform's signing key or its workload-type claim can be influenced by a tenant, the scoping is decorative.
Where the weights go after the pull. A read-only, single-repo, one-hour token governs fetching the artifact. It says nothing about how the artifact is stored, cached, or isolated on the platform afterwards — which is usually the larger exposure.
Gated models and volume sync are mentioned as separate setup paths, so behaviour there may differ.
Operational coupling. A deploy now fails if the OIDC exchange fails, trading a credential-leak risk for an availability dependency on the registry's token endpoint. That is almost always the right trade, but it should be a known one.
Review checklist for weight-pull credentials
Does any stored token exist at all, or is every credential minted per deployment?
Is it scoped to one repo, or to everything the identity can read?
Is it read-only? If it can write, what stops a replaced artifact from being served?
What is the TTL, and what happens if the identity is compromised inside it?
Which claims express trust, and are they as narrow as the workload — team and workload type, not just the vendor?
Where do the weights live after the pull, and who can read them there?
Is the same approach used for every artifact source (registry, object storage, internal mirrors), or only the one that got attention?
Related
R172 — a trusted script vendor serving malware to 178 organizations: the concrete argument for why write access to an artifact repo is the dangerous direction.
R236 — treating a coding agent's own configuration as attack surface; same instinct applied one layer up, to the credentials a deployment holds.
R053 — poisoning weights during pretraining: integrity of the artifact itself, which scoped pull credentials protect only against the tampering that happens in the repo.
R262 — a tool that reads other tools' login files to work: the counterexample, and a reminder that convenience layers often reintroduce the long-lived credential this removes.