Restrict robot tokens to IP addresses
Published: November 27, 2026
Enterprise organizations can now restrict a robot token to the IP addresses they choose. Requests made with the token from any other address are refused, so a leaked token can't be used outside your network. Set it up in Manage or with the Access API. See Restrict a robot token to specific IP addresses.
New features
- Manage: On the project or organization Tokens page, open a token's three-dot menu and select Add IP allowlist, or fill in the IP allowlist field when you create a token. Restricted tokens show an IP allowlist badge, and you can edit or remove the allowlist from the same menu.
- Activity log: Adding, changing, or removing an allowlist is recorded in your activity log.
Before you add an allowlist
- An allowlist holds up to 10 IPv4 addresses or ranges, each
/16or narrower. IPv6 and private ranges aren't accepted. - A restricted token only works with
api.sanity.io, not the API CDN. In@sanity/client, setuseCdn: false. - Tokens used by Sanity Functions can't have an allowlist. Sanity-hosted services that call the API with your token, such as Context MCP, can't use a restricted token.
Related documentation
Restrict a robot token to specific IP addresses
Add an IP allowlist to a project or organization robot token so it only works from your IP addresses, in Manage or with the Access API.
Authentication and tokens
How to create tokens and make authenticated requests.
Access API reference
A centralized API to manage resource access control through roles and permissions.