Safeguard Docs
Integrations

Kaggle Models

Connect Kaggle Models to Safeguard. The credential each connection needs, which Kaggle keys 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 Kaggle Models card connects Safeguard to models on Kaggle Models. Each model variation (owner, model, framework and variation, such as google/gemma/transformers/2b) is scanned at its current version: Safeguard downloads the files through Kaggle's API, checks each one, runs the model malware scan (unsafe serialization formats, embedded code) and records the model in your AI inventory with its licence. Find the card under Integrations in the AI models group.

Public vs private

PublicPrivate
What you enterA model variation URL, such as https://www.kaggle.com/models/<owner>/<model>/<framework>/<variation>A Name and a Kaggle API token (or a legacy username:key)
Credential neededNoneA Kaggle API token
What you can scanPublic models you add by URLEvery variation of your account's models, private ones included, plus any you add by URL

Supported auth methods

MethodUse it whenNotes
Kaggle API tokenRecommendedSent as Authorization: Bearer, the way the official kaggle CLI sends KAGGLE_API_TOKEN
Legacy API key (kaggle.json)You already use onePaste it as username:key; sent as HTTP Basic, as the CLI does
NonePublic modelsNothing to create

Permissions required

Safeguard only reads. It never creates, updates or deletes a model, a variation or a version.

Kaggle API token or legacy key

What Safeguard calls (Kaggle API, as the official SDK)Required?What Safeguard uses it for
security.OAuthService/IntrospectTokenRequired for an API tokenThe username the token belongs to
models.ModelApiService/ListModels (your account as owner, every page)RequiredListing your models and their variations
models.ModelApiService/GetModel, GetModelInstance, ListModelInstanceVersionFilesRequiredThe version, licence and file list of each variation
models.ModelApiService/DownloadModelInstanceVersionRequiredDownloading each file for the scan

Least privilege: Kaggle's account settings offer no read-only key. Create a key for Safeguard alone and expire or revoke it when you disconnect.

Token types

Key typeWorks?Notes
API token (Kaggle account settings, API Tokens)Yes (recommended)
Legacy API key (kaggle.json with username and key)YesPaste as username:key
A token of another accountOnly for that account's modelsPrivate models must belong to the token's account

Expiry: set an expiry if Kaggle offers one for the token, and rotate it at least every 90 days.

What we never need: write access, competition or dataset publishing rights, or another person's credentials.

Step-by-step setup

Create the credential in Kaggle

  1. Sign in to Kaggle and open Settings from your profile picture.
  2. Under API, create an API token (or a legacy API key, which downloads kaggle.json).
  3. Copy the token, or for a legacy key copy username and key from kaggle.json and join them as username:key.

Or with the Kaggle CLI

To check the credential before you paste it into Safeguard:

export KAGGLE_API_TOKEN="<your token>"
kaggle models list --owner "<your username>"

Connect it in Safeguard

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

Webhooks and triggers

This integration has no webhooks. Each selected variation 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 and their variations, each version's licence and file list, and the files of the variations you select.
  • How files are checked: Kaggle's API publishes no file hash, so each file is checked against the size Kaggle lists and the MD5 (or CRC32C) that Kaggle's storage returns with the download, and Safeguard records the file's SHA-256.
  • 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 seeCauseFix
Kaggle refused the Kaggle API tokenThe token was revoked, expired or mistypedCreate a new token and paste it again
Kaggle shows no public model at this URLThe URL is wrong or the model is privateCheck the URL, or use Private with a token
This is not a Kaggle model URLThe URL is not a model variation pageUse https://www.kaggle.com/models/<owner>/<model>/<framework>/<variation>
A scan fails with a gated or 403 errorThe model needs its licence accepted on KaggleAccept the model's terms on Kaggle with the token's account, then rescan

Rotation and disconnect

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

Vendor references

On this page