Dashboard
Create and delete policies under Access Tokens → Network Policies, and pick one when issuing a token.
Rules
A policy only allows; there are no deny rules. It has a rule for each path a request can take to S2:
A request is accepted if it matches any entry of the rule for its path. For example, this policy accepts requests from either CIDR block, and from the VPC endpoint:
public_net denies all PrivateLink requests, and one with only private_net denies all requests over the public internet.
The source address of a PrivateLink request is not checked, so CIDR blocks of private addresses (like
10.0.0.0/8) do not allow PrivateLink traffic. Allow the VPC endpoint ID instead.Properties
Slug
A name unique to the account, of up to 96 letters, digits,- and _.
Reference
Each policy also gets a random nonce at creation. Its full reference is<slug>.<nonce>, and that is what a token is bound to. Requests that name a policy accept either the slug or the full reference.
Immutability
Policies cannot be changed. To allow different networks, create a new policy and issue tokens with it.Access tokens
Choose a policy withnetwork_policy when issuing a token. Token info reports the policy’s full reference and omits network_policy for an unrestricted token.
A token with a network policy can only issue tokens bound to that same policy. The new token gets the policy whether or not the request sets network_policy. Naming any other policy, even a narrower one, is rejected.
Deletion
A policy cannot be deleted while an access token is bound to it. Such a request fails withnetwork_policy_in_use (409); revoke those tokens first.
Denied requests
A request that a token’s network policy does not allow fails with403 and the network_policy_denied error code. The message names the address S2 saw the request come from:
Token activity
Thetoken-activity metric set shows where each access token was recently used from, with separate records for accepted and denied requests. Each record has the source address, the VPC endpoint for PrivateLink requests, the user agent and, for a denial, the reason, such as network_policy_denied. Records can lag by a couple of minutes.
It is useful for building a policy from the addresses a token is already used from, and for finding what a policy is blocking. You can see it:
- In the dashboard, in the Last Seen column of the access tokens table.
- With the CLI:
s2 metrics account token-activity my-token. See token activity. - Through the metrics API.

