> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Abuse Protection

Protecting a Bijection installation from abuse — denial-of-service (DDoS) floods,
scraping, credential stuffing, and other malicious or expensive traffic — is
partly handled for you and partly up to you. This page covers what Bijection
protects against automatically, what it doesn't, and how to add your own edge
for the rest.

## Choosing an approach

| You want… | Use |
| - | - |
| Network-layer protection only | Nothing — [the built-in baseline](#what-bijection-already-protects) covers it |
| Restrict access by source IP or to a private connection | [Enterprise ingress policy](https://docs.bijection.com/operate/networking#enterprise-ingress-policy) |
| A cap on metered sends for an app or function | [Budgets](https://docs.bijection.com/operate/usage.md#budgets) |
| Control over your domain's reputation | [A custom domain](#what-a-custom-domain-changes) |
| Your own WAF / rate limits on the realtime API (`*.bijection.cloud`) | [Your own proxy](#putting-your-own-proxy-in-front) that passes WebSocket connections, such as a Cloudflare zone |
| Your own WAF / rate limits on route reactions (`*.bijection.run`) | [Your own proxy](#putting-your-own-proxy-in-front), such as a Cloudflare zone or [a Vercel project](#putting-vercel-in-front) |

Bringing your own edge is about **policy control**, not basic survivability —
reach for it when you have a specific application-layer concern, not as a
default.

## What Bijection already protects

Bijection-hosted runtime traffic comes through the public edge to the
installation's cell. The baseline covers the default `<name>.bijection.cloud` and
`<name>.bijection.run` hosts and runtime custom domains.

* **Network-layer DDoS mitigation.** AWS applies
  [AWS Shield Standard](https://aws.amazon.com/shield/) to every load balancer.
  It mitigates common network- and transport-layer (L3/L4) floods, such as SYN
  floods and reflection attacks, before they reach your installation.
* **HTTPS only.** The load balancer accepts connections on port 443 alone and
  requires TLS 1.2 or higher. Plain HTTP is not served. Certificates are issued
  and renewed for you, a custom domain's through the validation record you keep
  in its DNS.
* **Exact host routing.** The load balancer forwards only your installation's own
  two hosts and its custom domains, matched on the `Host` header. A request for
  any other host gets a `404` and never reaches a backend.
* **Dedicated Enterprise ingress.** Each Enterprise installation has a dedicated
  cell. Administrators with a Hosting grant can [limit public ingress by source IP or close
  it and use PrivateLink](https://docs.bijection.com/operate/networking#enterprise-ingress-policy).
* **Bounded work.** An installation runs a fixed number of functions at a time,
  and a call that waits too long for a slot is rejected rather than queued
  without bound ([concurrency limits](https://docs.bijection.com/operate/limits.md#concurrent-function-executions)).
  Every function also has execution-time, size and read/write
  [limits](https://docs.bijection.com/operate/limits.md).
* **Confined outbound requests.** Tasks the host sends to
  [targets](https://docs.bijection.com/functions/effects.md), the discovery and key requests for your
  [authentication](https://docs.bijection.com/access/authentication) providers, and
  [log export](https://docs.bijection.com/operate/observability/log-export.md) batches reach public internet
  addresses only. Loopback, private-network, link-local and cloud-metadata
  addresses are refused, including when a name resolves to one or a redirect
  leads to one, and the request fails with `Request to <url> forbidden`. A URL
  that an attacker gets into a task's arguments cannot reach the installation's
  internal network. Function code has no network of its own: it performs no
  I/O, and a task is sent only to the URL its target declares: see
  [where outbound requests can go](https://docs.bijection.com/operate/networking#where-outbound-requests-can-go).

This baseline applies with no extra configuration. It is not a guarantee against
every kind of attack — see below — but basic network-layer survivability is not
something you have to set up yourself.

The concurrency limits cap what a flood can make your installation do, but they
do not tell your users from an attacker: a flood of function calls can still
crowd out legitimate traffic. [Budgets](https://docs.bijection.com/operate/usage.md#budgets) can cap the
units that app functions reserve for metered sends.

## What a custom domain changes

Since the baseline already covers your default hosts, a custom domain is not
what gives you that protection: it is served by the same load balancer, with its
own certificate. What it changes is **ownership**:

* **Domain reputation is yours.** Your default hosts are names under
  `bijection.cloud` and `bijection.run`, which every Bijection installation
  shares. A custom domain is one you own, so its reputation and standing with
  ISPs, corporate networks, browsers, and other intermediaries is yours to
  manage rather than shared.
* **You can put your own edge in front.** Because you control the domain's DNS,
  you can later route it through your own proxy, so your own WAF rules, rate
  limiting, and bot management apply, without changing the URL your clients
  use. See [the sections below](#putting-your-own-proxy-in-front).

## Native clients and custom domains

Native and mobile clients usually bake the installation URL into a build that's
already on users' devices — unlike a web app, you can't change it just by
redeploying. Plan for this **before** you ship:

* **Build in a way to change the host.** Make the Bijection URL something your app
  can update remotely (for example, fetched from a configuration endpoint at
  startup) rather than a hardcoded constant, so you can point existing installs
  at a new host without shipping an app-store release.
* **Or adopt a custom domain before you ship.** If you serve your installation
  from a custom domain from the start, you control the host for the life of the
  app.

A custom domain adds a hostname. Clients can still reach public default hosts
unless the installation restricts public ingress. On dedicated Enterprise
installations, use the ingress policy to admit only a trusted proxy's source IPs
or serve clients through PrivateLink.

## Application-layer controls you add yourself

The baseline doesn't include **application-layer** protections — the tools
you'd reach for against abuse like floods of expensive HTTP requests, scraping,
or credential stuffing. Bijection has no web application firewall, per-IP or
per-user rate limiting, bot detection or challenge pages in front of your
installation.

Within your app, decide who may call what: give each exposed function an
[`allow`](https://docs.bijection.com/access) list of roles, leave backend-only
[functions](https://docs.bijection.com/functions) without `allow` so no client can enter them, add
[guards](https://docs.bijection.com/access/guards.md) that refuse acts in scope, and
[declare argument types](https://docs.bijection.com/functions/validation.md). Review `bijection.lock` to
see everything the app exposes.

For edge controls, route your traffic through your own proxy, such as a
Cloudflare zone or a Vercel project (see below), and add:

* Custom [WAF](https://developers.cloudflare.com/waf/) and firewall rules —
  blocking by country, ASN, IP, path, header, or request shape.
* Per-route or per-IP
  [rate limiting](https://developers.cloudflare.com/waf/rate-limiting-rules/).
* Bot management and challenge pages.
* Caching, analytics, and log export for traffic to your domain.

## Putting your own proxy in front

A proxy you run in front of your installation applies your WAF rules, rate
limiting, and bot management before traffic reaches Bijection. Treat this as an
**advanced setup**: it adds a hop with its own timeouts and limits, such as how
long a WebSocket connection may stay open, and Bijection has not tested any
particular proxy in front of an installation.

Your installation's load balancer routes on the `Host` header alone
(`X-Forwarded-Host` is ignored) and presents the certificate for the server
name the TLS connection asks for. A proxy therefore takes one of two shapes:

* **Forward to the installation's own host.** The proxy sends each request to
  `https://<name>.bijection.run` (or `https://<name>.bijection.cloud`), with
  that host as both the `Host` header and the TLS server name, as forwarding to
  a URL normally does. Nothing needs to be registered in Bijection.
  [Vercel](#putting-vercel-in-front) works this way.
* **Proxy a custom domain.** [Add the domain](https://docs.bijection.com/operate/networking/domains.md) to
  your installation, set the two records it shows, and turn on your proxy for the
  routing record, for example as a proxied record (the orange cloud) in your
  own Cloudflare zone. The proxy must keep your domain as the `Host` header and
  the TLS server name on its way to Bijection. Leave the certificate validation
  record unproxied (DNS only): the certificate is validated, and renewed,
  through it.

To serve the realtime API (`*.bijection.cloud` or an API custom domain), the
proxy must pass WebSocket connections, which the realtime client uses for
queries, watches and mutations.

Bijection checks that a custom domain serves your installation by sending it
requests: `/instance_name` and a WebSocket connection for an API domain, the
root path `/` for a routes domain. Let these requests through your rules;
if they are blocked, Installation Settings can report that the domain does not
serve this installation.

> [!WARNING]
>
> A proxy does not hide your installation. Its default `<name>.bijection.cloud`
> and `<name>.bijection.run` hosts stay reachable directly, and Bijection
> offers no way to accept only your proxy's traffic, so anyone who knows those
> hosts can bypass your proxy's rules.

## Putting Vercel in front

A [Vercel](https://vercel.com) project can front your domain and apply
[Vercel's DDoS mitigation and firewall](https://vercel.com/docs/security/ddos-mitigation).
Vercel proxies traffic using
[rewrites](https://vercel.com/docs/edge-network/rewrites), which forward
matching requests to an external origin.

> [!NOTE]
>
> This works for [route reactions](https://docs.bijection.com/functions/reactions.md#routes) (`*.bijection.run`)
> **only**. Vercel rewrites proxy HTTP requests, not WebSocket connections, and
> the realtime Bijection API (queries and mutations over `*.bijection.cloud`)
> uses WebSockets — so it cannot be served through a Vercel rewrite. Vercel is not
> a general custom-domain protection strategy for Bijection; it's an option for the
> routes surface specifically.

To proxy your routes through Vercel:

1. Add your domain (e.g. `api.example.com`) to your Vercel project.

2. Add a rewrite to `vercel.json` that forwards to your installation's routes
   URL:

   ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
   {
     "rewrites": [
       {
         "source": "/:path*",
         "destination": "https://<your installation>.bijection.run/:path*"
       }
     ]
   }
   ```

3. Configure [Vercel Firewall](https://vercel.com/docs/security/vercel-waf)
   rules and rate limiting as desired.

Because the domain points at Vercel rather than at your installation, you do not
need to register it as a Bijection custom domain for this to work — Vercel
forwards to your installation's default `<name>.bijection.run` URL.

Reach out to [contact@bijection.com](mailto:contact@bijection.com) if you have questions about hardening a custom
domain.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.