Generative AI & Agentic AILLMOps, security and operational evaluation

Test an AI system when its upstream service is unavailable

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 20 September 2026 · 2 min read
Technically reviewed by Ishaan Sharma
In this article (5 sections)

Model, vector, identity and business APIs can fail independently. A resilience test should verify the user-visible state and side-effect safety, not only that an exception was caught.

Execute a bounded retry fixture

The LLMOps and security lab supplies two timeouts followed by success. It records exponential backoff without making a network call.

python
from llmops_cases import outage_case

result = outage_case()
assert [x["status"] for x in result["attempts"]] == ["timeout", "timeout", "ok"]
assert [x["backoff_ms"] for x in result["attempts"]] == [100, 200, 0]
assert result["bounded"] is True
assert result["duplicate_write"] is False
assert result["network_called"] is False

The sequence tests control logic only. Real retry timing, provider behaviour and availability require integration and production evidence.

Classify before retrying

Retry transient timeouts, throttling and selected server errors. Do not retry invalid input, denied authorization or permanent business errors. Honour provider retry guidance, add jitter, cap attempts and stop at the end-to-end deadline. A circuit breaker can prevent thousands of workflows from amplifying one incident.

Reads are often safe to repeat; writes need an idempotency key and a status lookup. A timeout after sending a payment or message is ambiguous: the upstream may have completed it. Query the operation state or reconcile later rather than blindly submitting again.

Define degraded outcomes by task. The system may serve verified cached information, queue an asynchronous job, transfer to a human or report temporary unavailability. It must not invent data to fill an upstream gap or silently skip a required authorization check.

Test the whole failure path

Inject DNS failure, connection refusal, slow responses, malformed output, throttling and partial tool completion. Assert attempts, total duration, cancellation, audit event, user message and absence of duplicate effects. Test recovery after the circuit reopens and a second outage during fallback.

The Generative & Agentic AI course combines fault injection with idempotency, deadlines and runbooks.

Reproducible exercise

Build a local fake provider with scripted responses. Simulate a timeout after a write is accepted, then prove a repeated idempotency key returns the original operation instead of creating another one.

Continue learning

This article is part of the LLMOps, security and operational evaluation sequence. Use the neighbouring tasks when you need the prerequisite or the next application.

Reference: NIST AI RMF Generative AI Profile.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Generative & Agentic AI programme — 3 months. Add practical GenAI, retrieval and agent-building skills to your existing toolkit.

Explore Generative & Agentic AI
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.