Prompt & Context Engineering·Question 26 of 68Intermediate

You want to switch model providers and your prompts break. Why, and how would you have made them portable?

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

They break because of prompt-model co-adaptation. Every time an engineer tweaked wording to fix an edge case, they encoded that specific model's interpretation habits into your prompt. The prompt did not capture the task, it captured the task plus a pile of undocumented workarounds for one model.

Full worked answer

They break because of prompt-model co-adaptation. Every time an engineer tweaked wording to fix an edge case, they encoded that specific model's interpretation habits into your prompt. The prompt did not capture the task, it captured the task plus a pile of undocumented workarounds for one model.

What actually breaks, in rough order of frequency:

  • Formatting habits. One model returns bare JSON, another wraps it in a markdown fence, a third adds a sentence of preamble. If you are string-parsing, you are broken on day one.
  • Verbosity and tone defaults. Length instructions calibrated against one model land differently on another.
  • Refusal thresholds. Models draw safety boundaries in different places, so a benign domain that worked can start refusing.
  • Tool calling conventions. Different schema dialects, different parallel-call behaviour, different reliability at deciding not to call anything.
  • Provider-specific features. Assistant prefill exists on some APIs and not others, and newer models have been dropping it even within one provider. If your JSON reliability depends on prefilling {, that is not portable, sometimes not even to the next model version.
  • Removed request knobs. The newest frontier models reject or ignore parameters older prompts relied on: temperature and top_p (Anthropic's 5.x models, GPT-6 Astra, Gemini from 3.6 Flash), forced tool_choice and assistant prefill on Claude Opus 5.5, and manual thinking budgets on recent Claude models. A config that sends temperature: 0 can start returning 400s after an upgrade.
  • Reasoning models ignore or actively suffer from the canned chain-of-thought scaffolding you built for a non-reasoning model.

How to have been portable: the eval set is the portable asset, not the prompt. Freeze the task intent, the output schema, and a labelled eval set including tool-call assertions, citation behaviour, and the "I do not know" cases. Then accept a thin per-model adapter layer rather than pretending one string works everywhere. Use provider-native structured output and native tool calling instead of parsing prose, because those are the parts that transfer.

The practice that makes migration a rehearsal instead of a crisis is running your eval against a second provider continuously, even if you never deploy it. It keeps the design honest and tells you the day a prompt has quietly overfitted.

And the cost point: portability is not free. If you are never switching, do not pay for it.

What a good answer covers

  • They break because of prompt-model co-adaptation
  • Every time an engineer tweaked wording to fix an edge case, they encoded that specific model's…
  • The prompt did not capture the task, it captured the task plus a pile of undocumented workarounds for…
  • Formatting habits
  • Verbosity and tone defaults

Key terms: Formatting habits · Verbosity and tone defaults · Refusal thresholds · Tool calling conventions · Provider-specific features · Removed request knobs · Reasoning models

Interviewer follow-ups to expect

  1. What would you do first: re-tune the old prompt for the new model, or re-derive the prompt from the task spec?

  2. How do you decide when a migration is done?

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