Set up the safety server

The optional safety server, which we call the safety worker, runs content checks on hardware you control. Prompts and images travel only between SQUAD Studio and a worker you run, and the worker downloads only the models your administrator selects. The safety stack is a Team feature.

Think of the worker like any other internal service, or like a ComfyUI endpoint you point SQUAD Studio at. SQUAD Studio connects to the worker. The worker never connects to SQUAD Studio, so it needs no address for it, no route back to it, and no firewall opening in that direction. You give SQUAD Studio two things: the worker's address and a shared credential.

This page is written so that someone who has never used SQUAD Studio can deploy the worker from it, and so that a security reviewer can see exactly what it does.

Decide where it runs

The worker is a single container. Where you put it depends on how many people use SQUAD Studio and who looks after your servers.

  • The same computer as SQUAD Studio. The simplest start. Publish the port only on 127.0.0.1 and use http://127.0.0.1:7100 as the address.
  • Another computer on the same network. For example, a Windows PC with a graphics card beside a Mac running SQUAD Studio. Use the PC's network address, such as http://192.168.1.50:7100. Plain HTTP works here, and SQUAD Studio shows a warning so the choice is deliberate.
  • A data center or cloud. Run it with your other internal services, behind your own proxy or ingress if you like, and give SQUAD Studio an https:// address such as https://safety.example.internal.

In every case the worker only has to be reachable from the machine or server that runs SQUAD Studio's service. Keep it off the public internet.

Connections and ports

From To Port Why
SQUAD Studio Safety worker 7100 by default, or your proxy's port Status checks, delivering the selected offerings, and scoring
Safety worker The model source or your mirror 443 Downloading a selected model the first time, only if it is not already in the model cache
Your container platform Safety worker 7100 /health and /ready probes

There is no connection from the worker to SQUAD Studio. The worker also makes no request to Squad Create, Inc.

Before you begin

You need:

  • Docker, Docker Compose, or Kubernetes on the worker machine;
  • an administrator who can manage safety in SQUAD Studio;
  • private registry access from your SQUAD Studio rollout contact for the current preview image;
  • an NVIDIA GPU for faster scoring, or a CPU for a slower trial;
  • a persistent volume for the model cache. It is the only storage the worker keeps.

If a selected offering requires access to a gated model source, set HF_TOKEN or HUGGINGFACE_HUB_TOKEN in the worker environment through your secret store. This is separate from the worker credential; the signed listing tells you whether it is required.

Create the credential

The worker credential is one shared secret, at least 32 characters, that SQUAD Studio sends with every request. The worker refuses anything without it.

You can choose Generate in SQUAD Studio, or have your IT team create one in its own secret store and paste it in. On the worker, set it as WORKER_TOKEN, or point WORKER_TOKEN_FILE at a mounted secret file so it never appears in a command line. Several replicas can share the same credential.

Connect the worker in SQUAD Studio

  1. Open Safety under Platform in the sidebar, then choose Servers.
  2. Choose Connect a safety worker.
  3. Enter the Worker address, including the port, for example http://192.168.1.50:7100.
  4. Choose Generate, or paste the credential from your secret store.
  5. Leave Offerings are chosen by on SQUAD Studio unless your IT team manages offerings, as described below.
  6. For a direct HTTP worker managed by SQUAD Studio, choose CPU or NVIDIA GPU under Docker command and choose Copy Docker command. For HTTPS or an IT-managed file, follow the certificate and deployment instructions below.
  7. Start the worker with your command or deployment, then choose Save and connect.

SQUAD Studio checks the worker straight away and then about every 30 seconds. After the first successful check it sends the offerings your administrator selected, and the worker downloads and verifies them.

Start it

For a worker on the same computer as SQUAD Studio, the copied command looks like this. The address below keeps its published port on this computer only:

docker run -d --name squad-safety --restart unless-stopped \
  --read-only --tmpfs /tmp \
  -p 127.0.0.1:7100:7100 \
  -e WORKER_TOKEN='<the credential>' \
  -e DEVICE=cpu \
  -v squad-safety-models:/opt/hf-cache \
  ghcr.io/squadcreate/squad-safety:latest-cpu

For a GPU machine, add --gpus all, use DEVICE=cuda, and use the latest-nvidia image. The container runs as a non-root user and works with a read-only root filesystem; the model cache volume is the only place it writes.

For a worker on another computer, use the command generated for that computer's address instead. It publishes the worker for network access, so restrict access to the SQUAD Studio host with your firewall. The loopback-only example above cannot be reached from a different computer.

If your IT team uses Compose or Kubernetes, ask your SQUAD Studio rollout contact for the deployment examples supplied with the worker package. They cover mounted secrets, probes, a read-only root filesystem, and GPU requests. There is no Helm chart.

Return to Safety > Servers. The card shows the address, when SQUAD Studio last reached the worker, and the reason for any failed check.

Choose Verify scoring on the card. SQUAD Studio sends a harmless test through every assigned offering for each text or image medium it declares. The worker must return every declared category and prove the exact loader, model, revision, and integrity before the card shows Scoring verified. Changing the address, credential, certificate options, or assigned offerings returns the card to Scoring unverified until you verify again.

Start with the policy in flag mode. Review how the classifiers respond to your studio's work before turning selected categories into blocks.

Certificates

For HTTPS, the worker can serve TLS itself, or sit behind your own proxy or ingress.

  • The worker serves TLS. Mount a certificate and key and set TLS_CERT_FILE and TLS_KEY_FILE. The certificate must name the address SQUAD Studio uses, as a DNS name or IP address.
  • Your proxy or ingress terminates TLS. Point SQUAD Studio at the proxy's https:// address and forward to the worker's port 7100 on your private network.

SQUAD Studio always checks the certificate chain and the name in the address. It trusts your operating system's certificate store and the standard public authorities.

If your certificate authority is not installed on the machine that runs SQUAD Studio's service, paste it under Certificate options. It is added to the trusted list, never used instead of it. For an extra check, add a public key pin in the form sha256/<base64>. You can produce one with:

openssl x509 -in worker.crt -pubkey -noout \
  | openssl pkey -pubin -outform der \
  | openssl dgst -sha256 -binary | openssl enc -base64

Without the right authority, the connection fails closed. A wrong certificate, name or pin is never treated as a temporary outage, even for an offering allowed to continue through one.

Mutual TLS, where the worker also checks a certificate from SQUAD Studio, is not available in this release. The shared credential over verified HTTPS is the supported arrangement.

Who chooses the offerings

By default SQUAD Studio chooses. When your administrator selects an offering, SQUAD Studio places it on a compatible worker and sends that worker the exact signed contract. Deselecting it removes it from the worker at the next check. The worker keeps the chosen list in its model cache, so a restart restores exactly what SQUAD Studio last delivered.

Some organizations want model deployment under their own change control. In that case set Offerings are chosen by to The worker's configuration file, choose Copy worker file on the worker card, and put that file on the worker through your normal release process. Mount it read-only and set OFFERINGS_FILE to its path. The worker then loads only what the file lists and refuses changes from SQUAD Studio.

This does not let the file turn anything on. Your administrator still selects offerings, accepts their terms, and sets thresholds and outage behavior in SQUAD Studio. SQUAD Studio compares what the worker reports with the signed catalog it accepted and routes work to an offering only when the revision and integrity match exactly. The card lists what the worker declares, read only.

Several replicas behind a load balancer

The worker keeps no identity of its own, so identical copies can run behind one load balancer with the same credential and the same address in SQUAD Studio.

Give every replica the same worker file (IT managed) and the same model cache contents. Use /ready as the load balancer's health check: a replica reports ready only when every offering in its list is loaded. SQUAD Studio also checks the exact offering proof on every scoring reply, so a reply from a replica that is missing an offering, or holds a different revision, is rejected rather than trusted.

When SQUAD Studio chooses the offerings, it delivers them to whichever replica answers, and it cannot reach every replica behind an opaque load balancer. For replicas, use the worker file.

Model downloads, mirrors and offline sites

The worker downloads a selected model only if its complete revision is not already in the model cache. Whatever the source, it loads only the exact revision from the signed catalog, and only after checking the files against its pinned hash and size. If a download was interrupted, the next attempt resumes the download and then checks the whole model again. A finished cached copy that does not match is refused, not downloaded again, and with HF_HUB_OFFLINE=1 an unfinished copy is refused too.

  • Where models live. Models sit in the standard Hugging Face layout under /opt/hf-cache/hub in the image, which is $HF_HOME/hub. The list of offerings SQUAD Studio delivered is kept separately in /opt/hf-cache/squad-safety.
  • Outbound addresses. In our testing, the worker reached huggingface.co for model details and small files, and Hugging Face's Xet storage at cas-server.xethub.hf.co for the model weights. The download library also fetched a small public list from huggingface.co and kept it in the model cache; it carries none of your content. Hugging Face can change its download hosts, so treat these as what we saw rather than a complete allowlist.
  • Proxy. The worker honors HTTPS_PROXY and NO_PROXY.
  • Internal mirror. Set HF_ENDPOINT to your mirror of the declared source.
  • Check the first download. We tested the direct connection. With a proxy or mirror, watch the first download complete, including whether your mirror sends weight downloads on to Xet storage. The pinned hash check is the same either way.
  • Air-gapped sites. On a connected machine, pre-seed the model cache volume with the selected revisions, for example with HF_HOME=/opt/hf-cache hf download <model> --revision <full revision>, then set HF_HUB_OFFLINE=1 on the worker. Verified cached models load without any network access.
  • A cache in another place. Set HF_HUB_CACHE to use a pre-seeded cache mounted somewhere else. A volume from an earlier preview worker keeps models directly in /opt/hf-cache; set HF_HUB_CACHE=/opt/hf-cache to keep using it without downloading again.

Sizing

The worker scores one item at a time and queues the rest. Each offering's listing in SQUAD Studio states its memory, storage and GPU needs; give the worker enough for every offering assigned to it. Small text models are comfortable on a CPU. Larger image and guard models are much faster on a GPU with enough memory for the listed size. When one machine is not enough, spread offerings across several workers or run replicas as described above.

Health, logs and monitoring

  • GET /health reports whether the process is alive and not stuck on a scoring task.
  • GET /ready reports whether every expected offering is loaded.
  • Everything else, including /info, requires the worker credential.
  • Logs never contain prompts, images or scores. Set LOG_FORMAT=json for the worker's own messages as one JSON object per line. While a model downloads or loads, the download and model libraries can still print plain-text progress bars and warnings, so let your log collector accept lines that are not JSON.

A separate metrics endpoint is not included in this release. Use the probes, logs, and the status shown in SQUAD Studio.

Security review checklist

  • The worker accepts connections; it never opens one to SQUAD Studio or to Squad Create, Inc.
  • Every request except /health and /ready requires the shared credential, compared in constant time.
  • SQUAD Studio stores the credential encrypted in your own database and never shows it again.
  • HTTPS verifies the chain and name against the system store, plus an optional private authority and pin.
  • Plain HTTP beyond the same machine shows a warning and is meant only for trusted private networks.
  • The container runs as a non-root user, supports a read-only root filesystem, and writes only to the model cache.
  • The image contains no model weights. Only selected, signed, pinned models are downloaded, from their declared source or your mirror, and verified against the pinned hash.
  • Enforcing selections fail closed on a wrong credential, untrusted certificate, missing or mismatched model, or malformed scores. Observe-only selections record those failures without holding work. An offering may continue through a genuine network outage only when your administrator allowed it and other offerings still cover the policy, and that is recorded.
  • Squad Create, Inc. never receives prompts, images, scores, credentials, selections or policy.

If something does not work

  • The card says the worker cannot be reached: check the address and port from the SQUAD Studio machine, and that the worker is running and published on that port.

  • The card says the credential was rejected: make sure SQUAD Studio and WORKER_TOKEN hold the same value. Edit the connection to paste it again.

  • The card says the certificate is not trusted: install your authority on the SQUAD Studio host or paste it under Certificate options, and check that the certificate names the address you entered.

  • The card says the offering owner does not match: the worker has an OFFERINGS_FILE but SQUAD Studio expects to choose offerings, or the reverse. Change one of them.

  • Status is green but scoring is not verified: run Verify scoring and read the reason it shows.

  • A model download failed: check the worker's access to the model source and any required source credential. App-managed workers retry after a bounded delay. For an IT-managed worker file, restart the worker after fixing the cause; its existing verified cache is retained.