Modern web applications run more code than their teams wrote.
A typical page may load an analytics SDK, error tracker, payment widget, customer-support chat, A/B testing library, feature-flag client, map provider, authentication flow, and sometimes AI-generated code that was reviewed quickly but not fully understood.
The usual security question is:
Can this code run on my page?
Chrome’s new Connection-Allowlist capability adds a more useful question:
If this code runs, where is it allowed to send data?
Connection Allowlist is a browser-enforced outbound network policy. A server sends a Connection-Allowlist HTTP response header containing approved URL patterns. Before a document or worker opens a network connection, Chrome checks whether the destination matches the allowlist. If it does not match, the browser blocks the connection before it is established.
That makes it useful as a browser-level egress control: a deny-by-default network boundary for code running in a specific page or worker context.
It is especially relevant for untrusted third-party scripts, user-provided plugins, embedded developer tools, code generated by AI systems, and high-risk application surfaces that should only contact a small number of known services.
The problem: JavaScript has many ways to talk to the network
A script does not need to call one obvious API endpoint to move data.
Depending on the browser capability and application architecture, code may use:
fetch()XMLHttpRequestWebSocketWebTransport- WebRTC
- images, fonts, and subresources
- redirects
- navigation
- popup windows
- nested frames
- worker contexts
A third-party library may be legitimate when installed and later change behavior through a remote update. A compromised dependency may read data from the page and attempt to send it to an unexpected endpoint. An AI-assisted code change may introduce an unnecessary external request that passes code review because it looks harmless.
Traditional controls still matter:
- Content Security Policy
- Subresource Integrity
- sandboxed iframes
- Permissions Policy
- careful dependency review
- network monitoring
- server-side API controls
But those controls do not always give teams one precise answer to this question:
Which network destinations may this isolated piece of browser code contact?
Connection Allowlist is designed to answer that question with an explicit policy.
What Connection Allowlist does
A basic policy might look like this:
Connection-Allowlist: (
response-origin
"[https://api.example.com/*](https://api.example.com/*)"
"[https://cdn.example.com/*](https://cdn.example.com/*)"
)
This tells Chrome that the document or worker may connect only to:
- Its own response origin
- Paths under
https://api.example.com/ - Paths under
https://cdn.example.com/
Everything else is denied.
Chrome describes this as a strict network sandbox for documents and workers. The browser evaluates a connection destination against the allowlist before establishing it, blocking destinations that do not match. Chrome made the feature available starting in Chrome 152. [107][144]
The most important idea is not the header syntax. It is the policy model:
No destination is allowed unless your policy explicitly permits it.
That is different from trying to block known bad domains after the fact.
Why this matters for AI-generated code
AI coding tools can produce useful code quickly. They can also produce code that:
- Adds an unexpected telemetry endpoint
- Imports a package that performs background requests
- Embeds a remote script or tracking pixel
- Sends page content to an external API
- Calls a model provider directly from the browser
- Creates a fallback request to an unapproved domain
- Reuses code with hidden assumptions about external services
The problem is not that all AI-generated code is malicious. The problem is that browser code has access to the user’s session context, rendered page state, form values, application APIs, and network APIs.
A Connection Allowlist lets you constrain the blast radius.
For example, imagine an internal AI-assisted dashboard that embeds a generated reporting widget. The widget only needs to:
- Read data from the page
- Call
https://api.internal.example.com/ - Load assets from
https://assets.internal.example.com/
Its policy can be narrow:
Connection-Allowlist: (
"[https://api.internal.example.com/*](https://api.internal.example.com/*)"
"[https://assets.internal.example.com/*](https://assets.internal.example.com/*)"
)
If that widget later tries to send data to https://unknown-telemetry.example/collect, Chrome can block it because the destination is not on the list.
This does not prove the widget is safe. It does provide a technical boundary around where it can communicate.
Do not apply it blindly to your whole application
The biggest implementation mistake would be applying a strict allowlist to a full production page before you understand every legitimate browser-side connection.
Modern pages often depend on more outbound destinations than teams realize:
- API origins
- OAuth and identity-provider endpoints
- payment-provider frames
- error-reporting endpoints
- analytics collectors
- image-CDN domains
- font providers
- WebSocket endpoints
- customer-support widgets
- feature-flag services
- asset and script CDNs
- redirects during authentication flows
A strict policy can break a page in ways that are difficult to predict from server logs alone.
Chrome specifically recommends isolating untrusted code in a dedicated iframe and applying the Connection-Allowlist header to that iframe rather than broadly applying it to trusted application code. The iframe should be cross-origin or sandboxed so the untrusted code cannot bypass the restriction through same-origin scripting. [107]
This is the safer architecture:
Trusted application page
│
├── Your application code
├── Authentication and payment integrations
├── Approved first-party API calls
│
└── Sandboxed or cross-origin iframe
│
├── Third-party widget
├── Plugin code
├── AI-generated component
└── Strict Connection-Allowlist policy
The iframe isolates trust boundaries. The allowlist defines network boundaries.
You usually want both.
Start in report-only mode
Do not deploy a blocking policy first.
Start with Connection-Allowlist-Report-Only, which evaluates the policy and sends violation reports without preventing the connection.
Example:
Reporting-Endpoints: security="[https://reports.example.com/browser-security](https://reports.example.com/browser-security)"
Connection-Allowlist-Report-Only: (
response-origin
"[https://api.example.com/*](https://api.example.com/*)"
"[https://cdn.example.com/*](https://cdn.example.com/*)"
); report-to=security
In report-only mode, Chrome permits the request but reports that the request would have been blocked under enforcement.
That gives you a way to discover real behavior before breaking production:
Expected connection:
[https://api.example.com/v1/projects](https://api.example.com/v1/projects)
→ Allowed by policy
Unexpected connection:
[https://telemetry.vendor-example.com/collect](https://telemetry.vendor-example.com/collect)
→ Reported as a violation
Forgotten OAuth endpoint:
[https://login.identity-provider.com/authorize](https://login.identity-provider.com/authorize)
→ Reported as a violation
Chrome’s documentation states that report-only mode parses the policy and sends violation reports through the Reporting API without blocking connections. It also requires a Reporting-Endpoints response header that maps the report endpoint name to a real URL. [107][141]
Treat report-only deployment as an inventory project, not a formality.
Your goal is to classify every observed destination:
| Destination type | Decision |
|---|---|
| Required first-party API | Allow explicitly |
| Required identity provider | Allow only the needed endpoint pattern |
| Required payment or support provider | Allow only inside the relevant isolated context |
| Temporary development tool | Remove before production or isolate it |
| Unknown analytics or telemetry request | Investigate before allowing |
| Unexpected third-party endpoint | Block or remove the dependency |
Do not convert reports into permanent allowlist entries automatically. A report is evidence that a request happened, not evidence that it should be trusted.
A practical rollout strategy
1. Pick a narrow, high-value target
Good first targets include:
- A third-party analytics or support widget
- An embedded partner integration
- A user-customizable dashboard panel
- A low-trust plugin surface
- An internal AI-generated feature
- A document preview or code preview iframe
- A marketing widget isolated from your authenticated application
Avoid starting with your main authenticated application shell.
2. Isolate the code
Serve the untrusted feature from a separate origin when practical:
app.example.com
widgets.example.com
Then embed it in a sandboxed iframe:
<iframe
src="[https://widgets.example.com/reporting-panel](https://widgets.example.com/reporting-panel)"
sandbox="allow-scripts"
title="Reporting panel"
></iframe>
The exact sandbox permissions depend on what the feature needs. The point is to avoid giving the embedded code same-origin access to the parent application by default.
3. Deploy report-only
Set a deliberately narrow initial policy and collect reports.
Reporting-Endpoints: security="[https://reports.example.com/browser-security](https://reports.example.com/browser-security)"
Connection-Allowlist-Report-Only: (
"[https://api.example.com/*](https://api.example.com/*)"
"[https://assets.example.com/*](https://assets.example.com/*)"
); report-to=security
Monitor reports across real user flows:
- Initial page load
- Login and logout
- Password reset
- OAuth callbacks
- Payment flows
- File uploads
- WebSocket connections
- Error-reporting paths
- Feature-flag refreshes
- Slow-network behavior
- Browser back/forward navigation
4. Classify, then reduce
For every destination, decide whether it is:
- Required and approved
- Required but should move into another isolated context
- Temporary or development-only
- Unnecessary
- Unknown and suspicious
A good allowlist gets smaller over time. If it becomes a giant list of broad wildcard domains, it is no longer serving its security purpose.
5. Enforce gradually
Once report-only violations are understood, change the response header to enforcement mode:
Connection-Allowlist: (
"[https://api.example.com/*](https://api.example.com/*)"
"[https://assets.example.com/*](https://assets.example.com/*)"
)
Keep reporting configured so you can observe blocked connection attempts and policy drift after enforcement.
Connection Allowlist is not a replacement for CSP
Connection Allowlist and Content Security Policy solve related but different problems.
| Control | Primary job |
|---|---|
| Content Security Policy | Controls which resources the page may load and which script behaviors are allowed |
| Subresource Integrity | Verifies that a fetched script matches an expected cryptographic hash |
| Sandboxed iframe | Creates an execution and origin boundary |
| Permissions Policy | Limits access to powerful browser features |
| Connection Allowlist | Restricts where a document or worker may establish network connections |
Use Connection Allowlist as a complementary egress control.
For example:
- Use CSP to limit script sources.
- Use SRI for static third-party scripts where possible.
- Use sandboxed, cross-origin iframes for lower-trust code.
- Use Connection Allowlist inside that iframe to restrict allowed network destinations.
- Use report-only mode before enforcement.
- Review violation reports as part of dependency and security monitoring.
No single header makes third-party code safe. The goal is layered defenses that make unexpected behavior harder.
The real value: security architecture, not header syntax
The most valuable outcome is not adding one header to a response.
It is forcing your team to answer:
Which browser-side code is trusted?
Which code is merely tolerated?
Which external destinations are actually required?
Which connections would be suspicious if they appeared tomorrow?
That is a useful exercise even before Connection Allowlist is widely deployed.
AI-generated components and third-party scripts are changing how much code runs inside the browser. Connection Allowlist gives web teams a way to put a hard network boundary around the parts they do not fully trust.
Start with one isolated iframe, deploy report-only mode, classify every outbound destination, and enforce only when the policy is small enough to mean something.
That is how a new browser security feature becomes a practical production control instead of another header nobody understands.



