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