Safeguard Docs
Integrations

Civitai

Connect Civitai to Safeguard. The API key a private connection needs, what Safeguard reads (text only), how mature content is handled, and step-by-step setup.

Availability

This integration is switched on per workspace. If you do not see the card under Integrations, ask your Safeguard contact.

What it does

The Civitai card connects Safeguard to models on Civitai, such as checkpoints, LoRAs and embeddings. Each model is scanned at its newest published version: Safeguard downloads the model files through Civitai's API, checks each against the SHA-256 Civitai publishes, runs the model malware scan and records the model in your AI inventory with its permissions. Safeguard reads text only: no Civitai image, preview or avatar is fetched or shown, and a model Civitai rates as mature is listed as text with a mature content (text only) marker. Find the card under Integrations in the AI models group.

Public vs private

PublicPrivate
What you enterA model URL, such as https://civitai.com/models/<id>A Name and a Civitai API key
Credential neededNoneA Civitai API key
What you can scanPublic models you add by URLEvery model your account published, plus any you add by URL, including downloads that need a signed-in account

Supported auth methods

MethodUse it whenNotes
Civitai API keyYour own models, or downloads that need an accountSent as Authorization: Bearer, the method Civitai recommends
NonePublic modelsNothing to create

Permissions required

Safeguard only reads. It never uploads, edits or deletes a model, and never generates images.

Civitai API key

What Safeguard calls (Civitai site API)Required?What Safeguard uses it for
GET /api/v1/meRequiredThe username the key belongs to
GET /api/v1/models?username=<you> (cursor paging, every page)RequiredListing your models
GET /api/v1/models/{id} and GET /api/v1/model-versions/{id}RequiredThe newest version, its files, their SHA-256 and the model's permissions
The version's file download URLRequiredDownloading each model file for the scan

Least privilege: Civitai API keys are scoped to the whole account. Create a key for Safeguard alone and delete it when you disconnect.

Token types

Key typeWorks?Notes
Personal API key (account settings, API Keys)Yes
OAuth app credentialsNoSafeguard does not use Civitai OAuth

Expiry: Civitai API keys do not expire on their own. Rotate the key at least every 90 days.

What we never need: Buzz or generation access, or the right to post, comment or upload.

Step-by-step setup

Create the credential in Civitai

  1. Sign in to Civitai and open your Account settings (https://civitai.com/user/account).
  2. Under API Keys, add a key named Safeguard.
  3. Copy the key. Civitai shows it once.

Or with the Civitai API

To check the key before you paste it into Safeguard:

curl -H "Authorization: Bearer $CIVITAI_TOKEN" https://civitai.com/api/v1/me

Connect it in Safeguard

  1. Open Integrations and click Connect on the Civitai card.
  2. For public models, choose Public, enter a Name, paste a model URL, click Add, then Next.
  3. For your own models, choose Private, enter a Name, paste the key into Access Token and verify it.
  4. Click Next, select the models to scan, review and connect.

Webhooks and triggers

This integration has no webhooks. Each selected model is scanned when you connect it; to rescan new versions, set a schedule under Integrations > Scheduled or rescan by hand from the project.

What we read and store

  • Read: your username, your models' names, types, base models, ratings and permissions, each version's file list with SHA-256, and the files of the models you select.
  • Licence: Civitai publishes no licence id. Safeguard shows each model's own permissions as Civitai publishes them (commercial uses allowed, derivatives, credit) and names the base model, whose own licence also applies.
  • Stored: the connection's settings, the scan results and AI inventory entry of each scanned model, and the key, encrypted at rest and never shown again after you save it.
  • Not stored: model files (read for the scan and removed) and anything from Civitai's images.
  • No customer data from this integration is sent to third-party LLMs.

Troubleshooting

Message you seeCauseFix
Civitai refused the Civitai API keyThe key was deleted or mistypedCreate a new key and paste it again
This Civitai model is not publicThe model needs an account to readUse Private with an API key
Civitai has archived this model (or taken it down)Civitai moderated the model, so its files are not servedNothing to scan; remove it from the connection
A scan fails with a file hash mismatchThe download did not match the SHA-256 Civitai publishesRescan; if it repeats, report the model to Civitai

Rotation and disconnect

  • Rotate: add a new key in Civitai, find the connection under Project Configurations, choose Update, paste the new key and save, then delete the old key in Civitai.
  • Disconnect: choose Delete from the connection's menu under Project Configurations, then delete the key in Civitai.

Vendor references

On this page