High Availability and Disaster Recovery
Servers can be replaced. An agent's half-finished actions, memory and indexes need a plan of their own.
High availability keeps the service running through routine failures. Disaster recovery restores it after a serious one. Set a recovery time and recovery point target for each part, including state, memory, indexes and audit records, remove single points of failure where it is worth the cost, plan for model provider outages and drill restoration until the timings are proven.
What you will learn: the vocabulary of availability and recovery, which agent data needs protection, how to handle model and tool outages, the main multi-region strategies, how to run a recovery drill and how to keep the business working when the agent cannot.
Prerequisites: Deploying Agents to Production and Serverless, Streaming APIs, Queues and State.
The example runs in November 2026 with Python 3.13 and only the standard library. Its targets and drill timings are invented. This page is general engineering information; legal and regulatory continuity duties depend on your sector and country.
Availability and recovery terms
| Term | Plain meaning |
|---|---|
| Availability | The share of time or requests for which the service works |
| Redundancy | A spare that can take over |
| Failover | Moving work to the spare |
| Failback | Returning to the original once it is healthy |
| Recovery time objective (RTO) | The longest acceptable time to restore service |
| Recovery point objective (RPO) | The longest acceptable window of lost data |
| Business continuity | How work carries on while systems are impaired |
Each additional "nine" of availability shrinks the permitted downtime tenfold. Over 30 days, 99 percent allows about 7.2 hours, 99.9 percent about 43 minutes and 99.99 percent about 4.3 minutes. The tighter the target, the more must happen automatically.
A chain of required parts is weaker than any one of them. If three independent dependencies are each available 99.9 percent of the time and all are required, the combination is about 99.7 percent. Real failures are often not independent, so treat such arithmetic as a rough guide.
What an agent system must not lose
| Component | If lost | Typical protection |
|---|---|---|
| Task state and checkpoints | Work stops or actions repeat | Replicated database with point-in-time restore |
| Record of actions and approvals | Cannot prove or reconcile what happened | Append-only, replicated, access controlled |
| Long-term memory and history | Users lose context | Backups that respect deletion requests |
| Knowledge index | Weak or no grounded answers | Snapshots, plus a rebuild from sources |
| Source documents | Index cannot be rebuilt | Versioned storage in a second location |
| Prompts, configuration, releases | Cannot recreate behavior | Version control and registry copies |
| Secrets and keys | Nothing can authenticate or decrypt | Replicated secret and key management |
Different parts deserve different targets. An index that can be rebuilt may accept a day of loss. A record of payments cannot. Ask the process owner what an hour of loss would actually cost, instead of copying one figure across everything.
Remove single points of failure
- Run at least two instances of the API and gateways in separate zones.
- Keep workers replaceable, with state elsewhere.
- Use database replication with automatic failover, and test the failover.
- Make the queue durable, so that accepted work survives restarts.
- Check shared pieces that are easy to forget: identity provider, secret store, network name resolution, certificate renewal and the monitoring itself.
Replication is not backup. A mistaken delete or corrupted write is copied to every replica quickly. Keep backups that are separate, access controlled, protected against alteration and old enough to predate a slow-burning fault.
When the model provider fails
For many agents the model is the dependency you control least. Outages, slowdowns, quota cuts and model retirements all count.
| Option | Benefit | Cost |
|---|---|---|
| Retry and queue | Simple; work completes later | Users wait |
| Same model in another region | Similar behavior | Separate quota; data location rules apply |
| Same model through another service | Independent operator | Features, versions and schedules differ |
| Different model | Independence from one model | Needs its own prompts, tests and approval |
| Reduced mode without the model | Predictable | Limited function |
A fallback that has never been evaluated is a new release shipped during an incident. Test it regularly with your cases, record which tasks it may handle and keep high-risk actions waiting for approval or for the primary. A circuit breaker should stop calling a failing provider and probe it gently before returning (Model Routing, Fallbacks and Gateways).
Planned change counts too. Anthropic, for instance, says it gives at least 60 days' notice before retiring publicly released models, and that partner platforms set their own schedules. Keep an inventory of model versions in use with an owner watching these dates.
When tools fail
- Detect it from error rates and timeouts per tool.
- Stop calling it for a while.
- Tell the model and the user plainly that the function is unavailable.
- Hold actions that need it, with an expiry.
- Never let the agent claim success for an action it could not confirm.
After recovery, release held work gradually so the returning service is not hit by the whole backlog.
Design the reduced modes
Between "working" and "down" there are useful middle states. Define them before an incident, with a switch for each and a message that tells users what to expect:
| Mode | Agent may | Typical trigger |
|---|---|---|
| Normal | Read, reason and act within policy | All checks healthy |
| Approval only | Propose actions that a person performs or confirms | Doubt about decision quality |
| Read only | Search and answer, change nothing | Write systems or audit logging impaired |
| Intake only | Collect requests and promise a later reply | Model or retrieval unavailable |
| Off | Show the manual route | Security event or unsafe behavior |
Make the safer mode the automatic response to missing safeguards. If the policy service or audit store cannot be reached, effectful actions should wait. Test each switch in a rehearsal, confirm that tasks already running notice it and record who may turn normal operation back on.
Setting targets with the process owner
Targets come from consequences. Ask four questions about each process: what happens after ten minutes, one hour and one day without it; what data would have to be re-entered and by whom; which legal or contractual deadlines apply; and how much manual work staff can absorb. Then price the design that meets each answer. Owners often relax a target once they see its cost, and sometimes tighten one when they realize a lost approval record cannot be recreated.
Write the agreed figures down with their reasons. A target nobody agreed to will be disputed during the incident, which is the worst moment to hold that discussion.
Multi-region strategies
Cloud providers commonly describe four levels. The names below follow the AWS disaster recovery paper, and the ideas apply elsewhere.
| Strategy | Standing in the second site | Recovery | Cost |
|---|---|---|---|
| Backup and restore | Copies of data | Slowest | Lowest |
| Pilot light | Live data, compute switched off or minimal | Start and scale before serving | Low |
| Warm standby | A smaller working copy | Scale up, then move traffic | Higher |
| Active-active | Both serve traffic | Fastest | Highest, with data conflicts to solve |
Agent-specific questions decide whether a second region really works:
- Is the model you need available there, with enough quota already granted?
- Do accelerators exist there if you host models, and can you obtain them during a regional event when others want them too?
- May the data legally move there?
- Do the tools your agent calls also work from there?
- Are indexes replicated or rebuilt, and how long does rebuilding take at provider rate limits?
Avoiding two workers for one task
During a failover, the old region may be cut off but still running. If both sides process the same task, actions repeat. Make one side clearly the writer, use fencing tokens or version checks so that stale workers are rejected and send idempotency keys with actions (Parallelism, Deadlocks and Conflict Resolution). For active-active designs, give each task or tenant a home region.
Reconcile after recovery
Restoring a database to an earlier point does not rewind the outside world. Emails sent in the lost window are still sent, but your records may say they were not. Before resuming:
- Pause effectful actions.
- Compare external system logs with restored records for the affected window.
- Mark completed actions as completed.
- Send unclear cases to a person.
- Reapply deletion and correction requests made since the restored copy.
- Resume in stages, starting with read-only work.
Run recovery drills
An untested backup is a hope. A drill restores into an isolated environment, measures what happened and compares it with targets. The example reports a single invented drill:
"""Check a recovery drill against RPO and RTO targets (invented timings)."""
from datetime import datetime, timedelta
TARGETS = { # component: (max data loss, max time to restore) in minutes
"task state": (1, 30),
"agent memory": (15, 120),
"knowledge index": (24 * 60, 240),
"audit log": (0, 480),
}
FAILURE = datetime(2026, 11, 14, 10, 0)
DRILL = { # component: (last recoverable point, restored at)
"task state": (FAILURE - timedelta(seconds=20), FAILURE + timedelta(minutes=22)),
"agent memory": (FAILURE - timedelta(minutes=50), FAILURE + timedelta(minutes=70)),
"knowledge index": (FAILURE - timedelta(hours=9), FAILURE + timedelta(minutes=310)),
"audit log": (FAILURE, FAILURE + timedelta(minutes=95)),
}
def minutes(delta):
return delta.total_seconds() / 60
if __name__ == "__main__":
print(f"{'component':<16}{'data lost':>11}{'target':>8}{'restore':>9}{'target':>8}")
missed = []
for name, (rpo, rto) in TARGETS.items():
point, restored = DRILL[name]
lost, took = minutes(FAILURE - point), minutes(restored - FAILURE)
print(f"{name:<16}{lost:>11.1f}{rpo:>8}{took:>9.0f}{rto:>8}")
if lost > rpo:
missed.append(f"{name}: RPO")
if took > rto:
missed.append(f"{name}: RTO")
print("\nmissed targets:", ", ".join(missed) or "none")
slowest = max(DRILL, key=lambda n: DRILL[n][1])
print("service fully restored after",
f"{minutes(DRILL[slowest][1] - FAILURE):.0f} minutes ({slowest} last)")
Output:
component data lost target restore target
task state 0.3 1 22 30
agent memory 50.0 15 70 120
knowledge index 540.0 1440 310 240
audit log 0.0 0 95 480
missed targets: agent memory: RPO, knowledge index: RTO
service fully restored after 310 minutes (knowledge index last)
Two targets were missed for different reasons. Memory was copied too infrequently, which is fixed by changing how copies are made. The index took too long to restore, which needs a faster restore method, a standby copy or an honest change to the target. The service-level figure is set by the slowest required component, so decide whether the agent may return earlier in a reduced mode without the index, and say so to users.
| Drill type | What it proves |
|---|---|
| Discussion exercise | People know roles and decisions |
| Component restore | A backup is readable and complete |
| Dependency outage in staging | Fallbacks and messages work |
| Full environment rebuild | Infrastructure and data can be recreated |
| Planned production failover | The whole plan works under real conditions |
Start at the top of the table and move down as confidence grows. Include the unglamorous checks: can the recovery team sign in if the identity provider is down, and is the runbook reachable if your own wiki is affected?
What to learn from each drill
Record the planned and actual duration of every step, every instruction that was wrong or missing, each permission someone had to request on the day and each dependency nobody had listed. Turn the findings into dated actions with owners, and repeat the failed part once they are fixed. Trends matter more than a single pass: if restore time grows with data volume, a target that was met this year may be missed next year. Re-estimate after large increases in documents, memory or task history, and show the process owner when the gap between target and measurement is closing.
Feed the same findings into release work. A change that adds a new data store should arrive with its backup, its targets and a restore test, checked by the same review that approves the code (CI/CD, Infrastructure as Code and Safe Releases).
Business continuity
Recovery restores technology. Continuity keeps the work going meanwhile.
- List the processes that depend on the agent and how long each can wait.
- Keep a manual route, with people who still know how to perform it.
- Make the queue of waiting work visible to those people.
- Prepare messages for users and customers in advance.
- Name who can declare a disaster and who can switch back.
- Estimate manual capacity honestly; if the agent handles ten times what staff can, decide what is deferred.
If an agent has performed a process for a year, the manual route may exist only on paper. Have staff practice it periodically with a small sample of work.
A one-page recovery plan
| Section | Contents |
|---|---|
| Scope and owner | Which service, who decides, who deputizes |
| Targets | RTO and RPO per component |
| Triggers | Conditions for failover and who confirms them |
| Steps | Ordered actions with expected duration |
| Checks | How to confirm correctness before reopening |
| Communication | Contacts, status page, regulator duties if any |
| Return | Failback and reconciliation |
| Evidence | Date and result of the last drill, open actions |
Common mistakes
| Mistake | Better approach |
|---|---|
| Treating replicas as backups | Keep separate, protected, point-in-time copies |
| One target for every component | Set targets by business impact |
| Untested fallback model | Evaluate it regularly and limit its scope |
| Second region without quota | Obtain and verify capacity in advance |
| Resuming without reconciliation | Compare with external records first |
| Plan stored only in the failed system | Keep an independent copy |
Checklist
- Every component has an owner, an RTO and an RPO.
- Backups are separate, protected and restore tested.
- Single points of failure are listed and accepted or removed.
- Model and tool outages have tested behavior.
- Failover cannot let two workers act on one task.
- Reconciliation steps exist for restored data.
- A drill has been run recently and its gaps tracked.
- A manual route exists and has been practiced.
Frequently asked questions
Do small teams need a second region?
Often not; separate backups, rebuildable infrastructure and a tested restore may meet their targets at far lower cost.
Is the provider's availability figure enough?
No; your design, quotas, configuration and other dependencies also affect availability, and service credits do not restore lost work.
Must vector indexes be backed up?
Back them up if rebuilding would exceed the recovery time, and always protect the sources and settings needed to rebuild.
How often should drills run?
Set a schedule by risk, and repeat after major changes to data stores, models or infrastructure.
References and further reading
- AWS: disaster recovery options in the cloud.
- NIST SP 800-34: contingency planning guide.
- Google SRE book: data integrity: why restores, not backups, are the goal.
- Claude model deprecations: one provider's retirement policy.
Next steps
Durable Execution, Checkpoints and Approvals
Resume work without repeating effects.
Loops, Performance, Incidents and Maturity
Respond well while the failure is happening.
LLMOps, AgentOps and Maturity
See how recovery fits the wider operating practice.