Home / Guides / Troubleshooting / Windows

SmartScreen and antivirus are blocking your local AI install

Windows

Written by Jakub Rusinowski · Last updated September 1, 2026

Founder, LLM Configurator — AI educator & workshop leader on local LLM deployment

The error

Windows protected your PC
Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.

This app has been blocked for your protection.

Which one is it?

If you seeThe cause isGo to
"Windows protected your PC" on a downloaded installerSmartScreen does not recognise the publisher — most open-source AI tools are unsignedFix 2: verify it, then More info → Run anyway
A multi-gigabyte .gguf disappears from Downloads mid-writeReal-time protection quarantined it during the scanFix 3: add a folder exclusion for the model store only
Model downloads crawl and the disk is busy but the network is notDefender is scanning every block as it is writtenFix 3 — same fix, different symptom
"This app has been blocked for your protection"A policy block, not SmartScreen — often a work-managed deviceFix 5: this is your IT department, not a setting
The file downloaded but the app will not launch itThe Mark-of-the-Web attribute is still on the fileFix 2: Properties → Unblock

When you see it

Two different security systems are involved and conflating them is why people fail to fix this. One stops installers from running. The other silently eats model files. They have different causes, different fixes, and very different risk profiles.

What's actually going on

SmartScreen gates unrecognised *applications* by reputation. It is not scanning for malware: it is asking whether this exact binary, signed by this publisher, has been seen enough times to be trusted. Most local-AI tooling is small open-source projects without an expensive code-signing certificate, and a fresh release of even a well-known project starts with no reputation at all — so it trips the warning legitimately, and will keep tripping it after every release. Real-time protection is a separate system that scans every file as it is written. A 20–40 GB model file being streamed to disk means sustained scanning of a very large opaque binary, which both slows the download considerably and occasionally results in the file being quarantined. Same vendor, same Security app, entirely different mechanisms — and a fix for one does nothing for the other.

How to fix it

1. Verify what you have before you bypass anything

Do this first, every time. Download only from the project's official domain — not a search result, not a mirror, not a link in a forum reply. Compare the SHA-256 against the checksum the project publishes, where it publishes one. Check the digital signature in the file's properties: some projects are signed even when SmartScreen has not yet accrued reputation for them, and a valid signature from the expected publisher is strong evidence. If any of these fails, stop — do not proceed to the rest of this page.

⚠️ Every remaining fix on this page weakens a protection that exists for good reason. They are safe for a binary you have verified and reckless for one you have not. If you cannot verify the file, the correct action is to not run it.

PowerShell
# PowerShell — hash it and compare against the published value
Get-FileHash .\OllamaSetup.exe -Algorithm SHA256

# Is it signed, and by whom?
Get-AuthenticodeSignature .\OllamaSetup.exe |
  Select-Object Status, SignerCertificate
Did it work? The hash matches the project's published checksum character for character, and the signature Status reads Valid with a signer you recognise (or the project is openly unsigned and you obtained it from its own domain).

2. Clear the block on that one file — the narrowest fix

For a single verified installer there are two narrow options and you should use one of them rather than anything broader. In the SmartScreen dialog, click More info → Run anyway, which affects that one launch. Or right-click the file → Properties → tick UnblockOK, which removes the Mark-of-the-Web from that single file and nothing else. Unblock-File is the PowerShell equivalent. Neither changes any setting; both are scoped to one file.

PowerShell
# PowerShell — remove Mark-of-the-Web from ONE verified file
Unblock-File .\OllamaSetup.exe

# Confirm the zone marker is gone
Get-Item .\OllamaSetup.exe -Stream * | Select-Object Stream
Did it work? The stream list no longer includes Zone.Identifier, and the installer launches without the SmartScreen dialog.
Get-Item .\OllamaSetup.exe -Stream Zone.Identifier -ErrorAction SilentlyContinue

3. Exclude the model directory — that directory only

For the vanishing-and-slow-download problem, add a Defender folder exclusion for your model store: Settings → Privacy & security → Windows Security → Virus & threat protection → Manage settings → Exclusions → Add an exclusion → Folder. Point it at the models directory and nothing else. Not the whole drive. Not your user profile. Not C:\. The store is a well-defined location holding large opaque blobs that scanning cannot meaningfully assess, which is exactly the case exclusions exist for — and it stays that way only if the exclusion stays narrow.

⚠️ An exclusion means Defender stops inspecting anything written into that path, including anything a compromised tool writes there later. Keep it to the model directory, and remove it if you stop using that directory.

PowerShell
# PowerShell as Administrator — the model store only
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.ollama\models"

# Review what is excluded, and remove one when you are done with it
(Get-MpPreference).ExclusionPath
Remove-MpPreference -ExclusionPath "$env:USERPROFILE\.ollama\models"
Did it work? The exclusion list contains your model path and nothing broader. Pull a model and confirm it completes and stays on disk.
ollama pull gemma3:1b
ollama list

4. Recover a file that was already quarantined

If a download vanished, it may be in quarantine rather than deleted. Windows Security → Virus & threat protection → Protection history lists recent actions and offers restore. Restore it only if the detection was on a model file you obtained from a source you have verified — a genuine detection on an executable is not something to override. Add the folder exclusion afterwards so the same download does not disappear again.

PowerShell
# PowerShell as Administrator — what has been detected recently?
Get-MpThreatDetection | Select-Object -Last 5 ActionSuccess, InitialDetectionTime, Resources

5. Never disable SmartScreen or real-time protection globally Most common fix

This is the advice you will find on other sites and we do not recommend it. Turning off SmartScreen or real-time protection system-wide to install one program trades a five-second dialog for permanently reduced protection on the whole machine — and people never turn it back on. Everything above achieves the same outcome with a blast radius of one file or one folder. If a block message names your organisation rather than SmartScreen, it is a managed-device policy: your IT department can allow the application, and working around a policy block on a work machine is not a technical problem.

Check what fits your hardware — pick a model sized for your machine so downloads stay small
Open the VRAM checker →

6. Reduce how much you are asking security software to swallow

Some of this is self-inflicted. Each 20–40 GB file is a large, slow, opaque write that antivirus must chew through, and most of those files turn out to be models too big for the machine's VRAM anyway. Pulling a model matched to your hardware means smaller downloads, faster scans, less quarantine surface, and fewer exclusions to maintain.

If none of this worked

If the installer now runs and the terminal still cannot find the command, that is a PATH problem rather than a security one. If model files keep filling the drive after this, moving the store is the next step — and remember an exclusion follows the path, so a moved store needs its exclusion moved too.

Include this when you report it

Related

A model that fits most setups:
View model & requirements →

Frequently asked questions

Why does SmartScreen block Ollama or LM Studio if they are legitimate?

SmartScreen judges reputation, not content. An installer that is unsigned, or signed by a publisher it has not seen often, gets the warning regardless of whether the software is safe. New releases of well-known projects trip it routinely until enough people have run them.

Is it safe to click "Run anyway"?

Only after you have verified the file: downloaded from the project's own domain, hash matching the published checksum, and a signature you recognise where one exists. With those checks done it is reasonable. Without them you are running an unverified binary with full user rights.

My GGUF download vanished. Where did it go?

Most likely into Defender quarantine during the write. Check Windows Security → Virus & threat protection → Protection history, restore it if the source is one you trust, and add a folder exclusion for the model directory so the next download is not scanned block by block.

Should I exclude my whole models drive from scanning?

No. Exclude the model directory specifically. A drive-wide or profile-wide exclusion stops Defender inspecting everything written anywhere under it, which is a far larger hole than the problem you are solving and one you will forget you opened.

The block says my organisation prevented it. Can I get around that?

Not with a setting, and you should not try. That is a managed-device policy rather than SmartScreen, and it is enforced above your account. Ask IT to allow the specific application — most will for a mainstream tool with a business case.