September 13, 2026

Set Model Fallback Rules in Single Agent Config Object

Learn how to define model fallback rules config object for every agent you run. Set priorities, version changes, and route sensitive actions through the appro

Set Model Fallback Rules in Single Agent Config Object — illustrated guide from Run Agents

Set Model Fallback Rules in Single Agent Config Object

Model failures during autonomous work require immediate switching without manual intervention. The Agent Command Center stores model fallback rules inside one versioned config object so every agent you run follows the same priorities.

You assign primary and secondary models, define trigger conditions, and keep all parameters traceable across executions. Changes to the model fallback rules config object update the agent runtime backend instantly while preserving logs and token counts.

Key Takeaways

  • Place all fallback logic in a single versioned config object.
  • Route every real-world action through the approvals inbox.
  • Track fallback triggers with execution logs and cost estimates.
  • Test rules using sandbox runs before production deployment.
  • Compare token usage across model choices in the control plane.

Define Fallback Priorities in the Config Object

Open the agent config object and add a fallback section that lists models in order. The first model runs until an error threshold is reached, then control passes to the next entry. This structure keeps every parameter versioned so you can audit which model handled each step of autonomous work.

  • Primary model name and version
  • Error count before switch
  • Token limit per call
  • Secondary model name and version
  • Tertiary model name and version
  • Final safety model for low-cost tasks
  • Maximum total tokens across all fallbacks
  • Latency threshold in milliseconds

All entries remain in the same object so you can roll back any change while keeping execution history intact. See how single config object setups compare in Single Config Object vs Per-Agent for Agent Control.

Example Fallback Block

fallback_rules:
  - model: gpt-4o
    max_errors: 3
    max_tokens: 8000
  - model: claude-3-5-sonnet
    max_errors: 2

Set Trigger Conditions for Runtime Switching

Specify exact conditions that activate a switch. Use error codes, latency thresholds, or token exhaustion as signals. These conditions integrate directly with your agent runtime backend so switches occur without external scripts.

  • HTTP 429 or 503 responses
  • Response time over 8 seconds
  • Token count exceeding 12000
  • Output validation failure rate above 5 percent
  • Rate limit headers indicating quota exhaustion
  • Model deprecation notices from the provider

These conditions live inside the same config object so every agent you run applies identical logic. Review similar schedule-based rules in Set Per Schedule Approval Rules in One Config Object.

Compare Model Options in One Table

ModelTypical LatencyCost per 1k TokensFallback PriorityMax ContextError Recovery Time
gpt-4o2.1 s$0.0051128k45 s
claude-3-5-sonnet3.4 s$0.0032200k60 s
llama-3-70b1.8 s$0.000838k30 s

Use the table to decide which models belong in your model fallback rules config object based on observed token usage from prior runs. Teams often select a mix of high-accuracy and low-cost options to balance quality against spend.

Version Model Parameters in the Config Object

Model parameters such as temperature, top_p, and max_tokens must stay synchronized with fallback rules. Store these values in the same versioned config object so a rollback restores both the model list and its settings.

  • Temperature value per model tier
  • Top_p sampling rate
  • Frequency penalty settings
  • Presence penalty settings
  • Stop sequence definitions
  • System prompt hash for traceability

Versioning prevents drift when multiple developers edit the same agent. Changes generate a new config object version that includes the full parameter set. Compare this approach with distributed tools in Agent Command Center vs Distributed Monitoring Tools.

Monitor Fallback Execution Logs

Every switch writes an entry to the live execution log. The entry records the original model, the reason for the switch, and the new model chosen. These logs feed directly into cost estimates so you see the impact of each fallback in real time.

  • Timestamp of trigger
  • Error code received
  • Tokens consumed before switch
  • New model name
  • Updated cost estimate
  • Parameter values active at switch time
  • Sandbox run ID if applicable

These logs stay attached to the versioned config object so you can audit changes without losing history. Track spend by role in Audit Token Spend by Role from the Control Plane.

Require Human Approval for Sensitive Fallbacks

When a fallback model touches production data or external systems, the action stops in the approvals inbox. You review the proposed model change and the intermediate output before release. Follow the NIST AI Risk Management Framework when setting approval thresholds for model switches.

  • Approve the new model selection
  • Reject and force a different model
  • Edit the prompt before re-run
  • Add a temporary token cap
  • Require additional reviewer sign-off

Human in the loop remains mandatory for any action that reaches the real world. Compare isolated versus centralized control in Single Config Object vs Isolated Settings for Agents.

Test Rules with Sandbox Executions

Run the model fallback rules config object against sample prompts in a sandbox before live deployment. The sandbox returns the same log format used in production.

  1. Load the current config object version.
  2. Submit three test prompts that trigger errors.
  3. Confirm the switch occurs at the expected step.
  4. Check token usage and cost estimates match projections.
  5. Store the sandbox run ID for later comparison.
  6. Validate parameter inheritance across fallbacks.

Validate prompts first in Validate Agent Prompts with Sandbox Executions.

Audit Model Switches for Compliance

Review all model switches from a single dashboard to confirm they followed the approved config object. This audit trail supports regulatory reviews by showing exact timestamps, token counts, and human approvals.

  • Filter logs by model name
  • Export switch events with approvals inbox references
  • Compare error rates before and after each change
  • Verify parameter values matched the version at execution time

See how permission audits work across runtimes in Audit Agent Runtime Permissions from One Dashboard.

Roll Back Config Changes Safely

If a new fallback sequence increases errors, restore the previous version of the config object. Execution logs and approvals inbox records remain unchanged.

  • Select the prior version number
  • Apply the rollback
  • Verify the next run uses the restored rules
  • Confirm token counts align with historical averages

Preserve all records during rollback in Rollback Failed Agent Configs Without Losing History.

Conclusion

Review your current model fallback rules config object and add at least one secondary model this week. Test the change in sandbox mode, then route the first production fallback through the approvals inbox.

Next steps:

  • Update the fallback section with latency and token triggers.
  • Add versioned parameters for each model tier.
  • Run sandbox tests and record run IDs.
  • Configure approvals inbox routing for production actions.
  • Schedule a weekly audit of fallback logs.

FAQ

How many models can one config object hold?

The object supports an ordered list of five models by default. You can extend the list while keeping all parameters versioned in the same file.

Do fallback switches appear in execution logs?

Yes. Each switch records the trigger condition, original model, and replacement model along with updated token usage.

Must every fallback action reach the approvals inbox?

Any action that touches external systems or production data requires explicit approval. Read-only fallbacks can proceed automatically.

Can I set different fallbacks per schedule?

Yes. Add schedule-specific sections inside the same config object so daytime and overnight runs use separate model priorities.

Where do I view cost estimates after a switch?

Cost estimates stream in the live execution view and are stored with each log entry for later comparison.