Codex additional allowed domains doesn't work

My Codex Enviroment config:

  • Agent internet access: On
  • Domain allowlist: common dependencies
  • Additional allowed domains: fonts . googleapis . com, fonts . gstatic . com, googleapis . com, gstatic . com, www . googleapis . com, themes . googleusercontent . com, ajax . googleapis . com

Even with that config, codex continue not allowed to connect to Google Fonts, and then, my Next.js build fails.

Can anyone help-me with this?

2 Likes

I have the same problem. did you ever figure it out?

I’ve run into the same issue — even with the domains explicitly listed in the allowlist, Codex still blocks connections to Google Fonts and other googleapis endpoints. It seems the “Additional allowed domains” setting doesn’t fully override the default restrictions yet.

For now, a workaround is to disable external font fetching in your Next.js config and use locally hosted fonts instead. Not ideal, but it keeps the build from failing. Hopefully OpenAI will address this limitation in a future update so the allowlist behaves as expected.

1 Like

Hey everyone,

This confuses a lot of folks up because Next.js doesn’t just hit one Google domain for fonts. A typical Google Fonts load actually goes to two different hosts:

fonts.googleapis.com → serves the CSS

fonts.gstatic.com → serves the actual font files referenced by that CSS

If either of those isn’t allowlisted exactly, the build will fail — even if you think you’ve already “allowed googleapis”.

Codex is pretty strict here. When Internet access is On, outbound traffic is still filtered by the domain allowlist, and only domains that match exactly are permitted. You can extend this list when using “Common dependencies”, but the hostnames have to be correct (no spaces, no scheme, exact match).

Docs: https://platform.openai.com/docs/codex/environment#internet-access

How to fix

In Codex Environment → Additional allowed domains, add these exactly:

fonts.googleapis.com

fonts.gstatic.com

Also double-check that your Allowed HTTP methods include at least GET (and ideally HEAD / OPTIONS). Codex will block requests that use methods outside the allowed set.

Docs: https://platform.openai.com/docs/codex/environment#network-controls

After saving the environment settings, re-run the build in Codex. If you don’t want your build to depend on external network calls at all, the cleanest workaround is to self-host your fonts. Download them into your repo and use next/font/local instead of next/font/google.

1 Like