Trusted IPs

Hold an API key's calls from an IP address it was not approved for, until someone approves the address. A key that leaks and is used from somewhere new gets a refusal instead of an answer.

In the console sidebar (it appears once the feature applies to your account): Settings › Security Open it ↗

Steps

  1. Open Settings › Security and turn on Approve new IPs. The dialog lists the addresses each key was called from in the last 7 days, with every public address ticked: untick any you do not recognise, then turn it on. Only the workspace owner and admins can change this setting, and it does not turn on while the gateway cannot see real client addresses (every call seems to come from a private address behind a proxy).
  2. From then on, a call from any other address is refused with 403 and the error code ip_not_trusted. The error names the address the gateway saw and links to the page where it is approved (the ip and approve_url fields). The key's creator is emailed the address, its location, the client and the model it asked for (for an admin key, the operation it called); for an admin key that belongs to the workspace, or one whose creator has left, the email goes to the owner and admins.
  3. Open the link, sign in, and approve the address, or its range (/24 for IPv4, /64 for IPv6) for a client behind changing addresses, or reject it. The next call from an approved address goes through.
  4. The Trusted IPs list shows the addresses your keys were called from, with their location and status. Trust a known address with one click, add an address or a range by hand with Add IP (up to /16 for IPv4, /32 for IPv6), or remove one.

Limits and gotchas

  • Trust is per key: approving an address lets that key in from it, not every key in the workspace. Inference keys and admin keys are both covered.
  • A key with its own IP allowlist is not affected when no range on that list is wider than a /16 (IPv4) or a /32 (IPv6): its allowlist alone decides. A key whose list holds a wider range, such as 0.0.0.0/0, needs approval like any other. Turning Approve new IPs off lets every address through again and keeps the trusted addresses for next time.
  • The key's creator and the workspace owner and admins can approve (an admin key that belongs to the workspace: the owner and admins only). Approving happens in the console after signing in; the email has no approve button, so a forwarded email approves nothing.
  • A waiting request expires after 7 days. For 30 days after a rejection, calls from that address are still refused, without a new request or an email. Serverless functions and CI runners that call from a new address on every run are held every time: give them a key with an IP allowlist, or trust their range.