Agents
How to Switch AI Providers Without Rebuilding Your Workflow or Losing Control
Keep the job, limits, proof, and reviewer stable. Change only the provider-specific edge, then record which route really ran.

A founder approves one AI for a small product job. The job has clear limits and needs a human review.
Then that AI is unavailable. A hidden default sends the work somewhere else. The result still looks finished, so the team may never notice the switch.
The problem is bigger than the provider name. The new route may use different tools, limits, or error rules. It may also return weaker proof. The task can finish while the old approval quietly loses its meaning.
There is a safer way to switch. Keep one job card fixed. Change only the provider-specific way that card gets sent and read back.
This does require some provider work. Without rebuilding your workflow means keeping the workflow contract. It does not mean zero code, testing, or review.
Routing is real only when three facts are visible. The chosen provider was invoked. The same controls survived. The workflow recorded the route and its final verdict.
Key takeaways
- Keep the job, limits, proof, and reviewer stable.
- Translate provider details at one named edge.
- Prove the route from process evidence, not the model's claim.
- Treat every fallback as a fresh reviewed route.
What must stay stable when the provider changes?
Start with the job, not the model.
Imagine a team that turns five approved product notes into one list of release risks. The AI may read those notes. It may not change files, contact anyone, or publish the list. A product lead reviews the result.
That is the job card. Engineers may call its saved form a work contract. The name matters less than the decision it controls.
The table below separates the product job from the AI that performs it.
This card reduces the part that must change. It cannot erase real differences between providers.
The operating rule is simple. If a provider switch changes the task, limits, proof, or reviewer, it is no longer the same job.
| Part | Plain question | What stays fixed |
|---|---|---|
| Task | What result is requested? | Turn five approved notes into one release-risk list. |
| Owned scope | What may this worker touch? | Only the five named notes and its draft response. |
| Inputs | What information may it use? | The approved note set, with no hidden chat context. |
| Output shape | What must it return? | One ordered list with a reason and source note for each risk. |
| Permissions | Which actions are allowed? | Read the notes and draft the list. Do not edit, send, or publish. |
| Limits | How much time, money, or retry room is approved? | One attempt within the team's stated ceiling. |
| Progress | Which visible states may the job enter? | Recommended, attempted, then completed, blocked, or failed review. |
| Proof | What evidence must come back? | The selected route, invocation result, output, and review record. |
| Reviewer | Who decides whether the work is accepted? | The named product lead or a task-specific check. |
What should the provider adapter be allowed to change?
A provider is the company or service that receives the AI request. An adapter is a small translator at that boundary.
The adapter turns the stable job card into one provider's request. It also turns that provider's response into the workflow's shared result shape.
The comparison below gives a product lead a clear ownership line.
The adapter may translate. It may not quietly rewrite the job.
These differences exist in current provider documentation. OpenAI describes provider objects and adapters for mixed-provider agent setups. Anthropic uses ordered tool-use and tool-result blocks. Google says the application runs a requested function and returns the result.
Errors differ too. Anthropic documents typed errors and a request ID. Google uses other status names and retry guidance. A shared workflow label can guide the next move, but the original provider evidence should remain attached.
One universal request shape does not make every provider equal. Check only the features this job needs. Then keep their translation inside the adapter.
Once that edge is clear, the next question is who chooses the route.
| Stable workflow contract | Provider-specific adapter |
|---|---|
| Task and wanted result | Command or request method |
| Allowed inputs and owned scope | Provider message format |
| Permissions and outside-action rules | Provider tool-call format and guards |
| Shared time, retry, and approval limits | Requested model setting and provider-only limits |
| Progress states | Provider error names and request identifiers |
| Proof rule and reviewer | Response parser and capture method |
How do you choose an AI route on purpose?
Do not start with a universal best model. Start with the job card.
Check the needed capability, risk, tools, limits, availability, and proof. Then pick a named adapter. Put the choice where the person or system that owns the decision can see it.
OpenAI's current Agents SDK guidance makes a narrow version of this point. It recommends explicit model selection instead of relying on a changing SDK default. That is provider-specific guidance, not a rule shared by every platform.
The table below is a review tool for one workflow. It is not a vendor ranking.
A recommendation is only a plan. It does not prove that the selected route ran.
That proof needs its own record.
| Job or route condition | Required capability | Risk and permission boundary | Limit or availability check | Selected adapter | Evidence required before acceptance |
|---|---|---|---|---|---|
| Sort approved notes into a fixed list | Reliable structured text | Read the named notes only | One attempt is available | Adapter A | Route record, parsed list, and human review |
| Read an approved product image | Verified image input | No file changes or outside actions | Image route is available | Adapter B | Route record, source image reference, and review |
| Use a product tool | The exact verified tool call | Only the named read action | Tool and limit checks pass | Adapter C | Tool request, tool result, final output, and review |
| Chosen route is unavailable | No substitute is approved yet | Original permissions still apply | Availability check fails | None | Blocked record and a fresh routing decision |
How do you prove which route actually ran?
Do not ask the model which model it is. Its answer is part of the work output, not proof of the route.
Use facts outside that answer. Record the selected adapter, the resolved command or endpoint, whether the process started, and its exit or response. Keep the requested model label separate from the upstream model that served the request.
Sometimes the provider does not expose that upstream identity. Write unknown. A requested label is still useful configuration evidence, but it does not reveal hidden serving details.
A route record is the receipt for this decision. It should keep seven facts separate and in this order.
The route starts as RECOMMENDED, then becomes ATTEMPTED. It ends once as COMPLETED, BLOCKED, or FAILED_REVIEW.
Those exact labels are less important than their plain meaning. A route was planned. It was tried. Then it finished, stopped, or failed the work review.
A successful provider call is not the same as acceptable work. Save those facts in separate fields. An open-ended product task needs its own reviewer, not a simple success code.
Use a short shared error label for workflow decisions. Keep the provider's status, request ID, and diagnostic reference beside it. Anthropic documents typed API errors and request IDs. Google documents its own error names and retry guidance.
| Record part | Question it answers | Example state |
|---|---|---|
| Recommended route | Which route did the plan choose? | Adapter A |
| Attempted route | Which route did the workflow try? | Adapter A |
| Actual configured invocation | What command or endpoint really started? | Configured process started; served model unknown |
| Provider result or error | What did that route return? | Success, timeout, unavailable, or original provider error |
| Fallback decision | Was another route proposed and reviewed? | None, approved, or rejected |
| Normalized work result | Did the output match the shared result shape? | Parsed result or no result |
| Independent verdict | Was the work accepted? | Pass, blocked, or failed review |
What happened when I ran one job through two provider adapters?
I ran one bounded provider-boundary test. It was not a model-quality contest.
The synthetic job sorted three pre-labeled dispatch slips. It copied them into one checked receipt. One stable contract governed two configured CLI adapters and one deliberately missing adapter.
Codex and Claude appear below as configured CLI adapters. This test did not audit their full provider APIs or fixed backend models.
The table keeps each step separate because each step proves a different fact.
Both configured adapters returned the same checked result in this run. The unavailable route stopped. It did not quietly run another AI under the old approval.
What this test does not prove: this was one synthetic sorting task, with one attempt per real route, on one local machine.
It did not prove production reliability, open-ended quality, security, privacy, compliance, cost, latency, or tool parity. It did not prove future calls will conform. It also did not show that Codex and Claude have equal quality.
The upstream served model stayed unknown for both real routes. The captured CLI metadata did not expose it.
The narrow result still matters. One stable contract and one route-record shape worked across two configured adapters. The negative control also showed that this fixture could stop without a silent fallback.
| Route recommendation | Attempted route | Actual invocation evidence | Provider result or error | Fallback | Normalized result |
|---|---|---|---|---|---|
| Fixed plan selected the Codex adapter | codex-cli/v1 | Configured process started and returned an exit result; served model unknown | Exit 0 | Not triggered | Exact expected receipt |
| Fixed plan selected the Claude adapter | claude-cli/v1 | Configured process started and returned an exit result; served model unknown | Exit 0 | Not triggered | Exact expected receipt |
| Negative control selected a missing adapter | unavailable-cli/v1 | No process started, so no route received an execution identity | PROVIDER_UNAVAILABLE | None attempted | No result |
Why should a failed route stop instead of hiding the fallback?
When the chosen route cannot run, stop and record the failure. Do not quietly spend the old approval on another provider.
This is what engineers mean by fail closed. The safe state is blocked until a new decision passes.
A fallback is a new route. It may support different tools, limits, or evidence. Recheck it against the original job card before it runs.
The recorded test proved only the missing-command path. It did not run every timeout, rate limit, malformed response, partial tool call, or failed review.
The broader sequence is my implementation rule. OpenAI, Anthropic, and Google do not jointly publish it as their standard.
If the replacement cannot preserve the contract, the job stays blocked. Availability does not outrank the approval that made the work safe to run.
What did WarpOS teach me about provider-neutral routing?
WarpOS is my agentic operating-system project for testing and coordinating long-running AI work.
At the frozen commit I reviewed, it could send bounded jobs through Claude, Codex, and Gemini lanes. It could also ask one provider family to review work from another.
That sounds close to provider-neutral routing. It was not.
Claude still owned the main runner and core build chain. Codex and Gemini were bounded outside lanes. No Grok route existed at that commit.
The table separates what I observed from what I would harden next. The last column is a recommendation, not a claim about the frozen system.
The product lesson came from the gap. Several provider lanes make a system provider-aware. A provider-neutral work contract also needs a stable center, tested adapters, and route proof.
That distinction is more useful than a polished claim that the system had already finished the job.
| Observed frozen control | Provider-neutrality gap | Bounded next rule |
|---|---|---|
| Named roles could use Claude, Codex, or Gemini lanes. | The main session, conductor, engineering leads, and builders remained Claude-owned. | Keep the job contract outside every provider runner. |
| Dispatch records named provider-specific paths. | Several provider lanes did not make the core session portable. | Give each provider one adapter with a tested ownership boundary. |
| Cross-provider review could reduce same-model self-review. | Review across providers did not prove route identity or equal capability. | Save invocation evidence and a separate work verdict. |
| Routing policy described intent and used warning-level controls in places. | A recommendation could still be weaker than enforced execution. | Block unsupported routes and record the actual invocation. |
| No Grok path was present. | An absent route could not meet the same contract. | Mark missing capability as blocked instead of inventing support. |
How can you build the first routing contract this week?
Choose one bounded job with a useful result. Avoid customer data and outside actions during the first test.
Do not redesign every AI workflow. Prove the boundary on one job first.
The checklist below turns that job into a small routing contract.
The prompt below drafts the job card, adapter boundary, route table, and review record. A person must confirm every fact. The real workflow must enforce the final verdict.
Review the returned fields before running anything. Then connect the verdict to the place where the real job changes state.
The checklist leaves a few predictable questions. The FAQ below gives the short answers.
| Step | Action |
|---|---|
| 1 | Write the stable job card with task, scope, inputs, output, permissions, limits, progress, proof, and reviewer. |
| 2 | Name one adapter per provider. List only the fields each adapter may translate. |
| 3 | Write the route table using job, risk, capability, limits, and availability. |
| 4 | Add separate route fields for recommendation, attempt, invocation, result, fallback, and verdict. |
| 5 | Run one bounded case through two configured routes. |
| 6 | Plant one unavailable route and confirm that it blocks without a silent fallback. |
| 7 | Review the work independently. Record what the test did not prove. |
| 8 | Connect BLOCKED and FAILED_REVIEW to the real status change so they cannot become done. |
FAQ
What is provider-neutral AI model routing?
It keeps one work contract while named adapters handle provider details. A deliberate choice, route record, and independent verdict show what ran and whether the work passed.
Can you switch AI providers without changing code?
Usually, some provider work remains. The goal is to preserve the workflow contract while containing code, feature, evaluation, and governance changes at a clear boundary.
How do you prove which AI model actually ran?
Prove the configured adapter and command or endpoint from process evidence. If the provider does not expose the upstream served model, record it as unknown.
Is automatic AI provider fallback safe?
Do not assume it is. Treat the fallback as a new route that must preserve the old task, permissions, limits, proof, and review.
Do AI providers support the same tools, errors, and limits?
No shared parity should be assumed. Current provider documents expose different tool, error, and limit surfaces, so test only what the job needs.
Does the routing test show which AI model is best?
No. It showed that two configured adapters followed one bounded contract in one run. It did not compare open-ended quality.
Conclusion
A job can look complete while the wrong route or weaker controls remain hidden.
Freeze the job card. Keep provider translation at one named edge. Then record the route, result, fallback, and independent verdict.
If a replacement route cannot preserve the contract, stop. Do not trade away the old approval to make the dashboard look green.
Choose one workflow this week. Run two positive routes and one unavailable-route case before expanding the pattern.
If one important AI workflow needs clearer routing, controls, and proof, use the consulting fit check. It will help you decide whether a focused working session makes sense.
Sources
- OpenAI: Models and providers
- OpenAI: Evaluate external models
- Anthropic: Handle tool calls
- Anthropic: API errors
- Anthropic: Rate limits
- Google: Function calling with the Gemini API
- Google: Gemini API troubleshooting
- Google: Gemini API rate limits
- WarpOS frozen routing policy
- WarpOS frozen role registry
- WarpOS frozen dispatch contract
- WarpOS frozen provider paths
Next move
Have one workflow that should move faster?
Bring the process, the bottleneck, and the outcome. I can help diagnose it, design the human and AI boundary, build the smallest working MVP, and measure whether it deserves another iteration.
Start with one workflowAbout the author
Related articlesKeep going
All articlesWhat an AI Building System Needs: 12 Practical Parts
A plain-language guide to the 12 parts that keep AI-assisted work accurate, reviewable, and recoverable, backed by a frozen WarpOS audit.
How to Keep Parallel AI Work From Colliding
A decision matrix, bounded lane contract, and runnable collision experiment for teams using multiple AI agents in one repository.
What Should Your AI Workflow Record?
A practical guide to the five records an AI workflow should keep, the smallest useful event contract, privacy rules, and a frozen WarpOS writer-reader test.
