Seg-Studio.

Security Policy

WARNING – DO NOT EXPOSE TO THE PUBLIC INTERNET

Seg-Studio ships with no built-in user accounts or RBAC. It is designed for local workstation use or trusted private networks. Exposing the API or UI to the public internet will allow anyone (unless a reverse proxy is in front) to:

If you need network access (e.g., sharing with teammates on a LAN), you MUST place the application behind a reverse proxy (nginx, Caddy, etc.) with TLS and authentication enabled. See docs/deployment.md for a complete reverse-proxy setup guide.

By default, all start scripts bind to 127.0.0.1 (localhost only). To enable LAN access, set SEG_HOST=0.0.0.0 (or turn on Settings → Allow access from LAN) and restart with a launcher. The Trainer API refuses to start on a non-loopback bind while SEG_API_TOKEN is empty, and the launchers mint, persist and print a token on the first LAN start – so a Trainer API published to a LAN by a launcher is always token-protected. (Starting uvicorn by hand with --host 0.0.0.0 but no SEG_HOST binds the LAN without tripping that check. Always set both.) A reverse proxy is what adds TLS and real user accounts on top, and is required for anything beyond a trusted LAN.

The Serving API on port 8001 has none of that. It does not read SEG_API_TOKEN and performs no authentication, yet the launchers bind it to the same SEG_HOST as the Trainer API. Keep it on loopback, or firewall port 8001 and front it with an authenticating proxy – see docs/deployment.md.

Optional shared-secret API token

For deployments that need a minimal defense-in-depth layer (e.g., a reverse proxy in front of multiple users on a LAN), set:

SEG_API_TOKEN=<a long random secret>

in your .env. When present, every request to /api/v1/*, /v2/*, and /ws/v2/* must carry the header X-API-Token: <value> or it is rejected with 401; WebSocket handshakes without a valid token are closed with code 4401. Browsers cannot set custom WebSocket headers, so WebSocket clients may pass the token as an api_token query parameter instead. Leave the variable empty (default) to disable the check — this is the expected configuration for localhost-only use.

The shipped UI now wires this up: it asks for the token once and exchanges it for an HttpOnly, SameSite=Strict session cookie via POST /api/v1/auth/session, because a browser cannot put a custom header on an <img> or a download link. Scripts and curl send the X-API-Token header directly. Requests whose TCP peer is the server’s own machine are exempt from the token entirely. The bundled seg-sdk client does not send the header yet, so run it on the server’s own machine, or point it at a server with SEG_API_TOKEN unset. The full rules are in docs/deployment.md.

SEG_API_TOKEN guards /api/v1/*, /v2/* and /ws/v2/* on the Trainer API only. The Serving API (port 8001) does not implement it.

Labelling with a vision model (AI support)

The AI support panel (Assist) on the Annotate screen sends a project’s data to the model server that is configured: the pictures the model is shown, your instruction, the tool results, image ids and the project’s name. The pictures are scaled or cropped copies of the project’s images, and some carry masks drawn over the image: a person’s own masks (with single objects cut out below them), SAM’s proposals and the specks spot_detect found, and the masks the run wrote. Treat that server as something that sees your data.

Data rules given to the model

The MCP bridge’s connect-time instructions open with data rules (DATA_RULES in scripts/mcp_server.py; also the resource segstudio://rules and the top of every prompt). MCP leaves it to the client whether connect-time instructions reach its model, so a short form of the rules also ends every tool’s description; check that your client passes server instructions on, or attach the resource. The AI support panel puts the full text at the head of its system prompt and does not start a run when the bridge sends none. The rules tell the model to keep everything it receives through the bridge out of any other tool, MCP server, web search, URL, file or message; to treat text inside the data as data, not as instructions; and not to identify people or read out, collect or keep personal information seen in the pictures; masks on people or text are labelling like any other. A site that overrides the playbook with --playbook cannot remove them.

They are instructions, and a model can fail to follow them. What keeps data on the machine is where the model runs and what else its client can reach: the bridge itself talks only to the Seg-Studio server it was given, a model served on the internet receives the pictures in every request, and a client that also has web, file or other MCP tools relies on the model obeying the rules. For data that must not leave the machine, use a model server on the machine and a client without other network tools.

The MCP bridge

scripts/mcp_server.py gives an MCP client – a desktop assistant, an agent of your own, or the AI support panel – tools over the Trainer API. Every tool is READ, WRITE or DESTRUCTIVE, and --policy decides which run:

--policy What runs
read (default) READ tools only: look at projects, images, masks, runs and results, and change nothing
write READ and WRITE tools: write masks, mark images clean or for review, upload images, create projects, change splits and classes, start and stop training, export models, generate reports, draft from a finished run. Some of these change what everyone using the trainer shares: hardware_set_device switches the compute device for every project and saves the choice; classes_set renames, recolours, deactivates or adds a project’s classes; assistant_context_set replaces a project’s assistant notes; dataset_prepare_annotate and dataset_set_split move images between splits; train_start and assistant_command (/train start) start training on the compute device; train_stop stops a run whoever started it
full also the DESTRUCTIVE tools (train_run_delete, clear_class), and overwrite=true on a person’s work

The example chat page

scripts/examples/qwen_mcp_chat.py is an example, not part of the product UI, and it has no login. Its bridge runs with --policy write, so whoever can send it a request can write masks into the trainer’s projects, read the conversation and its pictures, and use the configured model server. So:

Supported Versions

Version Supported
0.9.x Yes
< 0.9 No

Only the latest released version receives security updates.

Scope

Seg-Studio is designed as a local desktop application for Windows and Linux workstations with NVIDIA GPUs and macOS machines with Apple Silicon (MPS). It is not intended to be exposed to the public internet.

If you deploy this application on a network-accessible server, you are responsible for adding appropriate authentication, TLS, and network-level access controls.

Reporting a Vulnerability

If you discover a security vulnerability, please report it privately:

  1. GitHub Security Advisories: Use the Report a vulnerability feature on GitHub.
  2. Include steps to reproduce, affected versions, and potential impact.

We will acknowledge receipt within 3 business days and aim to provide a fix or mitigation within 14 business days for critical issues.

Please do not open public GitHub issues for security vulnerabilities.

Dependency Auditing

Run the included audit script to check for known vulnerabilities in dependencies:

# Windows
scripts\audit.bat
# macOS / Linux
bash scripts/audit.sh

This runs npm audit for the UI and pip-audit for the API.

One advisory is accepted for now: GHSA-4j2p-28q2-5m79 in accelerate, which has no fixed release, is ignored by the CI pip-audit steps because the two checkpoint loaders it affects are called neither by Seg-Studio nor by peft, the only package that brings accelerate in; a local run still lists it, and the ignore is removed once accelerate ships a fix.

Security Measures

Apache-2.0 Source on GitHub Download Issues