Baseten Adds Read-Only OIDC Token Exchange for Private Hugging Face Weights
Summary:Baseten says it is the first inference provider to support Hugging Face's read-only Trusted Publishers. At deployment time, Baseten creates a signed OIDC identity assertion that identifies the organization, team, and workload type. Hugging Face validates the signature and trust policy, then issues a token lasting up to one hour that can pull from one repository but cannot modify it. This replaces a stored, long-lived Hugging Face credential with a workload-bound, least-privilege exchange. The c
What Changed: From Static Secrets to Workload-Bound Exchange
Baseten and Hugging Face have integrated read-only Trusted Publishers into the workflow for deploying private models. The traditional approach generally requires placing a Hugging Face access token into an inference platform as a long-lived secret. If that token leaks, an attacker may read multiple private repositories until an operator notices and revokes it. Rotating it also requires coordinated work across two systems, so stale credentials often remain active for longer than intended.
The new design does more than shorten a token's lifetime. It separates authorization into two questions: Baseten proves which trusted workload is making the request, and Hugging Face decides which repository that workload may read. Baseten says it is the first inference provider to support this read-only mode.
The end-to-end path is:
Baseten workload → signed OIDC identity assertion → Hugging Face policy evaluation → one-hour repository-scoped read token → weight pull
How the OIDC Authentication Flow Works
- Establish the trust relationship: An administrator obtains the organization and team IDs through the Baseten CLI, then adds Baseten as a trusted publisher with Read-only permission in the target Hugging Face repository settings.
- Generate a workload identity assertion: At deployment time, Baseten creates a signed OIDC identity token containing the organization, team, and workload type, such as a model build responsible for downloading weights.
- Evaluate policy: Hugging Face validates the signature and compares the organization, team, and workload type against the repository's Trusted Publisher configuration. A repository token is issued only when all fields match.
- Constrain repository access: The issued token lasts for up to one hour, can read only the authorized repository, and cannot modify repository contents or reach other private repositories available to the same account.
- Expire automatically: The deployment system does not need to store, copy, or manually rotate a long-lived access token. Once the token expires, another short-lived credential can be obtained through the exchange flow.
The two credentials should not be conflated. The OIDC assertion proves the identity of a trusted workload; the short-lived Hugging Face token authorizes repository access. The latter is exposed for no more than an hour rather than indefinitely, but it remains a transferable secret. The announcement does not state whether it is additionally bound to an instance, IP address, or request context.
Comparison with Long-Lived Access Tokens
| Dimension | Long-Lived Hugging Face Token | Read-Only Trusted Publishers | | --- | --- | --- | | Credential storage | Usually retained as a static secret in the deployment platform | Exchanged temporarily at deployment time; no long-lived key is stored | | Lifetime | Until manually revoked | Up to one hour | | Repository scope | A classic read token may cover every accessible private repository | One designated repository only | | Write access | Depends on token type; earlier Trusted Publisher tokens could read and write | Write access is explicitly disabled | | Rotation | Create a token, update the platform, and revoke the old token | Automatic expiry | | Identity binding | Primarily depends on possession of the token | Binds organization, team, and workload type | | Typical failure | Incorrect or leaked secret, plus delayed revocation | Trust-policy mismatch, assertion mismatch, or issuance-service outage |
Engineering Trade-offs and Security Boundaries
1. The leakage window shrinks, but does not disappear
A one-hour TTL is materially better than a permanent key and removes manual rotation. During that hour, however, an exfiltrated token may still be replayed unless the platform adds instance binding, proof of possession, or request-level restrictions. The announcement does not identify such protections, so this should not be described as complete zero-trust access.
2. Risk shifts from secret management to trust management
Deleting a long-lived token normally terminates that credential path. A Trusted Publisher relationship, by contrast, remains configured. If an organization or team scope is too broad, or if the workload identity-signing system is compromised, an attacker may still produce an assertion accepted by policy. The issuer, audience, claim schema, signing-key rotation, revocation behavior, and replay defenses are not disclosed, leaving external reviewers unable to fully audit the chain.
3. The control plane becomes an availability dependency
Model builds or volume-sync operations must reach Hugging Face for policy evaluation and token exchange. A fail-closed design should not fall back to a long-lived key when identity services are unavailable. That is safer, but it makes deployment availability dependent on another control plane. Teams should monitor exchange failures, policy mismatches, and retry exhaustion rather than watching only GPU clusters.
4. The one-hour lifetime can affect very large models and retries
For a large model repository, throttling, cross-region transfer, or transient faults may push a pull close to the one-hour boundary. The deployment path should request a fresh token when retrying rather than persisting and reusing an expiring credential. The actual threshold depends on repository size, object-storage throughput, and Baseten's download implementation; none of those measurements are provided.
5. Downloaded weights still require separate protection
This mechanism protects the credential used to fetch weights from Hugging Face. It does not automatically encrypt model caches, build volumes, or artifact stores. Once weights have been copied into the infrastructure, access control, encryption at rest, retention policy, and auditing remain the deployment platform's responsibility. Highly valuable proprietary models need defenses on both the credential path and the artifact path.
6. Mitigation for agent-driven attacks is not end-to-end
Workload identity reduces the chance that an attacker can directly retrieve a long-lived repository token from a general secret store. If an attacker already controls the Baseten deployment control plane, however, they may still induce legitimate token issuance as a trusted workload. The feature should therefore be combined with tightly restricted deployment permissions, isolated build environments, and artifact egress controls.
Performance and Evaluation
Baseten does not disclose token-exchange latency, cold-start impact, failure rates, behavior with very large repositories, or throughput. It is therefore impossible to quantify the production SLA effect. Architecturally, token exchange should be minor during a cold weight download, but its relative cost may be more visible with cache hits, frequent rebuilds, or small LoRA deployments.
Useful validation metrics would include p50 and p95 exchange latency, policy-mismatch rates, recovery time during a Hugging Face control-plane outage, retry success near token expiry, total model-build duration, and negative tests proving that unauthorized repositories cannot be reached before and after migration.
Deployment Recommendations
- Use the Baseten CLI to obtain the actual organization and team IDs; do not infer scope from display names.
- Configure Baseten as a Read-only Trusted Publisher in the target Hugging Face repository and bind only the required organization, team, and workload type.
- Add negative tests for the wrong organization, team, workload type, repository, and an expired token, confirming that every mismatch fails closed.
- After migration, remove the old long-lived Hugging Face token from Baseten and revoke it on Hugging Face so that old and new permissions do not coexist.
- Validate gated models and volume sync through the documented setup flow; a publisher relationship should not be assumed to satisfy every model-gating condition.
- Do not log identity assertions or short-lived access tokens in build arguments, traces, or error reports. Retry by obtaining a new token rather than persisting one.
- Continue to apply independent encryption, least-privilege access, and retention policies to model caches, build volumes, and artifact stores.
- Audit Trusted Publisher entries regularly. When team membership or workload types change, tighten or revoke the corresponding trust relationships.
Bottom Line
The value of this release lies in replacing a persistent repository credential with a workload-bound, repository-scoped, read-only, automatically expiring authorization exchange. It reduces both the permission radius and duration of credential exposure, making it a practical improvement to AI infrastructure security. Because exchange performance, replay constraints, assertion validation, and revocation semantics remain undisclosed, it is best understood as a deployable security integration rather than the endpoint for zero-trust model delivery.
— END —Source: Baseten Blog (2026-11-24)
Tags: #Baseten #Hugging Face #OIDC #Trusted Publishers #Private Model Deployment
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments