Skip to content

Bring Your Own Quota: How Exposed Ollama Servers Spend Their Owners’ Cloud Credits

Sonali TyagiSonali Tyagi· Staff AI Researcher7 min read

Key takeaways

  • Inherited Financial Exposure: A self-hosted AI server authenticated to a paid cloud ecosystem inherits that account’s spending power; exposing the server to the internet effectively makes that credit line public.
  • Credentialless LLMjacking: Threat actors no longer need to exfiltrate static API tokens. Instead, they exploit the exposed instance’s active authentication session to proxy expensive inference requests.
  • Active Internet Scanning: In under four months, we recorded more than 450,000 requests for cloud models from 835 sources, all looking for servers that would run them on someone else’s account.
  • Invisibility to Standard EDR: Because the traffic follows valid API structures, standard endpoint, login, and malware monitoring tools fail to trigger alerts. Security teams must monitor specifically for cloud model tag strings in incoming payload bodies.
  • Immediate Defensive Remediation: Mitigating this risk requires straightforward configuration hardening: enforce strict authentication layers before exposing Ollama ports, and explicitly log out unneeded instances from cloud backends.

Introduction: The Hidden Cost of Self-Hosted AI#

Running open-source AI models locally on your own hardware has become the gold standard for developers, privacy advocates, and cloud architects. Tools like Ollama make it remarkably simple to host LLMs on personal hardware while offering seamless fallback options. If you need a larger, more powerful model, the server can automatically offload the workload to cloud infrastructure.

However, that convenience hides a critical security blind spot. When a self-hosted AI server is signed in to a paid cloud backend and left accessible over the internet, it exposes more than just compute power; it exposes the owner’s wallet.

Without needing to steal a password, crack an API key, or exploit software, unauthorized third parties can route their own heavy AI workloads through exposed local instances. The result is a threat vector in which network exposure directly translates into immediate financial liability.

LLMjacking Without Stolen Credentials#

Traditionally, API credit theft involves an attacker extracting secret keys from environment variables, code repositories, or unencrypted database dumps. Earlier security research, including analysis of exposed LiteLLM gateways in KeyRelay, focused on attackers extracting static API keys from vulnerable proxy endpoints. “Bring Your Own Quota” flips this paradigm: in this attack scenario, the threat actor never needs to possess or steal a key.

Ollama marks its cloud models with a cloud tag (such as glm-5.2:cloud or gpt-oss:120b-cloud). The local server does not run these models itself. When it is signed in to an Ollama account, it passes requests for them to Ollama’s cloud service. The cloud service checks the server’s sign-in, not the client that sent the prompt, and bills the owner’s account. The client only ever talks to the owner’s server on port 11434, which has no login by default. So a signed-in server that is open to the internet will run a cloud model for anyone who asks.

A self-hosted AI server signed in to a paid cloud account carries that account’s spending power. Exposing the server exposes the account.

From a threat-modeling perspective, this represents a fundamental shift. Security teams are trained to audit credential storage and hunt for leaked API tokens. Here, the running server is the key. If the server’s port is exposed, the attached account’s spending power is effectively public.

An Automated Fleet Is Actively Hunting for Open Servers#

Attackers are already looking for these servers at scale. Between July 15 and November 10, 2026, we recorded 452,946 requests for cloud models from 835 different sources.

Internet-wide search engines such as Shodan already list exposed Ollama servers. The observed scanning campaign exhibits several distinct operational traits:

  • Spoofed Client Signatures: Almost all scanning traffic carried a user-agent string corresponding to opencode (an open-source coding agent). However, analysis showed identical scripted probes with pinned version strings across hundreds of IPs, showing that someone copied the identifier onto an automated scanner fleet.
  • Lightweight Verification Probes: The median body size of these initial /api/generate probe requests was just 139 bytes.
  • Targeted Verification Prompts: Scanners send tiny prompts specifically designed to verify whether the server will honor cloud routing before committing heavier workloads. Prompts rotated through short messages, simple riddles, and explicit verification instructions like: “Are you the model named glm-5.2:cloud? Do not lie or roleplay.”

By maintaining lightweight, automated reconnaissance fleets, attackers can continuously index active, billable targets across the internet without spending meaningful capital upfront.

Coding Agents Can Wipe Out Monthly Allowances Far Faster than Probes Do#

While a 139-byte verification probe costs less than a fraction of a cent, responding to threat actors once a server is confirmed open can rapidly exhaust funds.

Ollama Cloud bills per token against a monthly credit allowance - $60 on the Pro plan and $300 on the Max plan, before drawing on any pre-purchased balance. For popular cloud models such as GLM-5.2 and GLM-5.3, rates are $1.40 per million input tokens and $4.40 per million output tokens.

The severe financial risk emerges when automated coding agents are directed at an exposed instance:

Traffic TypeTypical Request Body SizeToken Consumption Profile
Reconnaissance Probes~139 bytesSingle short prompt; minimal token spend.
Coding Agent Sessions4 KB to over 2 MBMassive token spend; resends full files & chat history per prompt.

In the observed dataset, real-world attack traffic captured coding agent sessions using Claude Code’s claude-cli user-agent over Ollama’s Anthropic-compatible endpoint, targeting models such as glm-5.2:cloud, glm-5.3:cloud, and deepseek-v4.1-flash:cloud. This was a small part of the traffic: 16 requests from three IP addresses on four days between late September and early November. It still shows the pattern works.

Coding agents resend the project files and the full conversation with every request, so each request costs more than the last. The largest request we saw was 2.1 MB, roughly 500,000 input tokens, or about $0.70 at GLM-5.2’s input rate. About 80 requests that size would use up a $60 Pro allowance. One agent session left running on an exposed server can do that in an afternoon.

See it in action.

Compounding the operational impact, the Pro plan caps concurrent requests at three. An attacker running concurrent automated sessions can completely lock out the legitimate server owner while draining their monthly balance. The owner’s first automatic warning is an email Ollama sends once 90% of the monthly allowance is used, by which point most of it is gone.

Standard Security Alerts Are Completely Blind to This Attack#

The most alarming aspect of “Bring Your Own Quota” abuse is how invisible it remains to standard defensive monitoring tools.

Because the attacker is simply utilizing an active cloud feature exactly as designed, standard security controls see completely clean traffic:

  • No Login Failures: There is no authentication mechanism enabled on the default endpoint, so no brute-force or failed login alerts fire.
  • No Exploits or Malware: The attack drops no binaries, executes no shell commands, and triggers no CVE signatures.
  • Valid Traffic Structure: Incoming requests are perfectly formatted API calls to endpoints (/api/generate, /api/chat, /v1/messages) that the administrator deliberately exposed.
The abuse produces no failed logins, because there is no login… Login, endpoint, and malware monitoring therefore have nothing to flag.

The only visible wire indicator is the cloud model tag string in the request body (e.g., tags containing :cloud or -cloud) or explicit /api/pull calls requesting cloud models. Unless security teams actively perform application-layer packet inspection or log analysis for specific cloud model strings originating from external IP addresses, the first sign of compromise will be an empty credit balance.

A Signed-In Server Is a Credential (And How to Protect Yourself)#

This issue highlights a broader architectural trend across modern software: any local or self-hosted tool that maintains an active authentication session with a paid cloud platform inherits that account’s spending limits. Whether it is a local AI engine, an AI API gateway, or an autonomous agent runtime, network exposure becomes billing exposure. Security teams must begin treating signed-in servers as credentials in their asset inventory and exposure scans.

To safeguard your infrastructure and prevent unauthorized cloud spend, implement the following defensive measures:

  • Disable Cloud Functions Explicitly: If a server does not require cloud inference, disable the capability entirely by setting the environment variable OLLAMA_NO_CLOUD=1, or set “disable_ollama_cloud”: true in ~/.ollama/server.json and restart the process.
  • Enforce Port Authentication: Never expose port 11434 directly to the internet without an authentication layer (such as a reverse proxy with access controls). Be especially cautious with Docker deployments: while Ollama binds to localhost by default when run natively, setting OLLAMA_HOST changes that behavior, and the official Docker image listens on all interfaces by default, meaning publishing the container port immediately exposes the service to the public internet.
  • Explicitly Sign Out Unneeded Instances: Run ollama signout on any public or semi-trusted server that does not strictly require active cloud model access.
  • Audit Usage Dashboards Proactively: Do not rely on delayed threshold emails. Regularly inspect your cloud platform usage dashboards to spot unexpected spikes in token consumption early.
  • Inspect Web Logs for Cloud Model Tags: Filter server logs for calls to /api/generate, /api/chat, /v1/chat/completions, /v1/messages, or /api/pull that request cloud model identifiers (featuring a :cloud tag or -cloud suffix). On an unsigned server, any such request is inherently suspicious. On a signed-in server, look specifically for cloud model requests originating from IP addresses outside your trusted network.

Conclusion: Rethinking Exposure in the AI Era#

As self-hosted AI software becomes more deeply integrated into hybrid cloud ecosystems, security perimeters must adapt. The risk profile of exposing a port is no longer limited to unauthorized data access or remote code execution; it now also carries a direct cost, one that can drain a cloud allowance before the owner notices.

When an active login turns a local server into an open line of credit, network perimeter defense becomes financial defense.

Are you running self-hosted AI services today, and have you audited whether your local instances are quietly broadcasting your cloud spending power to the public internet?

Sonali Tyagi

Sonali Tyagi

Staff AI Researcher

Sonali investigates how AI agents can be exploited and how to detect and prevent those attacks. She brings more than seven years of cybersecurity industry experience and a PhD in Computer and Information Technology from Purdue University.