Model Fallback
Keep AI features working when the primary model provider fails.
What it adds
A bounded retry path that reruns a failed AI task on a compatible alternative model and discloses the substitution.
What your agent is told to do
5
What your agent is told to do
5-
1
Classify failures before reacting. Provider outages, capacity rejections, rate limiting, and timeouts are worth retrying elsewhere; a refusal, an invalid request, or an authentication error will fail identically on any destination and must surface immediately.
-
2
Honour rate limiting with backoff before moving on. Retrying instantly against a provider that asked you to wait deepens the outage and can extend the penalty period.
-
3
Allow fallback only to models that can honour the same output shape and the same tool behaviour as the original. A substitute that returns a different structure turns a provider outage into a data problem inside the app.
-
4
Make every step of the task idempotent, keyed to the original request, so a retry that follows a partially completed run does not repeat an external action. A tool call that sent a message or charged a card must not fire twice because the generation step failed after it.
-
5
Cap the attempts, the elapsed time, and the total spend for a single task, and fail cleanly when the cap is reached. Do not retry indefinitely down a list of models; an unbounded fallback chain converts a short outage into a large bill and a very slow error.
Edge cases it handles
8
Edge cases it handles
8- Only retryable provider-side and capacity errors should trigger a fallback. Retrying a refusal, a malformed request, or an expired credential wastes the budget and delays the real error reaching the user.
- The alternative model must produce the same output shape and support the same tools, and its result must be validated against the expected structure before it is accepted.
- If the failure happened after a tool call that had an external effect, the retry must not repeat that effect. Key each external action to the original request and check before acting.
- When a materially different model produced the result, say so on the output itself. A user comparing two results needs to know one of them came from a substitute.
- Attempts, elapsed time, and spend must all be bounded, and the task must fail with a clear message when a bound is hit rather than continuing down the list.
- Every fallback must be recorded with the trigger, the original destination, the substitute, and the outcome, so a pattern of substitutions is visible before it shows up as a quality complaint.
- When every option fails, the feature must degrade to something usable — the last saved result, a manual path, or a clearly stated unavailable state — rather than an unexplained error.
- A queued or background task must not restart its fallback chain from the beginning on every worker retry, or one outage produces many multiples of the intended attempts.
Definition of done
9
Definition of done
9- Fallback triggers only on retryable provider, capacity, rate-limit, and timeout errors.
- Rate-limited responses are backed off before any alternative is attempted.
- Substitute models are restricted to those matching the required output shape and tool behaviour, and their output is validated before acceptance.
- External actions taken before a failure are not repeated when the task is retried.
- Results produced by a substitute model are labelled as such on the output.
- Attempts, elapsed time, and spend per task are capped, and exhausting them produces a clear failure and a usable degraded state.
- Every fallback is recorded with its trigger, destinations, and outcome.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Prompt Injection Defense
Prompt Injection Defense
Stop instructions hidden in documents, pages, and tool output from steering the AI.
What it does
A boundary between the app's own instructions and untrusted content, backed by enforced tool permissions and confirmation for consequential actions.
How it works
- 1 Enumerate every route by which content the app did not author reaches a model: uploaded files, retrieved passages, fetched pages, records from connected accounts, and the results of tool calls.
- 2 Keep the app's own rules in the trusted portion of the request and enclose untrusted content in a clearly delimited region labelled as material to be analysed rather than instructions to be obeyed.
- 3 Enforce what the model may reach outside the model. Tool permissions, tenant scoping, and rate limits must hold even when the model has been completely persuaded — an instruction telling the model not to delete things is not a control.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/prompt-injection-defense
AI Import Column Mapping
AI Import Column Mapping
Guess how an uploaded file's columns line up with the app's fields, then ask.
What it does
A proposed mapping from uploaded columns to destination fields, shown with samples and confirmed before the import runs.
How it works
- 1 Take the uploaded headers and a small sample of rows and propose a mapping to the destination fields. Match on exact and near-exact header names first and only consult the model for the columns that remain unresolved.
- 2 Constrain the candidate set to fields the current user and the importer are actually permitted to write. A mapping that targets a read-only, computed, or privileged field must never be offered, whatever the header says.
- 3 Show the proposal as a table: source column, sample values, destination field, confidence, and the transformation that will be applied. A user cannot approve a mapping they cannot see the effect of.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/ai-import-column-mapping
AI Audit Trail
AI Audit Trail
Keep a reviewable record of what the AI saw, produced, recommended, and actually did.
What it does
A per-run record of inputs, sources, configuration, output, approvals, and executed actions, restricted and retained by purpose.
How it works
- 1 Write one record per run covering the feature invoked, the configuration and prompt version in force, the sources retrieved, the tools called, the output produced, who approved it, and what was carried out.
- 2 Distinguish a draft from an executed action explicitly in the record. A trail that shows only what text was produced cannot answer the question that matters in a review, which is whether anything happened.
- 3 Redact at the moment of writing. Strip credentials, tokens, and payment details before the record is stored, and keep only the personal content genuinely needed to understand the decision.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/ai-audit-trail
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.