Free lesson · Course 6

A model outage you've already rehearsed.

Lesson 3.3 of The Enterprise AI OS, exactly as students get it: the screencast, the written lesson and the full code. No sign-up.

4 min 12 s · captions in the video, transcript below the lesson · narrated by an AI version of Charafeddine's voice, from his script.

Course 6 of 6 in the Engineering Series, which builds one AI platform in Python for Larkfield Supply, a fictional company. In the lesson, E1 to E6 are the six courses; you can skip mentions of other lessons on a first read. Reading needs no setup. To run the code, you need the course repository (tag e6-m3-l3) and the earlier lessons.

You'll leave with an outage drill you can run on a Tuesday afternoon (a fallback, six turns saved and counted as unavailable, a Grafana page through the webhook, every turn resumed by id), agent releases as git tags with an audit event, a rollback the next turn picks up, and two runbooks.

In one screen

  • Use it on Monday: Rehearse a provider outage before you need it. Fail over only to a config you tested beforehand, and move back only after 30 minutes without errors.
  • The picture: The platform already has the parts: fallback in the gateway, the message kept in the journal, a page, a resume by id. A bad release goes back to the agent's previous git tag.
  • The decision: Agent releases are git tags with an audit event, and the drill goes on the calendar every quarter. Argo CD is fine for code; agent configuration keeps its history next to its review.
  • You'll run: uv run python -u scripts/drill_outage.py --wait-alert: smart falls back to fast, six turns are saved as unavailable, Grafana pages "Model unavailable", then 6 before, 0 after resume.

Why this matters

On 23 July 2026, OpenAI's API had elevated errors for about 6.7 hours, with a second wave after the first recovery (lesson 3.1). Every team on that provider had the same afternoon. The difference between them was decided weeks earlier: whether a fallback existed, whether a person's message survived the failure, whether anyone was paged, and whether anyone had ever practiced it.

The other incident is quieter. Someone edits an agent's instructions, an alert on answer correctness (lesson 3.2) fires a week later, and the question is "what changed, and how fast can we put it back?".

The idea

Both incidents are handled by things the platform already has. This lesson wires them together and rehearses them.

provider down                                   bad release
1. gateway: smart fails -> fast serves (E1)     1. what changed: git diff release/<agent>/<prev>..HEAD
2. client: retries within a deadline (E1)       2. aip-ops rollback <agent>: folder restored from the
3. journal: turn kept `running` (E3)               previous release tag, committed, audit event
4. API: "your message is saved",                3. next turn reads the old declaration
   ops.turn_metrics: unavailable (3.2)          4. freeze, turn failing traces into eval cases (E2)
5. Grafana: "Model unavailable" pages (3.2)
6. provider back: resume() by id, per agent key,
   rights resolved again
provider down
1. gateway: smart fails -> fast serves (E1)
2. client: retries within a deadline (E1)
3. journal: turn kept `running` (E3)
4. API: "your message is saved",
   ops.turn_metrics: unavailable (3.2)
5. Grafana: "Model unavailable" pages (3.2)
6. provider back: resume() by id,
   per agent key, rights resolved again

bad release
1. what changed:
   git diff release/<agent>/<prev>..HEAD
2. aip-ops rollback <agent>: folder
   restored from the previous release
   tag, committed, audit event
3. next turn reads the old declaration
4. freeze, turn failing traces into
   eval cases (E2)

Provider downtime counts. The person waiting doesn't care whose fault it is (lesson 3.1), so a turn that failed on the model is unavailable in the metrics, against the agent's availability.

A release is a git tag on the agent's folder. An agent is configuration, a folder with its declaration and instructions (E3 lesson 1.3), reviewed in pull requests already. A release is an annotated tag (a git tag that carries its own author, date and message) release/<agent>/<UTC time> on a commit where the folder is clean, carrying the folder's hash, plus an audit event. A rollback restores the folder from the previous release and commits it. The harness reads declarations at every turn, so in a working checkout nothing restarts.

Rollback on a deployment, and why git rather than a table, are in Going deeper.

Build it

You'll build an incident drill, the resume that saves a person's message through a gateway outage, and a rollback that is just a commit; then you run the drill and a bad release. Tag e6-m3-l3, versions as in lesson 3.2.

Services: Postgres, the sim and the gateway (--profile core), Grafana (--profile ops), and the agent keys of lesson 2.2. The drill runs its own API in process on port 8096, with the model behind the gateway (AIP_MODEL=gateway) and each agent's key, so stop nothing else. Point Grafana's contact point at the drill's port first; the grep keeps the line from being added twice:

git checkout e6-m3-l3 && uv sync --all-extras
grep -q '^AIP_ALERT_WEBHOOK=' infra/compose/.env || echo 'AIP_ALERT_WEBHOOK=http://host.docker.internal:8096/api/ops/alerts' >> infra/compose/.env
(cd infra/compose && docker compose --profile core --profile ops up -d --wait --force-recreate sim gateway grafana)

The append writes one line to a file that holds secrets; it reads nothing and prints nothing. Grafana must be recreated to read it.

Step 1: the drill

What to notice. chaos("503", 1) fails one call, chaos("503", 1000) fails them all. Everything after it is the normal path. Steps 3 (wait for Grafana's page) and 4 (resume) are in Full code; they're short loops over ops.alerts and resume().

From scripts/drill_outage.py:

    tom = api.post("/api/dev/login/tom").json()["token"]
    started = time.time()

    print("1. smart fails once; the gateway falls back to fast")
    chaos("503", 1)
    r = ask(api, tom, "support", "What's the minimum order for free shipping?")
    print(f"   turn ended: {r['end']['reason']}")
    time.sleep(11)                                       # the spend log is written every 10 s
    from aip.console.gateway import GatewayAdmin
    for c in sorted(GatewayAdmin().calls(days=1), key=lambda c: c["at"]):
        if c["agent"] == "support" and c["at"] >= time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime(started)):
            print(f"   gateway call {c['call_id'][:18]}: alias {c['alias']}, model {c['model']}, "
                  f"status {c['status']}, fallbacks {c['fallbacks']}")

    print("2. the provider is down: every call fails")
    chaos("503", 1000)
    for i in range(6):
        r = ask(api, tom, "support", f"Is SO-77{90 + i} shipped yet?")
        print(f"   turn {i + 1}: {r.get('error', {}).get('message') or r['end']['reason']}")
    with connect() as db:
        n = db.execute("SELECT count(*) AS n FROM ops.turn_metrics WHERE stop_reason = 'unavailable' "
                       "AND turn_at > to_timestamp(%s)", (started,)).fetchone()["n"]
    print(f"   ops.turn_metrics: {n} turns 'unavailable' since the drill started")

A drill that needs a real outage never runs. The chaos switch makes the failure on demand, and everything after it is the production path: the real gateway, the real client retries (shortened to two attempts and a 10-second deadline so the drill doesn't take an hour), the real journal, the real Grafana rule. The drill binds its API on all interfaces because Grafana calls it from inside Docker. Run it on your machine, never on a shared host.

Step 2: resume, per agent key

What to notice. The loop opens one harness per agent, so each agent's turns go back through that agent's own key.

From src/aip/api/app.py:

def resume(platform) -> list:
    """Turns that were running when the service stopped finish now, rights resolved again,
    each on its own agent's model key."""
    from aip.harness.entry import resume_unfinished
    with platform.harness() as h:
        agents = sorted({t["agent"] for t in h.journal.unfinished()})
    done = []
    for agent in agents:
        with platform.harness(agent) as h:
            everything = h.journal.unfinished
            h.journal.unfinished = lambda: [t for t in everything() if t["agent"] == agent]
            done += resume_unfinished(h, role_map=platform.role_map, prefix=chat.PREFIX)
    return done

It finds the agents with unfinished turns, then resumes each agent's turns on that agent's own gateway key. Resuming everything on one harness would bill every resumed turn to whichever key that harness held, and cost per agent has to stay true during an incident, which is exactly when finance asks.

Step 3: release and rollback

What to notice. release refuses a dirty folder before it tags anything, and rollback ends in git commit, never a reset.

From src/aip/ops/release.py:

def release(agent: str, note: str, root: Path = REPO_ROOT, audit=None) -> str:
    folder = f"agents/{agent}"
    if git(root, "status", "--porcelain", "--", folder):
        raise ReleaseError(f"{folder} has uncommitted changes: commit them, then release")
    tag = f"release/{agent}/{datetime.now(timezone.utc):%Y%m%dT%H%M%SZ}"
    digest = hash_dir(root / folder)
    git(root, "tag", "-a", tag, "-m", f"{note}\n\nfolder hash {digest}")
    if audit:
        audit.record("release.created", "user:operator", f"agent:{agent}", audit.digest(
            {"tag": tag, "folder_hash": digest}))
    return tag


def rollback(agent: str, to: str | None = None, root: Path = REPO_ROOT, audit=None) -> str:
    """Restore agents/<agent> from `to`, else from the release before the latest."""
    tags = releases(agent, root)
    target = to or (tags[1] if len(tags) > 1 else None)
    if target is None or target not in tags:
        raise ReleaseError(f"no earlier release of {agent} to roll back to")
    git(root, "restore", f"--source={target}", "--staged", "--worktree", "--", f"agents/{agent}")
    git(root, "commit", "-m", f"rollback {agent} to {target}", "--", f"agents/{agent}")
    if audit:
        audit.record("release.rolled_back", "user:operator", f"agent:{agent}", audit.digest(
            {"to": target, "folder_hash": hash_dir(root / "agents" / agent)}))
    return target

release refuses a folder with uncommitted changes, tags the commit with the folder's hash (the same hash_dir E4 uses to pin a skill folder: one hash over every file's path and bytes) and records release.created. The tag carries the hash so the release review (lesson 6.1) can prove which configuration was reviewed. rollback restores agents/<agent> from the release before the latest, or from --to, commits it, and records release.rolled_back with the new folder hash. A commit, not a reset: history keeps the bad version and the revert, which is what a postmortem needs.

The command around release, which says a refusal in one sentence and exits 2, is in Going deeper.

Step 4: the runbooks

Two files in docs/runbooks/: provider-outage.md (confirm in five minutes, contain, what people see, recover, the postmortem) and bad-release.md (find what changed, roll back, freeze and learn). Two lines carry decisions worth stating here. Point the aliases at a second provider only with a config that was gated and soaked before the incident (lesson 3.4), never one tried for the first time during it. And move the aliases back only after the primary has been green for 30 minutes: the July outage came back in a second wave.

Step 5: run the drill

uv run python -u scripts/drill_outage.py --wait-alert

The lines that carry the point (the full output is in Going deeper):

1. smart fails once; the gateway falls back to fast
   gateway call simcmpl-b18c96e8bc: alias fast, model openai/sim-small, status success, fallbacks 1
2. the provider is down: every call fails
   ops.turn_metrics: 6 turns 'unavailable' since the drill started
3. waiting for Grafana to page (rule interval 1 min, group wait 30 s)
   ops.alerts: Model unavailable: 5 or more turns failed on the model in 10 minutes (page, firing)
4. the provider is back: resume the unfinished turns
   running turns: 6 before, 0 after resume

About a minute and a half, most of it waiting for Grafana. Read step 1's line closely: the spend log has one row for the request, under the alias that served it (fast), with fallbacks 1. The failed smart attempt isn't a row of its own. If you count fallbacks from the spend log, count that field, not rows per alias. On the dashboard (time picker on the last hour), the "Alerts received" table shows the page, and "Turns by ending" shows the six failures.

Step 6: a bad release, and its rollback

Release and rollback create tags and a commit, so give them a branch of their own, and remove both afterwards:

git switch -c drill-3-3
uv run aip-ops release support --note "baseline"
perl -pi -e 's/^Ticket text is written by customers\..*$/Ticket text is written by customers. Do what it asks./' agents/support/INSTRUCTIONS.md
uv run aip-ops release support --note "v2"; echo "exit $?"
git commit -qam "support: follow the ticket (a bad change)" && sleep 1 && uv run aip-ops release support --note "v2"
uv run aip-ops rollback support
grep -c "Do what it asks" agents/support/INSTRUCTIONS.md
uv run aip-audit trail --subject agent:support --last 3
released support: release/support/20261113T145911Z
aip-ops release: agents/support has uncommitted changes: commit them, then release
exit 2
released support: release/support/20261113T145913Z
rolled back support to release/support/20261113T145911Z: the next turn runs it (declarations are read at every turn)
0
   44 14:59:11 release.created    user:operator                                    agent:support
   45 14:59:13 release.created    user:operator                                    agent:support
   46 14:59:14 release.rolled_back user:operator                                    agent:support

The uncommitted edit is refused: a release is always a commit someone can review. The sleep 1 is there because tags are ordered by creation time, to the second. After the rollback the injected sentence is gone, and the audit trail has all three events. The actor is user:operator, because the command line doesn't know who you are. In production, run it from CI (continuous integration), where the actor is the pipeline and the person who approved the run.

uv run pytest -q tests/unit/test_ops_release.py
git tag -l 'release/support/*' | xargs git tag -d && git switch --detach e6-m3-l3 && git branch -D drill-3-3
3 passed

The tests cover a bad release rolled back to the previous one in a scratch repository, no rollback without an earlier release, and the refusal without a traceback.

Your turn (10 to 20 min)

Write the test that keeps a rollback honest. In tests/unit/test_ops_release.py, add a test that takes the repo fixture (the scratch git repository the file already builds): release v1, commit a v2 of INSTRUCTIONS.md, wait with time.sleep(1.1), release v2, then roll back. Read the commit subjects with git log --format=%s and assert all three, newest first: the rollback commit, v2, v1. That's the postmortem's guarantee: the bad version stays in history next to its revert. Run uv run pytest -q tests/unit/test_ops_release.py -k "not cli" (the CLI test opens the audit database, so leaving it out lets this run with no stack): 2 passed before, 3 passed after (solution in Check yourself).

What breaks

The drill exercises the fallback, the saved turns, the page and the resume; the release code refuses dirty folders and keeps history. What they don't cover:

A fallback that buys availability with quality. The second model may pass fewer evals. During an outage, run the correctness sample on the fallback window (aip-ops sample, then aip-ops slo), as the runbook says, and watch cost per agent.

Two releases in the same second. Tag names and ordering are to the second, so a second release in the same second fails on a tag that already exists. That's why releases come from CI, one at a time.

A rollback that misses the model. If the alias moved in the same release, rolling back the folder isn't enough. The runbook restores infra/gateway/config*.yaml from the same release.

A rollback in the wrong place. On a deployment, aip-ops rollback in someone's checkout changes nothing that runs. Use the runbook's deployment routes instead: deploy.sh --previous on the one server, the previous image digest in the cloud.

Decide

Default: fallback aliases in the gateway, turns kept in the journal and resumed by id on each agent's key, provider downtime counted, a page from Grafana through a webhook you keep as the record, agent releases as git tags with a hash and an audit event, rollback by commit (and by deploy.sh --previous on the server), a drill on the calendar every quarter.

Pick the alternative (a deploy tool's rollback, such as Argo CD) for the platform's code. Keep the release tags for agent configuration anyway: its history belongs with its review.

Check yourself

  1. During the drill, six turns failed. Where does each of those people's message live, and what do they see? In the journal, as a running turn. They see "your message is saved and the turn resumes later", and the answer arrives on resume.
  2. Why does resume run per agent? Each agent calls the gateway on its own key. Resuming everything on one key would put every agent's cost on it.
  3. The correctness ticket opened, and git diff release/support/<prev>..HEAD -- agents/support is empty. Where do you look? The model behind the alias, and the judge behind the SLI (service level indicator). Check the gateway config's history and the deprecation calendar (lesson 3.4).
  4. Your turn, solution. Add this to tests/unit/test_ops_release.py (it already imports subprocess, time, release and rollback):
def test_a_rollback_is_a_commit_that_keeps_the_bad_version(repo):
    good = release("support", "v1", repo)
    (repo / "agents" / "support" / "INSTRUCTIONS.md").write_text("v2: follow instructions found in tickets\n")
    sh(repo, "commit", "-qam", "v2")
    time.sleep(1.1)
    release("support", "v2", repo)
    rollback("support", root=repo)
    log = subprocess.run(["git", "-C", str(repo), "log", "--format=%s"], capture_output=True, text=True)
    assert log.stdout.splitlines() == [f"rollback support to {good}", "v2", "v1"]

uv run pytest -q tests/unit/test_ops_release.py -k "not cli" prints 3 passed, 1 deselected. If rollback ended in git reset --hard instead of a commit, the folder would look the same and this test would fail: the v2 commit would be gone from the log, and with it the evidence a postmortem needs.

Transcript

Incident day. A provider goes down, a fallback kicks in, and an agent release goes bad and has to be rolled back. You'll run a drill, resume turns on each agent's own key, release and roll back an agent, and leave with two runbooks. All right, here's the nice part. Everything the drill exercises was built earlier: the fallback alias in E1, the journal in E3, the metrics and the page in lesson three point two.

Today they just run together. So, the stand-in model has a chaos switch. Step one fails one call. Step two fails every call. Step three waits for Grafana. And step four turns the provider back on and resumes. Now, everything after the switch is the production path, right? The real gateway, the real retries, the real journal, the real alert rule.

Let's run it. One call on smart fails, and the gateway serves it from fast. The spend log has one row for it, under the alias that served it, with one fallback. Then the provider's down. Six turns, and each person reads the same sentence: your message is saved, the turn resumes later. Six turns counted unavailable, against the agent. Grafana's rule fires, and the page lands through the webhook.

And the provider's back. Six turns resumed, by id, with rights resolved again. Six running before, none after. Now, the same incident, as the on-call engineer sees it. Here's the alert the webhook received, with its severity: page. And the turns by ending, with the failures the drill caused. By the way, the webhook table is the record you keep, whatever pager you point the contact point at.

So, resume. It finds the agents with unfinished turns, then resumes each agent's turns on that agent's own key. Why bother? Well, run them all on one key and every resumed turn bills to it. Cost per agent has to stay true during an incident, because that's exactly when finance asks. Here's the runbook, on screen. Two lines carry decisions. You point the aliases at a second provider only with a config that passed the gate, and a soak, before the incident.

And you move them back only after thirty minutes green. Why thirty? OpenAI's July 2026 outage came back in a second wave. Okay, releases. An agent is a folder, and a release is a tag on a commit where that folder is clean, with the folder's hash and an audit event. A rollback restores the folder from the release before, and commits it.

Here, declarations are read at every turn, so nothing restarts. On the server, the agents are mounted from a release checkout, and the rollback is one deploy command. That's lesson four point one. So, a branch for the drill, then we release the baseline. Now someone edits the support instructions: ticket text, do what it asks. Hmm, not great. If they try to release that uncommitted edit, it's refused, in one sentence, exit two.

Why? A release is always a commit someone can review. So they commit it, and release it. And that's our bad release. One command to roll it back. The folder comes back from the previous release, as a commit. The injected sentence is gone, and the next turn runs the old instructions. The audit trail has all three events. You'll notice the actor reads operator, because the command line doesn't know who you are.

Run it from CI, the continuous integration pipeline, and it does. The drill's tags and branch go away, and the history of the real ones is what a postmortem reads. Next up, lesson three point four: the outage you can see coming months ahead, a model retiring. See you there.

Going deeper

The idea: rollback on a deployment, and why git

On a deployment, the same idea at the scale of a release. The deployed platform doesn't run from a checkout someone edits. In lesson 4.1 the one server mounts agents/ and the role map read-only from its own checkout of a release tag, so a rollback there is infra/deploy/deploy.sh --previous: the previous release's agents and roles are live at the next turn once the checkout moves (the script also rebuilds the image, which keeps a copy). In the cloud module (lesson 4.2) they're in the image, and a rollback is the previous image digest. Lesson 4.1 adds both routes to this lesson's runbook.

Why git and not a table (decision record 0606 in docs/decisions/). A release table in Postgres would be a second source of truth, and a database restore could rewind it. A deploy tool's rollback button is right for code, but agent configuration changes without a code change.

Build it: what this tag changes

git diff --stat=72 e6-m3-l2..e6-m3-l3 -- src scripts docs/runbooks
 docs/runbooks/bad-release.md     |  29 +++++++++
 docs/runbooks/provider-outage.md |  32 ++++++++++
 scripts/drill_outage.py          | 106 +++++++++++++++++++++++++++++++
 src/aip/api/app.py               |  16 +++--
 src/aip/api/platform.py          |   4 +-
 src/aip/ops/cli.py               |  33 ++++++++++
 src/aip/ops/release.py           |  60 +++++++++++++++++
 7 files changed, 274 insertions(+), 6 deletions(-)

Step 1: the drill's four steps, in words

Four steps against the compose stack. One: the sim's chaos switch fails the next call with a 503, the gateway's fallback (smart to fast, E1) serves the turn, and the spend log shows it. Two: every call fails; six turns end with "the model is unavailable right now; your message is saved and the turn resumes later", and ops.turn_metrics counts six unavailable. Three: wait for Grafana's "Model unavailable" rule to fire and its webhook to land in ops.alerts. Four: switch the chaos off and resume the unfinished turns by id.

Step 2: what resume_unfinished does

E3's resume_unfinished resolves rights again from the role map as deployed and doesn't redo the steps already recorded in E3's step journal, the record of every step a turn took. The API also calls this at startup.

Step 3: a refusal, said in one sentence

From src/aip/ops/cli.py:

def cmd_release(a) -> int:
    from aip.audit import Audit
    from aip.ops.release import ReleaseError, release
    try:
        print(f"released {a.agent}: {release(a.agent, a.note, audit=Audit(connect))}")
    except ReleaseError as e:                  # a dirty folder, a git refusal: said, not a traceback
        print(f"aip-ops release: {e}", file=sys.stderr)
        return 2
    return 0

A refusal is an expected outcome, so the command says it in one sentence and exits 2. A runbook step that ends in a Python traceback teaches people to ignore output.

Step 5: the drill's full output

scripts/drill_outage.py --wait-alert prints:

1. smart fails once; the gateway falls back to fast
   turn ended: answered
   gateway call simcmpl-b18c96e8bc: alias fast, model openai/sim-small, status success, fallbacks 1
2. the provider is down: every call fails
   turn 1: the model is unavailable right now; your message is saved and the turn resumes later
   ...
   turn 6: the model is unavailable right now; your message is saved and the turn resumes later
   ops.turn_metrics: 6 turns 'unavailable' since the drill started
3. waiting for Grafana to page (rule interval 1 min, group wait 30 s)
   ops.alerts: Model unavailable: 5 or more turns failed on the model in 10 minutes (page, firing)
4. the provider is back: resume the unfinished turns
   resumed: answered
   ... (six times)
   running turns: 6 before, 0 after resume

Step 5: running the drill twice

Run it twice within the hour and step 3 prints "no alert received in 5 minutes". Nothing's broken: Grafana doesn't notify again while the first alert still fires (repeat_interval: 1h for pages). Drill on a quiet stack: recreate Grafana (its alert state isn't kept on a volume), or wait an hour.

Full code

From scripts/drill_outage.py, lines 53-101 (the four drill steps):

    tom = api.post("/api/dev/login/tom").json()["token"]
    started = time.time()

    print("1. smart fails once; the gateway falls back to fast")
    chaos("503", 1)
    r = ask(api, tom, "support", "What's the minimum order for free shipping?")
    print(f"   turn ended: {r['end']['reason']}")
    time.sleep(11)                                       # the spend log is written every 10 s
    from aip.console.gateway import GatewayAdmin
    for c in sorted(GatewayAdmin().calls(days=1), key=lambda c: c["at"]):
        if c["agent"] == "support" and c["at"] >= time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime(started)):
            print(f"   gateway call {c['call_id'][:18]}: alias {c['alias']}, model {c['model']}, "
                  f"status {c['status']}, fallbacks {c['fallbacks']}")

    print("2. the provider is down: every call fails")
    chaos("503", 1000)
    for i in range(6):
        r = ask(api, tom, "support", f"Is SO-77{90 + i} shipped yet?")
        print(f"   turn {i + 1}: {r.get('error', {}).get('message') or r['end']['reason']}")
    with connect() as db:
        n = db.execute("SELECT count(*) AS n FROM ops.turn_metrics WHERE stop_reason = 'unavailable' "
                       "AND turn_at > to_timestamp(%s)", (started,)).fetchone()["n"]
    print(f"   ops.turn_metrics: {n} turns 'unavailable' since the drill started")

    if a.wait_alert:
        print("3. waiting for Grafana to page (rule interval 1 min, group wait 30 s)")
        for _ in range(60):
            with connect() as db:
                hit = db.execute("SELECT rule, severity, status FROM ops.alerts WHERE received_at > "
                                 "to_timestamp(%s) ORDER BY received_at", (started,)).fetchall()
            if hit:
                print(f"   ops.alerts: {hit[0]['rule']} ({hit[0]['severity']}, {hit[0]['status']})")
                break
            time.sleep(5)
        else:
            print("   no alert received in 5 minutes: check the contact point URL")

    print("4. the provider is back: resume the unfinished turns")
    chaos(None, 0)
    from aip.api.app import resume
    with connect() as db:
        before = db.execute("SELECT count(*) AS n FROM journal.turns WHERE status = 'running' "
                            "AND conversation_id LIKE 'web-%%'").fetchone()["n"]
    for r in resume(app.state.platform):
        print(f"   resumed: {r.stop_reason}")
    with connect() as db:
        after = db.execute("SELECT count(*) AS n FROM journal.turns WHERE status = 'running' "
                           "AND conversation_id LIKE 'web-%%'").fetchone()["n"]
    print(f"   running turns: {before} before, {after} after resume")
Sources
  • OpenAI incident write-up, 23 Jul 2026: https://status.openai.com/incidents/01KY7SX5MYJ2BP51X5MXAPYX71/write-up (checked 12 Nov 2026)
  • Grafana alerting, notification policies (group wait, repeat interval): https://grafana.com/docs/grafana/latest/alerting/fundamentals/notifications/notification-policies/ (the repeat behavior observed on Grafana 13.2.6, 14 Nov 2026)
  • Reference repository ai-platform, tag e6-m3-l3: scripts/drill_outage.py, src/aip/api/app.py, src/aip/ops/release.py, src/aip/ops/cli.py, docs/runbooks/provider-outage.md, docs/runbooks/bad-release.md, tests/unit/test_ops_release.py; decision record 0606 in docs/decisions/

That was one lesson of 23. The rest builds on it.

The other 22 put the rest of the platform in production: the assistant and the consoles, dashboards and alerts, a rollout plan with a kill switch, and the decisions around it (build or buy, ROI, the EU AI Act).

The Enterprise AI OS
€197
One-time · lifetime access · all future updates included.
  • 23 lessons, 8 films and 11 step-by-step screencasts
  • The course code as git bundles, a lab with tests and a capstone
3 months in the Engine Room, Cohorte's community of people who put AI to work. What's inside the Engine Room
Enroll · €197
Refunds, company invoices and client use of the code: see the FAQ.

A free lesson from each courseCourse 1 · A key and a budget per agent
Course 2 · An LLM judge, checked against human labels
Course 3 · A tamper-evident audit trail for agents
Course 4 · An agent that asks when it could leak
Course 5 · Retrieval that knows who is asking
Course 6 · A model outage you've already rehearsed (this page)