Skip to content

How should I choose failure-injection scenarios for an AI production workflow?

Choose failure scenarios around irreversible or separately committed boundaries, then state what must remain true after recovery. Test your application's command commit, dispatch, remote observation, local copy and editorial attachment independently. A random collection of timeouts does not establish end-to-end reliability.

TEST THE CUSTOMER API CONTRACTAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Map the boundaries; Define recovery assertions; Run in a controlled environment.
Workflow diagram: Map the boundaries → Define recovery assertions → Run in a controlled environment. Read the article for evidence and limits.

Faults should answer a question

Failure injection is useful when it demonstrates a specific recovery property. A process crash before dispatch and a crash after accepted remote work are different experiments. Neither should be evaluated only by whether the screen eventually stops spinning.

What to do next

  1. 01

    Map the boundaries

    Draw the durable transitions and external side effects in your application. For each boundary, identify what evidence exists immediately before and after it, and which operation could have occurred even if its response was lost.

  2. 02

    Define recovery assertions

    Choose invariants such as no extra creative action, no lost approved command, no overwritten selected output and no duplicate local notification event. Attach each fault to one or more observable assertions.

  3. 03

    Run in a controlled environment

    Use local mocks and synthetic tasks to crash workers, truncate responses or fail writes at chosen points. Restore service, reconcile the records and verify the declared invariant rather than merely rerunning the happy path.

A concrete example

Illustrative example: a test crashes the dispatcher after remote acceptance but before local observation persistence. Recovery must retain the same approved action identity and reconcile it; a fresh generation counted as success would fail the experiment.

Before you call it ready

  • Every fault has a stated invariant.
  • Boundary timing is reproducible.
  • Recovery checks include durable records.

When to stop or choose another method

Stop reporting reliability from a failure-injection exercise if its pass condition ignores duplicate spending, lost commands or incorrect asset attachment.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation