How safe is your local AI? Six weak spots, explained simply
Local AI apps like Ollama and LM Studio feel private: the model runs on your own machine. But "local" isn't the same as "safe". Ollama has no login. Researchers have found 175,108 Ollama servers open to the whole internet, and old versions have published holes. And for 32 of 43 popular models in Ollama's library, the text the model reads when it uses tools isn't the text its maker designed. This page explains all six weak spots in plain words: what each means if you simply use AI, what it means if you build with AI, how to check it, and what to do.
This started from Kai's video Your Local AI Is Not as Private as You Think (October 2026). I followed its leads back to the original sources, read Ollama's code myself, and measured what the model actually reads. What's mine and what's the video's.
The short version
If you just use AI on your computer
- Running AI locally keeps your chats off other companies’ computers. It doesn’t make your setup safe by itself.
- Three things to do today:
- Make sure your AI app only accepts connections from your own computer (weak spot 1).
- Update Ollama (weak spot 2).
- Keep passwords and keys out of any folder an AI helper can read (weak spot 5).
- The free check-up tells you where you stand in about ten minutes. It changes nothing and sends nothing anywhere.
If you build with AI
- The prompt your model reads can differ from the one its maker trained it on, even when you
change nothing. In Ollama’s library this held for 32 of 43 models on the tool conversations I
tested. For
qwen2.5, it cost 45 of 1,240 answers on a tool benchmark (tool test). - Compare the rendered prompt, not the template file.
- Treat a model’s template as code that comes with the model, and the folders your agent can read as its blast radius.
How a local AI setup works
When you run an AI model on your own computer with an app like Ollama or LM Studio, these parts work together. The numbers mark the six weak spots described below.
The layout instructions inside the model file are called the chat template. Unfamiliar words are explained at the end of the page.
Each part can go wrong in its own way. Here’s each one.
1 The app answers anyone who can reach it
In one line: Ollama has no login. Whoever can connect to it can use your models, change them, and use your ollama.com account.
Ollama runs a small server on your computer: a program that waits for other programs to send it messages. It has no login. Anyone who can connect to it can do everything you can: chat with your models, download new ones, delete them, or create a new model with its own instructions. These are ordinary features, listed in Ollama’s own code (routes.go).
What keeps you safe is the address it listens on. Out of the box, Ollama only accepts connections
from your own computer, through the special address 127.0.0.1
(config.go). One setting,
OLLAMA_HOST, changes that. People often change it on purpose so they can use their model from a
phone or a second computer. LM Studio has a switch for the same thing, called
Serve on Local Network. Once either is on, everyone on the same Wi-Fi can use your AI. If your
router forwards Ollama’s connection point (its “port”) to the internet, everyone online can too.
What I found in Ollama’s code. I read the server code of Ollama 0.40.7 to see exactly what an open port gives away:
- There is no login to turn on. Ollama has a setting called
OLLAMA_AUTH, but it only makes the Ollama command-line program sign the requests it sends (client.go). The server never asks for it. - Its protection against websites switches off. Ollama checks which address each request was
sent to, which blocks a known trick where a web page quietly talks to your Ollama (“DNS
rebinding”). The code runs this check only while Ollama listens on
127.0.0.1(routes.go). Open it to the network and the check is skipped. - Your ollama.com account comes with it. If Ollama is signed in to an ollama.com account (for cloud models or web search), it forwards some requests to ollama.com signed with your computer’s own key, whoever sent them (cloud_proxy.go). Anyone who can reach it can read the account’s name, email and plan, see its usage and balance, run cloud models and web searches on it, and sign your computer out.
- Which websites may talk to it is one setting. By default, only pages served from your own
computer and a few kinds of app can read Ollama’s answers in a browser. Each address added to
OLLAMA_ORIGINSlets that website do the same (config.go).
What researchers found. This isn’t rare. Three separate studies counted Ollama servers anyone on the internet could use (SentinelLABS and Censys, Cisco, Xu and others, IMC 2026):
If you just use AI: think of it as leaving your front door open. On home Wi-Fi the risk is the people and devices on your network. On café, hostel or office Wi-Fi, it’s strangers.
If you build with AI: a reachable Ollama is an unauthenticated API that can pull, push, copy
and delete models and create new ones with any system prompt, and a signed-in server lends out its
ollama.com account. Put an authenticating proxy in front of a shared server, keep the port itself
on 127.0.0.1, and keep OLLAMA_ORIGINS to the exact sites that need it.
How to tell: the check-up looks at the addresses your AI apps are listening on, and at the
OLLAMA_HOST setting, and tells you if anything other than your own computer can connect. By hand:
on Windows run netstat -ano | findstr 11434, on a Mac or Linux lsof -nP -iTCP:11434 -sTCP:LISTEN.
127.0.0.1:11434 is good; 0.0.0.0:11434, [::]:11434 or *:11434 means other devices can connect.
What to do: delete OLLAMA_HOST or set it to 127.0.0.1, then restart Ollama. In LM Studio,
turn off Serve on Local Network. If you don’t use Ollama’s cloud models, set OLLAMA_NO_CLOUD
to 1, so the server never acts for your ollama.com account.
For engineers: where this is in the code
server/routes.go: the only middleware is CORS andallowedHostsMiddleware. The Host check returns early when the listener isn’t a loopback address, so DNS-rebinding protection only exists on127.0.0.1.- Routes on the same listener include
/api/chat,/api/generate,/api/pull,/api/push,/api/create,/api/copy,/api/deleteand/api/blobs/:digest, plus the account routes/api/meand/api/signoutand the experimental web search and fetch. server/cloud_proxy.go: requests for cloud models are signed with the machine’s key before they’re forwarded.OLLAMA_NO_CLOUD=1, ordisable_ollama_cloudin~/.ollama/server.json, turns the proxy off.envconfig/config.go:OLLAMA_AUTHis read only by the client inapi/client.go. The default allowed origins arelocalhost,127.0.0.1and0.0.0.0on any port, plusapp://,file://,tauri://,vscode-webview://andvscode-file://.
2 Older versions have known holes
In one line: Ollama has fixed several serious holes, most of them reached through the same open API, and many servers never get the fix.
Ollama is updated often, and some updates fix security holes. Each published hole gets an ID that starts with “CVE”, and once it’s published anyone can look up how it works.
The two most serious, in plain words:
- Probllama (CVE-2024-37032, fixed in 0.1.34). A request to download a model from a server someone else controls could write files anywhere on the computer, and from there take it over (Wiz).
- Bleeding Llama (CVE-2026-7482, fixed in 0.17.1). Sending a specially built model file made Ollama read memory it shouldn’t, which can hold keys and chats (Cyera, advisory). It uses the “create a model” request from point 1, so it needs only an Ollama that others can reach.
And updates don’t happen by themselves on servers. A year-long study of open Ollama servers (Xu and others, IMC 2026) found that, depending on the hole, only 0.43% to 2.90% of servers running a version with that hole were updated in place.
The newest Ollama when this was written is 0.40.8, released on 21 October 2026.
If you just use AI: it’s the same as updating your phone. Old versions have holes that are public knowledge.
If you build with AI: pin the Ollama version in your setup scripts and images, track its advisories like any other dependency, and rebuild when a fix lands. Most of these holes need network access to the API, so closing point 1 also shrinks this one.
How to tell: run ollama --version. The check-up asks your running Ollama for its version and
tells you if it’s older than these fixes. What to do: install the latest Ollama from
ollama.com over the old one. Your models stay where they are.
For engineers: the advisories
| Fixed in | Released | CVE | What it is |
|---|---|---|---|
| 0.1.34 | 7 May 2024 | CVE-2024-37032 | Path traversal through a model digest in /api/pull, leading to remote code execution (Wiz) |
| 0.1.46 | 22 Jun 2024 | CVE-2024-39720, 39722 | An out-of-bounds read that crashes the server through /api/create, and a file-existence leak through /api/push (Oligo). Oligo also reported CVE-2024-39721, fixed in 0.1.34, and CVE-2024-39719, listed for versions through 0.3.14 |
| 0.1.47 | 27 Jun 2024 | CVE-2024-45436 | ZIP extraction writes outside the target folder |
| 0.17.1 | 24 Feb 2026 | CVE-2026-7482 | Heap out-of-bounds read through /api/create, CVSS 9.1 (Cyera) |
| 0.23.3 | 12 May 2026 | CVE-2026-42248, 42249 | Windows updater didn’t verify updates; 0.12.10 to 0.17.5 confirmed affected (release notes) |
3 A model file carries more than the model
A model file isn’t only the trained model. It also carries the chat template, which is a small program, plus default settings. Whoever packages the file decides what goes in them, and you never see them unless you go looking.
What I found myself. My measurement turned up two everyday examples:
- Outdated copies. In 9 of 45 model files in Ollama’s library, the template inside is an
older version of the maker’s. For example,
falcon3’s file matches the maker’s template from 17 December 2024. The next day, the maker published a change called “fix chat_template for tool use”. The file was simply made before it. - Rewritten instructions. On Hugging Face, the largest public website for sharing AI models, anyone can upload. Two popular custom models there replace the maker’s instructions for using tools with their own wording. They also add a standing instruction about how to answer.
Neither is an attack. But they show that the instructions travelling with a model can change between its maker and your computer, and others have shown that a tampered one can be an attack (see “If you build with AI” below).
If you just use AI: where you download a model from matters. The maker’s official release or Ollama’s own library is the safer default, especially for a model that can use tools.
If you build with AI: a template is code from the same source as the weights. A malicious one was enough for remote code execution in llama-cpp-python (CVE-2024-34359), and a tampered one can plant a hidden backdoor that passes a hub’s automated scans (Pillar Security, 2026). Render templates only in a sandbox. When one differs from the maker’s, check the maker’s history first: here, the usual reason was an older version.
How to tell: the check-up lists where each of your models came from: Ollama’s own library, or
a named uploader on Hugging Face. It also reads each template for two unusual things: a web
address, or a rule that reacts when you type particular words. I tested that warning on 95 real
templates. It went off for 3, and all 3 turned out to be ordinary, visible features. So it’s rare,
and worth a look when it happens. What to do: if you didn’t expect it, remove the model
(ollama rm <name>) and get it from the maker’s official source.
4 The layout step can change what the model reads
This is the weak spot I measured, because I couldn’t find anyone who had counted it.
A model learns to read conversations laid out in one exact way: who is speaking, where instructions go, how a tool is described, how a tool’s answer comes back. Its maker publishes the chat template that produces that layout. If the app lays the conversation out differently, the model is reading something it wasn’t trained on. It’s like being handed a familiar form where the boxes have moved.
Does that matter? Researchers have shown that formatting alone, such as which separators and
spaces a prompt uses, can move a model’s accuracy by up to 76 percentage points on some tasks
(Sclar and others, ICLR 2024). That study used a different
kind of prompt, so I tested it directly on one model. Given the maker’s layout instead of
Ollama’s, qwen2.5 answered 45 more of 1,240 tool questions correctly: 87.0% instead of 83.4%
(the tool test).
qwen2.5, describing a weather tool. Copied exactly from the measurement.{"type": "function", "function": {"name": "get_weather", "description": "Current weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string", "description": "City name"}, "unit": {"type": "string", "enum": ["c", "f"]}}, "required": ["city"]}}}Neat JSON: every part is named ("name", "description", "parameters").
{"type": "function", "function": {get_weather Current weather for a city {object <nil> <nil> [city] {"city":{"type":"string","description":"City name"},"unit":{"type":"string","enum":["c","f"]}}}}}The names are gone, and placeholders like <nil> (Go for "empty") appear in their place.
What I measured, step by step
A model’s chat template is copied twice on its way to the model: into the model file, and then often into Ollama’s own version. The measurement compares all three.
- I picked the models: the 50 most popular chat models in Ollama’s library and the 30 most downloaded chat models on Hugging Face, as they were on 22 October 2026.
- I set some aside. For example, some makers never published a template, so there’s nothing to compare against, and five Hugging Face files couldn’t be read at all. That left 65 models: 43 from Ollama’s library and 22 from Hugging Face. The results page lists every model left out and why.
- I wrote twelve harmless practice conversations. Six of them use tools: a tool list, a tool request and its answer, two requests at once, and so on.
- I turned each conversation into the text the model reads, three ways, and compared each with the maker’s:
- I sorted each difference by kind: a tool's answer missing, an instruction added or dropped, tools written in another format, and so on. Changes to spaces, line breaks or the date don't count.
For 41 of the 45 library model files I read, the Ollama step runs Ollama’s own code, so nothing
is guessed. For three others, and for the Hugging Face models, it’s a close copy written in Python.
The last one, gpt-oss, uses a separate format of Ollama’s that this study doesn’t reproduce, so
it isn’t scored. Nor is translategemma, whose maker’s template can’t show a tool conversation.
That leaves 43.
All of it ran on my local setup with no GPU and no model downloads: the tool reads only the small
header of each model file (7.3 MB of a multi-gigabyte file for qwen2.5).
How it works explains the method and how it was checked.
What I found
In Ollama’s library, 32 of 43 models read their tool conversations differently from what their maker designed. “Differently” means a change to what the model is told: a tool’s answer missing, an instruction added or dropped, tools described in another format.
In four of the 32, the only change is the order of the fields in a tool’s description. That’s the mildest kind, so here’s the count without them: 28 of 43.
Some of these models weren’t built for tools at all. Counting only the 19 whose maker’s template does show the model a list of tools: 15 of 19 differ, or 11 of 19 without the order-only cases.
The full list, with what changes for each model, is on the results page.
Most differences come from Ollama’s own version of the template. In 24 of the 32, the copy inside the model file gives the same conversations as the maker’s, apart from harmless spacing. In 6, the model file already holds an older copy of the maker’s template, and Ollama’s version changes it further. In 2, the model file has no template of its own to compare.
Counted from the three versions of each model's text: maker's, model file's, and Ollama's.
Each model counts once per kind of change, across the six tool conversations.
Hugging Face downloads fare better. For all 22 measured here, Ollama used the template inside the file instead of its own. Only 5 differ, and in all 5 the difference is already in the uploaded file. Ollama adds no meaningful change of its own.
A template that looks different can still be fine. In 7 of the Hugging Face models, the template text differs from the maker’s, yet all twelve conversations came out exactly the same. Reading templates side by side doesn’t tell you much. Comparing the text the model actually receives does.
One model, step by step: qwen2.5
qwen2.5 is the fourth most popular chat model in Ollama’s library.
- The model file holds an outdated template. It matches the maker’s template as it was on 18 September 2024. The maker updated it the next day.
- Ollama’s version describes tools in the wrong format, as the figure above shows. The model
was trained on JSON. It gets the internal format of Go, the programming language Ollama is
written in. This is already reported to Ollama
(issue #14601), and fixes have been proposed.
The measurement shows how far it reaches: 4 of the 43 library models (
qwen2,qwen2.5,qwen2.5-coderandqwen3). - A popular Hugging Face copy loses a default instruction. In an earlier test of bartowski’s widely used copy of this model, the template inside the file matched the maker’s exactly. But Hugging Face supplies its own Ollama-style template for it, and Ollama uses that one. It leaves out the short default instruction the maker’s template adds when you don’t write one yourself.
- And the layout changes its answers. On 1,240 tool questions from a public benchmark, the same model on the same server got 1,034 right with Ollama’s layout and 1,079 with the maker’s. The biggest gap: with Ollama’s layout it more often called a tool when none fitted the question. Read the tool test.
If you just use AI: if a local model is clumsy with tools, the layout may be part of the reason, not only the model. The results page shows which models came out with no difference at all.
If you build with AI: run ollama show --modelfile <model> to see the package’s template; on
0.40.7 or newer, /api/show also reports template_source. Diff rendered prompts, not template
files. Pin the reference in time: the original as of when? If you depend on tool calling, test it
on the exact package you ship, and set your own TEMPLATE in a Modelfile when the shipped one
drifts.
How to tell: the full comparison needs a few more tools and is described in How it works. The quick check-up covers the parts you can act on: where your models came from, and whether their templates have warning signs.
5 Helpers turn the model’s words into actions
On its own, a model only writes text. Once you connect a helper that can read files, run commands or browse, its text becomes actions on your computer. Two things can then go wrong:
- The model makes a mistake. The layout problems in point 4 make that more likely. In the tool test, qwen2.5 with Ollama’s layout called a tool when none fitted the question 93 times out of 240, against 78 with its maker’s layout.
- The model is misled by what it reads. A web page, an email or a file can contain text written to give the AI orders. The model can’t reliably tell those apart from yours. This is called prompt injection. OWASP, a long-standing security community, lists it as the number one risk for AI applications (OWASP LLM01:2025).
Either way, what the helper can reach is what’s at risk. Project folders often hold a file called
.env with passwords and keys in it, or a private key for logging in to servers.
If you just use AI: only point an AI helper at the folder it needs, and read what it plans to do before you let it run commands.
If you build with AI: treat everything the model reads (pages, files, tool results) as untrusted input. Give each agent the least access that works, keep secrets in a secret store rather than the working folder, and ask for approval before actions that are hard to undo.
How to tell: point the check-up at the folder your helper works in. It lists any file whose name suggests it holds a secret. It reads only the names, never the contents. What to do: move those files out, or give the helper its own folder with only what it needs.
6 Your chats are kept as ordinary files
“Local” means your conversations stay on your computer. It also means they sit on your disk, where anything that can read your files can read them too. What I found myself, going through Ollama’s code and LM Studio’s documentation:
- Ollama in a terminal (a window where you type commands) keeps the last 100 lines you typed
in a file called
.ollama/historyin your home folder, unless you setOLLAMA_NOHISTORY(history.go). - The Ollama desktop app keeps its chats in a database file in its app folder (app_state.go).
- LM Studio keeps each chat as a file in
.lmstudio/conversationsin your home folder (LM Studio docs). - A debugging setting in Ollama,
OLLAMA_DEBUG_LOG_REQUESTS, writes the full text of every request to your temp folder (config.go). It’s off unless someone turns it on.
None of this is a fault. But backup and sync tools copy these files like any others, and anyone who uses your account can open them.
If you just use AI: treat your AI chats like any other private document on your computer.
If you build with AI: request logging helps while you debug and leaks afterwards. Turn it off when you’re done, and keep chat folders out of shared drives and sync.
How to tell: the check-up lists where your chats are saved and how big those files are,
without opening them. It warns you if the debugging setting is on. What to do: delete old
chats you don’t need, and set OLLAMA_NOHISTORY to 1 to stop the terminal history.
Your safety checklist
Tick these off once. Each links back to its weak spot.
- Ollama listens only on
127.0.0.1, and LM Studio's Serve on Local Network is off (1) OLLAMA_NO_CLOUDis1, unless you use Ollama's cloud models (1)OLLAMA_ORIGINSis empty, or lists only sites you trust (1)- Ollama is 0.40.8 or newer (2)
- Models that use tools come from the maker or Ollama's library (3)
- If you build with tool calling, you've tested it on the exact model you ship (4)
- No
.envfiles or private keys in folders an AI helper can read (5) OLLAMA_NOHISTORYis1andOLLAMA_DEBUG_LOG_REQUESTSis off (6)
Run the check-up
The check-up looks at all of this on your own computer in about ten minutes. It needs Python and nothing else. It changes nothing and sends nothing anywhere.
What this shows, and what comes next
- A clean check-up looks for known warning signs. It can’t prove a model or an app is trustworthy.
- A different layout changes what the model does. For
qwen2.5, the maker’s layout gave 3 to 4 more correct tool answers in every 100, whichever program read the replies (the tool test). Next: the same test on more models, and on conversations with several turns. - The measurement is a snapshot. It covers the most popular models on 22 October 2026, as they were that day, with Ollama 0.40.7. The exposure counts come from other researchers’ scans, with their own methods and dates.
- Some parts are close copies, not Ollama’s own code. For the Hugging Face models, and for three library models, Ollama fills in the template with a separate engine. I reproduced that engine’s behaviour in Python. It’s very close, but not byte-for-byte Ollama.
- Practice conversations have limits. Mistral’s own template, for example, rejects the made-up tool request numbers my practice conversations use, so a few of its comparisons couldn’t run. The results page lists every gap like this.
Credits
Kai’s video Your Local AI Is Not as Private as You Think (@kaiexplainsYT, October 2026) gave me the starting point. It covers weak spots 1, 2, 3 and 5 from the security side, and is worth watching. For those, this page goes back to the original advisories and research. The rest is my own work: reading Ollama’s code for what an open port exposes (weak spot 1), the measurement of 65 models (weak spot 4), the evidence on old and rewritten templates (weak spot 3), where chats are saved (weak spot 6), the tool test, and the check-up.
Words used on this page
- Model
- The trained AI itself: a large file of numbers that turns text into more text.
- Ollama, LM Studio
- Free apps that download models and run them on your own computer.
- Hugging Face
- The largest public website for sharing AI models. Anyone can upload.
- Chat template
- The small set of layout instructions that turns a conversation into the one block of text a model reads.
- Tool
- Something a model can ask to use, such as a calculator, a file reader or a web search.
- Server, port
- A program that waits for messages from other programs, and the numbered door it listens on (Ollama's is 11434).
127.0.0.1- The address that means "this computer only".
- JSON
- A standard, widely used way of writing data so that programs and models can read it.
- CVE
- The ID given to a published security problem, so everyone can refer to the same one.
- Prompt injection
- Text hidden in a page, email or file that tries to give an AI orders.
- Terminal
- A window where you type commands instead of clicking.
- Modelfile
- Ollama's recipe file for a model. Its
TEMPLATEline sets the chat template.
Sources
- Kai, Your Local AI Is Not as Private as You Think, YouTube, October 2026.
- Ollama source code, version 0.40.7:
server/routes.go,server/cloud_proxy.go,envconfig/config.go,api/client.go,readline/history.go,server/inference_request_log.go,internal/onboarding/app_state.go. - Ollama release notes for 0.1.34, 0.1.46, 0.1.47, 0.17.1, 0.23.3 and 0.40.8, and issue #14601.
- GitHub Advisory Database and the US National Vulnerability Database: CVE-2024-37032, CVE-2024-39719 to CVE-2024-39722, CVE-2024-45436, CVE-2026-7482, CVE-2026-42248, CVE-2026-42249, CVE-2024-34359.
- Wiz Research, Probllama: Ollama Remote Code Execution Vulnerability, 2024.
- Oligo Security, More Models, More ProbLLMs, 2024.
- Cyera, Bleeding Llama: Critical Unauthenticated Memory Leak in Ollama, May 2026.
- SentinelLABS and Censys, Silent Brothers: Ollama Hosts Form Anonymous AI Network, January 2026.
- Cisco, Detecting Exposed LLM Servers: A Shodan Case Study on Ollama, September 2025.
- Xu and others, Ollama in the Wild, IMC 2026.
- A. Fogel and O. Hofman, chat template backdoors across 18 models and 4 engines, Pillar Security, 10 February 2026.
- LM Studio documentation, “Manage chats”.
- OWASP Top 10 for LLM Applications 2025, LLM01: Prompt Injection.
- Sclar, Choi, Tsvetkov and Suhr, “Quantifying Language Models’ Sensitivity to Spurious Features in Prompt Design”, ICLR 2024.
- This project’s measurement runs of 22 October 2026, published with the code on GitHub.