More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    ML Model Loading Safety Check

    1

    This skill finds those and eight other model-loading mistakes in your Python code and notebooks before they run, and tells you how to fix each one.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    ML Model Loading Safety Check

    ML Model Loading Safety Check

    Example session with this skill installed

    Check this project with ml-model-loading-safety-check.

    • Read your context and instructions
    • Compiled the ml model loading

    $ python3 scripts/check_model_loading.py examples/risky
    BLOCK service/models.py:10 M04 HF_TOKEN_IN_CODE
    HF_TOKEN = "<redacted>"
    Why: A Hugging Face access token (hf_...) is written in the code or notebook, or passed as a literal token= to a Hub call. Anyone who can read the repository, the notebook or its history can read or write your private models and datasets until the token is revoked.
    Safer: Revoke the token in your Hugging Face settings, then let the library read a new one from the HF_TOKEN environment variable or the hf auth login cache (no token argument, or token=True).

    BLOCK service/models.py:16 M03 MODEL_OVER_PLAIN_HTTP
    BLOCK service/models.py:17 M01 UNSAFE_LOAD_OF_DOWNLOAD
    BLOCK service/models.py:20 M01 UNSAFE_LOAD_OF_DOWNLOAD
    BLOCK service/models.py:22 M02 REMOTE_CODE_NOT_PINNED
    BLOCK service/models.py:23 M02 REMOTE_CODE_NOT_PINNED
    REVIEW requirements.txt:4 M15 TORCH_TOO_OLD_FOR_SAFE_LOAD
    REVIEW service/models.py:14 M16 UNSAFE_LOADING_TURNED_ON_GLOBALLY
    REVIEW service/models.py:19 M12 HUB_DOWNLOAD_NOT_PINNED
    REVIEW service/models.py:24 M12 HUB_DOWNLOAD_NOT_PINNED
    REVIEW service/models.py:24 M13 SAFETENSORS_TURNED_OFF
    REVIEW service/models.py:26 M11 UNSAFE_LOAD_OF_LOCAL_FILE
    REVIEW service/models.py:27 M14 TORCH_HUB_NOT_PINNED

    (Each finding also has Why and Safer lines, as in the first one.)
    Verdict: BLOCK. Checked 2 files, 1 with ML model loading content.
    This is a static check of file text. NOT FLAGGED is not a guarantee.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    torch.load(hf_hub_download(...), weights_only=False) runs whatever code the owner of that repository put in the file, and trust_remote_code=True without a pinned revision runs whatever Python the repository holds on the day you download it. This skill finds those and eight other model-loading mistakes in your Python code and notebooks before they run, and tells you how to fix each one.

    Your agent runs a scanner on .py files and the code cells of Jupyter notebooks (reported at the notebook's own line, including !wget and !curl downloads and %pip install lines). It knows torch.load's defaults (weights_only=True from torch 2.6, full pickle before 2.6 or when a pickle_module is passed) and reads requirements files, pyproject.toml, environment.yml and lock files for the torch version. It follows a download through variables, with blocks, loops and files written from it within each function, tells your own checkpoints and PyTorch's own weight hosts (REVIEW) apart from downloaded or uploaded files (BLOCK), and skips comments and docstrings. It never imports, loads or runs anything. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Tokens and passwords are never printed.

    What it checks

    BLOCK

    • M01: pickle, joblib, pandas.read_pickle, numpy allow_pickle, Keras safe_mode=False or torch.load with weights_only=False on a downloaded or uploaded file
    • M02: trust_remote_code=True without a pinned commit revision
    • M03: model files downloaded over plain http from a host on the internet
    • M04: Hugging Face tokens written in code or notebooks

    REVIEW

    • M11: the same unsafe loaders on files the code does not download itself, or on PyTorch's own weight hosts
    • M12: Hugging Face Hub downloads without a commit hash in revision
    • M13: use_safetensors=False or safe_serialization=False
    • M14: torch.hub.load from an unpinned GitHub branch
    • M15: torch pinned below 2.6 (CVE-2025-32434), in a dependency file or a notebook %pip line, in a project that calls torch.load
    • M16: safe loading turned off for the whole process (TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD, Keras enable_unsafe_deserialization)

    What's included

    • The scanner (Python 3.9+, standard library only)
    • A rules guide with the reason, safer approach and official source for each rule
    • A risky and a safe example model service, and the real report the scanner produces on the risky one

    Limits It reads each file as written: a file counts as downloaded only when the download is visible in the same file. Paths passed in as function arguments, model names from config files, the installed torch version, dataset loading, ONNX, SavedModel and GGUF files, and vulnerabilities in other packages are not checked. Notebooks over 1 MB are listed as not checked. NOT FLAGGED is not a guarantee.

    Static check of Python and notebook text. Data flow across files and function calls, config-driven model names and the installed environment are not followed. NOT FLAGGED is not a guarantee.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Requires

    Python

    Permissions

    Terminal / Shell
    Read Files

    Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example project includes a clearly fake, inert Hugging Face token (hf_NOTREAL...) and example.com hosts for the scanner to find. Nothing is downloaded, loaded or run.

    Listed4 days ago

    What's inside

    Frequently Asked Questions

    No. The script reads local files only and makes no network calls.

    No. It only reports. Your agent changes files only if you ask it to.

    Any agent that supports SKILL.md skills and can run a terminal command, such as Claude Code. It needs Python 3.9 or newer and nothing else.

    No. It reads your Python code, notebooks and dependency files as text. It never imports torch, loads a model file or contacts the Hugging Face Hub.

    BLOCK: fix it before you ship. REVIEW: check it before release. NOT FLAGGED: no rule matched. It is a static check, so NOT FLAGGED is not a guarantee.

    The scanner, a rules guide with the reason and safer approach for every rule, a risky and a safe example ML project, and the real report the scanner prints on the risky example.

    New in Security