Network and exposure
Domains​
Breign needs two public addresses, served over HTTPS:
| Address | Component | Example |
|---|---|---|
| The app | Breign APP | https://breign.example.com |
| The API | Breign API | https://api.breign.example.com |
Users' browsers also reach the object storage directly (see Object storage). The other components (Document API, Scrapping API, Guards API, database, vector database) stay on your private network.
"Public" means reachable by your users: on an intranet-only deployment, these addresses can be internal, as long as browsers, the CLI, Breign Mate and execution nodes reach them. Webhooks from external systems (GitLab, automations) and remote MCP clients need to reach the API too.
Configure the addresses in:
- Breign API:
SERVER__(its own URL) andHOST SERVER__(the app URL);APP_ HOST - Breign APP:
BETTER_(its own URL),AUTH_ URL NEXT_,PUBLIC_ BRAIN_ API_ ENDPOINT BRAIN_andAPI_ ENDPOINT NEXT_(PUBLIC_ BRAIN_ WS_ ENDPOINT wss://+ the API host); - Breign API:
AUTHENTICATION__, which must contain the app URL.TRUSTED_ ORIGINS
Flows​
Inbound​
Everything inbound goes to the app and the API, on port 443.
| Route on the API | Used by |
|---|---|
All REST routes (/agents, /conversations, /organizations…), /api/docs | The app, the CLI, Mate, your integrations |
/rp/auth/* | Sign-in (SSO callbacks), Breign as an OAuth provider |
/auth/* | Sign-in of the CLI and Breign Mate |
/oauth/callback, /tools/:id/oauth/callback | OAuth 2 connection of agents' tools (MCP, OpenAPI) |
/organizations/:org/mcp, /mcp/builder | MCP clients (Claude, Cursor, Mate…) calling Breign agents |
/organizations/:org/ai-gateway/v1/* | The AI Gateway (OpenAI-compatible) |
/ws/mate (WebSocket) | Execution nodes (CLI, Mate, node containers) |
/node-sessions/:id/* | Execution nodes, during an agent turn |
/apps/*/sockets, /agents/*/sockets (WebSocket) | Avatar apps |
/webhooks/gitlab/:id, /webhooks/automations/:id | GitLab and automation webhooks |
Don't filter the API by path unless you know which features you use: the app relies on most routes.
Outbound​
| From | To | Why |
|---|---|---|
| Breign APP | Breign API (public URL), database, Resend, MCP servers | Pages, sign-in, e-mails, listing the tools of MCP servers |
| Breign API | Database, object storage, vector database | Data |
| Breign API | AI providers | Agents, embeddings, transcription |
| Breign API | MCP servers and APIs used as tools, GitLab | Agents' tools, automations |
| Breign API | Scrapping API, Guards API | Optional features |
| Breign API | Resend | E-mails |
| Document API | Database, object storage, OCR provider | Parsing |
| Scrapping API | Websites to crawl, database, object storage, Breign API | Website knowledge sources |
| Execution nodes | Breign API (HTTPS and WebSocket), GitHub (to download fx), your Git servers | Agent turns on nodes |
Breign does not use an outbound HTTP proxy setting of its own. If your network requires a proxy, allow these flows directly, or test Node.js's NODE_USE_ENV_PROXY=1 with HTTPS_ / NO_ on Breign API (not all clients honour it).
Reverse proxy​
Whatever you use in front of the app and the API (ingress controller, load balancer, Nginx, Traefik, Caddy, Application Gateway…), check these settings for the API:
- WebSockets: allow the
UpgradeandConnectionheaders, and keep idle connections open (execution nodes stay connected for hours). - Streaming (SSE): the AI Gateway streams its answers. Turn off response buffering (
proxy_buffering offwith Nginx; the API also sendsX-Accel-Buffering: no). - Timeouts: allow at least 5 minutes of read timeout. Model generations, tool calls and MCP long polling (up to 50 seconds) last longer than the usual 30–60 seconds.
- Request size: allow at least 32 MB (execution nodes send whole conversations to the AI Gateway; file uploads go straight to the storage, not through the API).
- Forwarded headers: pass
X-Forwarded-ForandX-Forwarded-Proto.
The API doesn't need sticky sessions, except for avatar apps (see Architecture).
Example with Nginx:
location / {
proxy_pass http://breign-api:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
client_max_body_size 32m;
}
Object storage​
Browsers upload knowledge files and attachments directly to the storage, through presigned URLs created by the API, and download avatars and logos from the public bucket. So:
- the storage address configured in Breign API must be reachable by users' browsers, over HTTPS;
- the bucket's CORS rules must allow
PUT,POSTandGETfrom the app's domain; - the public bucket must be readable without authentication;
- Breign APP must be allowed to display images from it (
IMAGES_andSTORAGE_ ENDPOINT IMAGES_).STORAGE_ PATH
With the Mistral OCR "document" mode, Mistral downloads the document itself from a presigned URL: the storage must then be reachable from the internet.
Example CORS rule for an S3-compatible storage:
[
{
"AllowedOrigins": ["https://breign.example.com"],
"AllowedMethods": ["GET", "PUT", "POST"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 3600
}
]
Certificates​
The app and the API need certificates trusted by your users' browsers and by the CLI and Mate. If your internal services (database, storage, MCP servers, AI endpoint) use certificates from a company CA, mount that CA into Breign API, Document API and Scrapping API under /usr/local/share/ca-certificates/: it is added to the trusted authorities when the container starts.