Safety, Security & Responsible AI·Question 32 of 70Intermediate

Hosted model API or self-hosted open weights: how do you make the security and privacy call?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Decide on data gravity, regulatory constraints and utilisation, not on an instinct that cloud is risky. In my experience the honest framing is that self-hosting moves risk, it does not remove it.

Full worked answer

Decide on data gravity, regulatory constraints and utilisation, not on an instinct that cloud is risky. In my experience the honest framing is that self-hosting moves risk, it does not remove it.

Hosted API. Business and API tiers from the major providers do not train on your data by default, you inherit a serious security team, you get moderation endpoints and instruction-hierarchy training for free, and model upgrades are somebody else's problem. Against that: your prompts cross your trust boundary; there is typically a retention window on the order of ~30 days for abuse monitoring unless you negotiate zero data retention, which is usually available but is a contract, not a checkbox; you need a DPA, and a BAA for health data; the provider is a subprocessor you must disclose; and models get deprecated on the provider's schedule, not yours.

Managed private deployment (Bedrock, Azure OpenAI, Vertex, or an enterprise agreement). This is the answer most regulated teams land on and the one candidates forget to mention. Inference runs inside your cloud tenancy under your existing DPA and network controls, so the data-residency and procurement conversation is already solved, and you keep most of the operational simplicity.

Self-hosted open weights. Data never leaves, you can air-gap, you control versions and can pin a model for years, and there is no per-token bill. The costs are real: you own patching and the serving stack's attack surface; you own weights provenance and the whole supply chain (verify hashes, prefer safetensors, pin revisions); you build the guardrail and moderation layer yourself, because none of it is included; and you own the safety evals for a model whose alignment training you did not do. On economics, self-hosting only beats API pricing at sustained high utilisation, because idle GPUs bill anyway.

The point I would make last: for either option the most common real-world leak is not the provider, it is your own observability stack. Tracing tools store full prompts and completions by default, and that database is usually less protected than anything the model provider runs.

What a good answer covers

  • Decide on data gravity, regulatory constraints and utilisation, not on an instinct that cloud is risky
  • In my experience the honest framing is that self-hosting moves risk, it does not remove it
  • Business and API tiers from the major providers do not train on your data by default, you inherit a…
  • Against that: your prompts cross your trust boundary; there is typically a retention window on the order…
  • Managed private deployment (Bedrock, Azure OpenAI, Vertex, or an enterprise agreement)

Key terms: Hosted API · Managed private deployment · Self-hosted open weights

Interviewer follow-ups to expect

  1. What would you need to see in a vendor's ZDR terms before you would put regulated data through them?

  2. At what utilisation does self-hosting start winning on cost, and how does that change the security argument?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep