
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news and important information here! By default, assets in Sanity (including PDFs) are publicly accessible via their URLs, even in private datasets. This is true regardless of your dataset's access control settings - while your document data can be secured, the asset files themselves are served through Sanity's CDN with publicly accessible URLs.
However, you have a few options to secure your PDFs:
The most secure approach is to not expose the asset URLs directly to your frontend. Instead:
This way, the actual Sanity asset URLs remain hidden in your backend code, and you control who can access them.
For highly sensitive content, you might want to:
This gives you complete control over access but adds infrastructure complexity.
Sanity asset URLs are auto-generated and difficult to guess, providing some "security through obscurity." However, this is not true security - anyone with the URL can access the file, and URLs can be shared or leaked.
The Sanity documentation explicitly states: "Usually the autogenerated URL of the asset provides enough security through obscurity – but the file itself is publicly accessible, even in private datasets."
For truly confidential content, you'll need to implement additional security layers beyond Sanity's built-in asset storage. The Sanity Functions approach gives you the best balance of convenience and security while keeping your content workflow in Sanity.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store