Security in Unsloth
Unsloth uses a range of security measures across Unsloth Studio and Unsloth Desktop to help protect/safeguard users. Key safeguards are outlined below.
1. Operating-system sandboxes
Unsloth uses bubblewrap on Linux, Seatbelt on macOS, and MXC on Windows. See Sandboxing in Unsloth for more details

2. Hugging Face repository security scanners
All Hugging Face repositories are scanned. Reverse shells, cloud-metadata access, and credential theft are blocked outright. For example, deepseek-ai/deepseek-ocr and moonshotai/Kimi-VL-A3B-Instruct both need permission before running trust_remote_code = True:


We removed eval calls and other problematic code sections and provide unsloth/DeepSeek-OCR and unsloth/DeepSeek-OCR-2, for example:

3. Malware scanners
Unsloth checks Hugging Face's security-scan status for a model. For example, mcpotato/42-eicar-street is blocked from loading and shows why:

4. Failed-login limits
Unsloth limits failed login attempts.

5. HTTPS remote access
unsloth studio --secure serves an HTTPS-only endpoint through a Cloudflared tunnel.
The remote-access guide distinguishes this from starting a tunnel on an already-running wildcard-bound server: the latter can leave the raw network port reachable.
The guide also warns that server-side tools run as your user, and that an API-key holder with network access can execute code on the machine. It recommends --disable-tools when exposing Unsloth. Keep access credentials private and review the full guide before enabling remote access. HTTPS encrypts the connection; it does not make privileged tool access harmless.
6. Passwords
Passwords use salted PBKDF2-HMAC-SHA256. The first-run administrator password is randomly generated, and the account must change it on first login.

7. Encrypted API keys
Saved provider credentials are encrypted. API keys typed into the browser are encrypted with a per-install RSA key.
8. Multi-account isolation
Managed accounts can only reach their own folders, have no access to the owner's Hugging Face token, need the owner's grant to use models, and are blocked from running repository code.

9. Sandboxed artifacts
HTML and MCP artifacts render in sandboxed frames with their own Content Security Policy (CSP).
10. PyTorch model loading
The PyTorch 2.6+ minimum means that .bin weights load with weights_only=True.
11. Approval modes
Unsloth provides ask, auto, and full approval modes. The auto mode flags network and filesystem imports for approval, and file paths need approval. Dangerous shell commands are blocked.

12. npm minimum release age
The npm setting min-release-age=7 refuses packages published in the last seven days.
13. Installation-script allowlist
An allowScripts list specifies the only packages allowed to run installation scripts. CI fails on anything unreviewed.
14. Codex Security and iterative reviews
Codex Security and iterative Codex reviews are used throughout development to catch security issues and bugs:

15. Lockfiles and reproducible npm installation
Lockfiles and npm ci are used everywhere, and the installer upgrades users to npm 11 or newer.
16. CI hardening
lockfile_supply_chain_audit.py refuses lockfiles that show signs of Shai-Hulud-style injection before any npm ci or cargo fetch.
scan_npm_packages.py and scan_packages.py scan npm tarballs and PyPI packages, including credential reads inside installation scripts.
Code linters guard against unsafe loaders and dynamic execution, with baselines. The compiled-code path also has a dynamic-execution allowlist.
17. Dependency audits
Unsloth uses pip-audit, npm audit including signature checks, and cargo audit.
18. Code analysis and dependency-update cooldowns
Unsloth uses CodeQL and Semgrep, alongside Dependabot with three- to seven-day cooldowns.
19. Pinned GitHub Actions
GitHub Actions are pinned to commit SHAs, with none on mutable tags.
20. llama.cpp release verification
Prebuilt llama.cpp binaries are checked against release SHA-256 digests. A separate workflow audits Windows llama.cpp signatures.
21. VirusTotal release scanning
All Desktop releases are scanned with VirusTotal.

Using these controls
Security checks reduce risk; they do not establish that a model, dependency, code snippet, or release artifact is safe in every situation. Review code-execution requests carefully, keep Unsloth and its dependencies up to date, and use the least permissive approval mode that meets your needs. Screenshots show specific examples; scan outcomes apply to the files or commits shown.
Last updated
Was this helpful?

