This feature is currently in public preview and is not recommended for production use.
Allowlist
Only the listed domains are reachable:Denylist
All domains except the listed ones are reachable:When a request matches both lists,
forbiddenDomains wins and the request is blocked. An empty allowedDomains allows everything that is not in forbiddenDomains.Method and path patterns
Each entry inallowedDomains and forbiddenDomains is a pattern. A bare domain like api.stripe.com or *.s3.amazonaws.com is the simplest form. You can also scope a rule to specific HTTP methods and URL paths by adding method prefixes and a path suffix:
- An optional leading
!negates the method set. - Zero or more HTTP methods, colon-separated, before the domain (case-insensitive).
- The domain (exact,
*.suffix, or*). - An optional
/pathprefix.
Methods
- No method in the pattern matches any method.
- One or more methods match only those methods (case-insensitive).
- A leading
!negates the set: it matches every method except those listed.!POST:domainmatches everything but POST, and!GET:POST:domainmatches everything but GET and POST.
Domains
*matches every domain.*.example.commatchessub.example.comanda.b.example.com, but not the bareexample.com.- Any other value is an exact, case-insensitive match.
- A
:porton the request is ignored when matching.
Paths
- No path in the pattern applies the rule to every path on the domain.
- A path is matched as a start-anchored prefix.
*matches any run of characters; every other character is literal./data/matches/data/and/data/file.txt, but not/data./company-mercor*matches/company-mercorand/company-mercor-1/obj, but not/company-other.
- The query string is ignored, so tokens in query parameters never affect the decision.
- The path is canonicalized before matching, so
.,.., and duplicate slashes cannot slip a request past a prefix rule. A request to/company-mercor/../other/objis evaluated as/other/obj.
Evaluation order
For each outbound request the proxy decides in this order:- If any
forbiddenDomainspattern matches, the request is blocked. - Otherwise, if
allowedDomainsis non-empty and no pattern matches, the request is blocked. - Otherwise, the request is allowed.
allowedDomains allows everything that is not forbidden. A blocked request receives an HTTP 403 response with a Proxy-Error: firewall_blocked header.
Backward compatibility
Plain-domain entries behave exactly as before, so existing configurations keep working without changes. The method, path, and negation syntax is opt-in: put the richer strings into the sameallowedDomains and forbiddenDomains arrays. There are no new fields.
Domain filter enforcement
By default, domain filtering depends on the sandbox’s tools respectingHTTP_PROXY and HTTPS_PROXY. To enforce filtering even for tools that bypass those variables, add a firewall config with rulesets: ["proxy"]. This locks down the sandbox’s egress at the network level so that all outbound traffic must flow through the proxy.
Firewall rulesets can only be set when the sandbox is created; changing them on an existing sandbox is rejected. Enforcement is not enabled automatically when a proxy is configured — you must opt in with the
firewall config. Firewalled sandboxes run on Mark 3.0 infrastructure; this feature is not yet available on Carbon (Mark 3.1).Firewall + proxy combined
Firewall rules and proxy routing compose naturally:api.stripe.com and api.openai.com are reachable. The proxy injects credentials for Stripe requests; OpenAI requests go through unmodified.