Safeguard
AI Security•

Hosted model API or self-hosted: who owns which security task?

A responsibility table for calling a hosted model API versus running your own serving stack, so an AI startup knows which security tasks stay with it.

Safeguard Security Team
3 min read

When you call a hosted model API, the provider runs the serving stack, but you still own your keys, prompts, data sent, output handling, and agent permissions. When you self-host, you also own patching the runtime, network isolation, tenant separation, and model file provenance. Neither choice moves your application security to someone else.

The responsibility table

TaskHosted APISelf-hosted
Patch the serving runtimeProviderYou
Secure network ports and cluster trafficProviderYou
Verify model file provenanceProviderYou
Protect your API keysYouYou
Decide what data goes into promptsYouYou
Handle model output safely in your appYouYou
Limit what agents and tools can doYouYou
Contract terms on retention and trainingYou, by reading and negotiatingNot applicable
Tenant isolation between your customersYouYou
Dependencies in your own applicationYouYou

What self-hosting adds

Self-hosting hands you the runtime's security posture. The vLLM guide says multi node traffic is unencrypted and unauthenticated by default, that some endpoints sit outside its API key, and that multi tenant isolation is not provided so separate instances or a gateway are the answer. Ray's documentation says isolation must be enforced outside the cluster. Those are tasks a hosted API provider would otherwise handle.

You also take on model supply chain. OWASP's LLM03 guidance says to use models from verifiable sources and check signatures and file hashes.

What hosting keeps with you

Even with a hosted API, OWASP's 2025 list still applies to your app: prompt injection, sensitive information disclosure, improper output handling, excessive agency, and unbounded consumption are all decided in your code and configuration. Provider terms matter too, and OWASP lists unclear vendor data policies as a supply chain risk, so read the retention and training terms and record them in your subprocessor list.

How to decide

Choose by data sensitivity and team capacity, not only by cost. If a buyer needs data to stay in a specific boundary and no hosted option fits, self-hosting may be necessary, and you should plan staffing for patching it. If you have no one to patch a GPU stack, a hosted API with careful data minimisation is often the lower risk path.

A short note on Safeguard

Whichever you choose, Safeguard offers SBOM and dependency scanning for the code you own, and compliance and evidence automation to record who does what. Try a free scan at gold.safeguard.sh/scan.

Quick check

Does a hosted API make us compliant for AI risk?

No. Provider controls cover the provider's part. Your application, data choices, and agent permissions remain yours.

Is self-hosting more secure?

Not by itself. It gives control and adds work. It is safer only if you patch, isolate, and monitor it.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.