Worker Isolation
By default, Workers inside of a dispatch namespace are considered "untrusted." This provides the strongest isolation between Workers and is best in cases where your customers have control over the code that's being deployed.
In untrusted mode:
- The
request.cf
object is not available in Workers (see limits for more information) - Each Worker has an isolated cache, when using the Cache API or when making subrequests using
fetch()
, which egress via Cloudflare's cache caches.default
is disabled for all Workers in the namespace
This mode ensures complete isolation between customer Workers, preventing any potential cross-tenant data access.
If you control the Worker code and want to disable isolation mode, you can configure the namespace as "trusted". This is useful when building internal platforms where your company controls all Worker code.
In trusted mode:
- The
request.cf
object becomes available, providing access to request metadata - All Workers in the namespace share the same cache space when using the Cache API
To convert a namespace from untrusted to trusted:
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/dispatch/namespaces/{namespace_name}" \ -H "Authorization: Bearer {api_token}" \ -H "Content-Type: application/json" \ -d '{ "name": "{namespace_name}", "trusted_workers": true }'
If you enable trusted mode for a namespace that already has deployed Workers, you'll need to redeploy those Workers for the request.cf
object to become available. Any new Workers you deploy after enabling trusted mode will automatically have access to it.
If you need access to request.cf
but want to maintain cache isolation between customers, use customer-specific cache keys or the Cache API with isolated keys.
- Platform Limits - Understanding script and API limits
- Cache API Documentation - Learn about cache behavior in Workers
- Request cf object - Details on the cf object properties
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark