Hugging Face Hub v2.5.0: Token Revocation, Sandbox Network Policies & DuckDB SQL
Overview of huggingface_hub v2.5.0 (Nov 26, 2026): unauthenticated hf auth revoke, seccomp/Landlock sandbox network policies, hf_dataset() SQL, bucket transactions, and Spaces PKCE.

Q. Can a single SDK release let you revoke leaked Hugging Face tokens, lock down sandbox networking, and query Hub datasets with SQL? Yes. Released on November 26, 2026,
huggingface_hub v2.5.0adds unauthenticated leaked-token revocation (hf auth revoke), kernel-enforced sandbox network policies (network="none"/allowlist), and DuckDB-backedhf_dataset()SQL queries directly into the official CLI and Python SDK.
⚠️ Accuracy guardrail: This article was written by directly reviewing the official
huggingface_hub v2.5.0release notes as of November 29, 2026. Specific CLI flags and internal implementation details may change in future patch releases, and full code diffs for individual pull requests (#5389, #5303, #5371, etc.) were not inspected.
30-second summary
- Instant leaked-token revocation:
hf auth revokeandrevoke_tokens()invalidate leaked tokens without signing in, processing up to 1,000 tokens per batch. - Sandbox network policies:
network="none"ornetwork={"allow": [...]}cuts off internet access or restricts traffic to allowlisted IPs, ports, and hostnames usingseccompandLandlock(cannot be bypassed even as root). - Direct SQL on Hub datasets:
hf datasets sqlauto-installs and loads the Hugging Face DuckDB extension (DuckDB 2.0+), supportinghf_dataset('org/name')queries andCOPY ... TO 'hf://datasets/...'write-backs. - Bucket transactions, OAuth PKCE, and Hub router: Adds
fsspectransactions forHfFileSystembuckets, secretless Spaces OAuth with PKCE (SPACE_SIGNING_SECRET), and unified/v1/chat/completionsrouting.

1. Revoke leaked tokens immediately with hf auth revoke
When a token is accidentally committed to a repository or pasted into a log, you no longer need to sign in to the owner's account to disable it. Anyone holding the raw token value can trigger revocation immediately via hf auth revoke or the Python revoke_tokens() helper.
To prevent footguns, the request intentionally omits your own Authorization header, so your active token cannot be revoked by mistake.
hf auth revoke hf_xxx hf_yyy
# ✓ Revocation requested for 2 token(s)
from huggingface_hub import revoke_tokens
revoke_tokens(["hf_xxx"]) # Batches up to 1,000 tokens
The token owner receives an email notification, and the Hub always returns a generic "revocation requested" response regardless of whether the token existed. This makes it safe to neutralize leaked third-party tokens spotted in public repos or CI logs.
2. Sandbox network policies: seccomp + Landlock isolation
One of the biggest risks when letting AI agents run code in sandboxes is unauthorized outbound network traffic. In v2.5.0, you can pass network="none" to block all outbound connections or network={"allow": [...]} to restrict access to specific IP ranges, ports, and hostnames.
The policy is enforced by the sandbox server with Linux seccomp and Landlock, applies to every process started inside the sandbox, and cannot be removed even by root.
# Fully offline isolation (volumes still work)
sbx = Sandbox.create("python:3.12", network="none")
# Allow only an internal vLLM server and the Hugging Face Hub
sbx = Sandbox.create(
"python:3.12",
network={"allow": ["10.0.0.0/8", "203.0.113.10:443", "huggingface.co"]},
)
Pools support per-sandbox policies so isolated and connected sandboxes can share the same host. If a server cannot enforce the policy (such as an older pool host), creation fails with SandboxError instead of silently falling back to an unrestricted sandbox.

3. hf_dataset() SQL queries, write-backs, and bucket transactions
Agents inspecting datasets no longer need to construct read_parquet(...) URLs manually. hf datasets sql now auto-installs and loads the Hugging Face DuckDB extension so you can query datasets directly with hf_dataset('org/name').
hf datasets sql "SELECT * FROM hf_dataset('stanfordnlp/imdb') LIMIT 3"
As a side effect, you can also write results back to the Hub using COPY ... TO 'hf://datasets/username/dataset-name/...'. The extension requires DuckDB 2.0+; on older versions or unsupported platforms, it logs a warning and leaves existing read_parquet workflows intact.
For storage buckets (hf://buckets/...), HfFileSystem now supports fsspec transactions. Files written inside with hffs.transaction: are uploaded only when the block exits cleanly, unlocking libraries like PyTorch Lightning's _atomic_save. Note that transactions are best-effort (files upload individually on commit) and buckets-only—repo writes, rm, and cp_file raise NotImplementedError.
4. Spaces OAuth PKCE and Hub router unification
| Feature | Before | In v2.5.0 |
Operational note |
|---|---|---|---|
| Spaces OAuth secret | OAUTH_CLIENT_SECRET required |
Optional (PKCE S256 always on) | Supports public clients (token_endpoint_auth_method="none") |
| Spaces session signing | Derived from OAUTH_CLIENT_SECRET |
Hub-injected SPACE_SIGNING_SECRET |
Existing OAuth users must sign in again after upgrade |
chat_completion + provider |
Direct provider-specific route | Hub router /v1/chat/completions (hf-model-id:provider) |
Gains :cheapest/:fastest policies and OpenRouter failover |
| Direct provider API key calls | Direct to provider | Unchanged (still direct) | Router path applies only when using an HF token |
Switching to SPACE_SIGNING_SECRET keeps sessions alive across restarts and replicas, though upgrading an active OAuth Space will invalidate existing user sessions once.

5. Additional CLI, Jobs, and HTTP improvements
- Explicit egress errors: HTTP 402
EgressLimitReachedresponses now raiseEgressLimitError, making bandwidth quota handling straightforward in Python. - Jobs reliability: Auto-generated Job names are capped at 100 characters, Windows script paths resolve cleanly, and
run_uv_jobcrashes on long arguments are fixed. - Related reading: For more on agent sandboxing and MCP workflows, see our guides on AWS Strands Box CLI and Claude's 4 MCP extensions.
Toris's take
For solo developers and small AI product teams, v2.5.0 is a practical upgrade worth adopting immediately for security and operational control. If you run agent-generated code in sandboxes, enabling network="none" or an allowlist closes off accidental exfiltration paths at the kernel level.
Before upgrading production Spaces that rely on Hugging Face OAuth, plan for the one-time user session reset caused by SPACE_SIGNING_SECRET, and verify your local or CI environments run DuckDB 2.0+ if you intend to use hf_dataset() SQL workflows.
Sources
Advertisement