ModelScope
Connect ModelScope to Safeguard. The SDK token a private connection needs, which token tiers work, what Safeguard reads, 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 ModelScope card connects Safeguard to models on ModelScope (modelscope.cn). Each model is scanned at the newest commit of its master branch: Safeguard downloads the files through ModelScope's API, checks each against the SHA-256 ModelScope publishes, runs the model malware scan and records the model in your AI inventory with its licence. Find the card under Integrations in the AI models group.
Public vs private
| Public | Private | |
|---|---|---|
| What you enter | A model URL, such as https://modelscope.cn/models/<owner>/<model> | A Name and a ModelScope SDK token |
| Credential needed | None | An SDK token |
| What you can scan | Public models you add by URL | Your account's models, private and gated ones included, plus any you add by URL |
Supported auth methods
| Method | Use it when | Notes |
|---|---|---|
| SDK token (access token) | Your own or private models | Sent as Authorization: Bearer on the OpenAPI and as the m_session_id cookie on the file API, as the official SDK does |
| None | Public models | Nothing to create |
Permissions required
Safeguard only reads. It never pushes, edits or deletes anything.
SDK token
| What Safeguard calls (ModelScope API, as the official SDK) | Required? | What Safeguard uses it for |
|---|---|---|
GET /openapi/v1/users/me | Required | The username the token belongs to |
GET /openapi/v1/models?owner=<you> (every page) | Required | Listing your models |
GET /openapi/v1/models/{owner}/{name} | Required | Whether a model is private or gated, and its licence |
GET /api/v1/models/{owner}/{name}/repo/files and /repo | Required | The file list with SHA-256, and each file's download |
Least privilege: ModelScope issues tokens at read, write or admin level. A read token is all Safeguard needs.
Token types
| Token type | Works? | Notes |
|---|---|---|
| Read token | Yes (recommended) | |
| Write or admin token | Works, not recommended | Safeguard never writes |
Expiry: rotate the token at least every 90 days.
What we never need: write or admin access, Studio or deployment access, or another person's token.
Step-by-step setup
Create the credential in ModelScope
- Sign in to ModelScope and open your account's Access Token page.
- Create a token with read access and copy it.
Or with the ModelScope SDK
To check the token before you paste it into Safeguard:
modelscope login --token "$MODELSCOPE_API_TOKEN"Connect it in Safeguard
- Open Integrations and click Connect on the ModelScope card.
- For public models, choose Public, enter a Name, paste a model URL, click Add, then Next.
- For your own models, choose Private, enter a Name, paste the token into Access Token and verify it.
- 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 commits, set a schedule under Integrations > Scheduled or rescan by hand from the project.
What we read and store
- Read: your username, your models' names, licences and visibility, each model's file list with SHA-256, and the files of the models you select.
- Pinning: ModelScope documents no branch-to-commit lookup, so a branch is pinned to the newest commit its file list names, and only when that commit lists the same files with the same SHA-256.
- Limits: ModelScope's API lists at most 3,000 models per account and 3,000 files per model; past that Safeguard says so instead of cutting the list silently. Add other models by URL.
- Stored: the connection's settings, the scan results and AI inventory entry of each scanned model, and the token, encrypted at rest and never shown again after you save it.
- Not stored: model files. They are read for the scan and removed.
- No customer data from this integration is sent to third-party LLMs.
Troubleshooting
| Message you see | Cause | Fix |
|---|---|---|
ModelScope refused the ModelScope SDK token | The token was revoked or mistyped | Create a new token and paste it again |
This ModelScope model is private or gated | The model needs a token that can read it | Use Private with a token, after accepting any gating terms on ModelScope |
| A scan says ModelScope is still checking a file | ModelScope's own file check is not finished | Rescan later |
| A scan fails with a file hash mismatch | The download did not match the SHA-256 ModelScope lists | Rescan; if it repeats, the model changed during the download |
Rotation and disconnect
- Rotate: create a new token in ModelScope, find the connection under Project Configurations, choose Update, paste the new token and save, then delete the old token.
- Disconnect: choose Delete from the connection's menu under Project Configurations, then delete the token in ModelScope.
Vendor references
- ModelScope Python SDK (modelscope, modelscope_hub), checked 2026-10-16.
- ModelScope model download guide, checked 2026-10-16.
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.
Amazon SageMaker AI
Connect Amazon SageMaker AI to Safeguard. The exact IAM policy the read-only role needs, which credentials work, and step-by-step setup with CloudFormation, Terraform or the AWS CLI.