Back to library
AI
tutorial

Prevent AI Refusals from Breaking Your Automated Workflows

Keep agentic workflows running even when face-to-face with model refusals.

Use the new `fallbacks` parameter in the Claude API to automatically re-route requests that trigger safety 'refusals' to a secondary model.

Claude

The Scenario

You are building an autonomous AI agent for content moderation or sensitive data processing. You need to ensure that if the primary model refuses a prompt due to a safety classifier, the workflow continues using a secondary backup model.

Before & after

The old way

When a request was refused by safety filters, developers would have to manually triage the error and resubmit the prompt to a different model. This manual error handling could delay production workflows by 10–15 minutes per incident.

With AI

By adding the `fallbacks` parameter to your API call, switching to a backup model happens instantly and automatically if a refusal occurs. It takes about 2 minutes to configure the code once.

The Prompt

// Structure your API request with the fallback parameter (Beta)
{
  "model": "claude-fable-5",
  "messages": [{"role": "user", "content": "[YOUR_PROMPT]"}],
  "fallbacks": ["claude-sonnet-4.6"]
}

Claude Fable 5 introduces an opt-in `fallbacks` parameter. This is critical for agentic workflows where a 'refusal' stop reason might break an autonomous loop. It allows the system to automatically try a different model if the first one declines.

Source

Claude Platform - Claude API Docs
"An opt-in fallbacks parameter... re-runs refused requests on another model, billed at the fallback model's rates."