Case study
SREBot
An AI first responder for incidents.
When production breaks, the first half hour usually goes to finding out what is actually wrong. SREBot does that part. It reads the alert, investigates with the tools an on-call engineer would use, and writes a report with its evidence. When a rollback or a restart would help, it proposes exactly one, and changes nothing until a person approves it.
A personal project. It runs on a local Kubernetes cluster next to a small demo shop that a chaos lab can break in twelve ways, and everything on this page was recorded from that system. The source code is private for now.
- lab incidents diagnosed correctly by Claude Haiku 5.5
- 12/12
- median time from alert to report
- 33 s
- average model cost per incident
- $0.0033
- changes applied without an approval
- 0
Watch an incident, from alert to recovery
Each replay is a real incident from the chaos lab: the alert, every query SREBot ran and what it saw, its report and, where one applies, the fix and the recovery. Time runs faster than it did; the clock shows the real time since the alert.
A new payments release adds a slow fraud check to every charge, and every order slows down. SREBot ties the slowdown to the release and proposes a rollback; after the approval it checks that orders are fast again. Five alerts fired, and all of them ended up in this one incident.
- Alert
- Investigating
- Root cause
- Fix
- Recovered
- 0:00
Alert fired
storefront is using up its "Orders complete within half a second" error budget too fast
- 0:20
Investigation started on claude-opus-5-5
- 0:23
I'm starting the investigation now.
- 0:23
query_metrics_rangePrometheushistogram_quantile(0.95, sum by (service, le) (rate(http_request_duration_seconds_bucket{namespace="demo"}[2m])))minutes: 90
What it saw · 12 ms
{"window": "2026-11-01T00:47:45Z to 2026-11-01T02:17:45Z", "total_series": 3, "series": [{"labels": {"service": "checkout"}, "min": 0.08976, "max": 1.788, "first": 0.09305, "last": 1.344, "points": [{"minutes_ago": 82.5, "value": 0.0938}, {"minutes_ago": 75.0, "value": 0.09382}, {"minutes_ago": 67.5, "value": 0.09404}, {"minutes_ago": 60.0, "value": 0.0939}, {"minutes_ago": 52.5, "value": 0.09415}, {"minutes_ago": 45.0, "value": 0.0942}, {"minutes_ago": 37.5, "value": 0.09387}, {"minutes_ago": 30.0, "value": 0.09357}, {"minutes_ago": 22.5, "value": 0.09397}, {"minutes_ago": 15.0, "value": 0.09465}, {"minutes_ago": 7.5, "value": 0.09363}, {"minutes_ago": -0.0, "value": 1.344}]}, {"labels": {"… - 0:23
query_metrics_rangePrometheussum by (service, target, status) (rate(http_client_requests_total[2m]))
minutes: 90
What it saw · 5 ms
{"window": "2026-11-01T00:47:45Z to 2026-11-01T02:17:45Z", "total_series": 9, "series": [{"labels": {"service": "checkout", "status": "200", "target": "payments"}, "min": 2.562, "max": 5.558, "first": 4.981, "last": 4.905, "points": [{"minutes_ago": 82.5, "value": 4.981}, {"minutes_ago": 75.0, "value": 4.972}, {"minutes_ago": 67.5, "value": 4.972}, {"minutes_ago": 60.0, "value": 4.972}, {"minutes_ago": 52.5, "value": 4.972}, {"minutes_ago": 45.0, "value": 4.972}, {"minutes_ago": 37.5, "value": 4.791}, {"minutes_ago": 30.0, "value": 4.934}, {"minutes_ago": 22.5, "value": 4.981}, {"minutes_ago": 15.0, "value": 5.558}, {"minutes_ago": 7.5, "value": 4.905}, {"minutes_ago": 0.0, "value": 4.905}]}… - 0:23
get_eventsKubernetesnamespace: demo · minutes: 120
What it saw · 16 ms
{"namespace": "demo", "events": [{"object": "Pod/payments-57c8769d78-dmb7m", "type": "Normal", "reason": "Killing", "message": "Stopping container payments", "count": 1, "last_seen": "2026-11-01T02:16:38Z"}, {"object": "ReplicaSet/payments-57c8769d78", "type": "Normal", "reason": "SuccessfulDelete", "message": "Deleted pod: payments-57c8769d78-dmb7m", "count": 1, "last_seen": "2026-11-01T02:16:38Z"}, {"object": "Deployment/payments", "type": "Normal", "reason": "ScalingReplicaSet", "message": "Scaled down replica set payments-57c8769d78 from 1 to 0", "count": 1, "last_seen": "2026-11-01T02:16:38Z"}, {"object": "Pod/payments-6cd96d74c9-5js7g", "type": "Normal", "reason": "Started", "message":… - 0:27
The payments rollout went out at 02:16:32, and latency spiked right after. I'll check the payments rollout history and the payments logs to see whether the two are connected.
- 0:27
get_rollout_historyKubernetesnamespace: demo · deployment: payments
What it saw · 10 ms
{"deployment": "payments", "desired_replicas": 1, "ready_replicas": 1, "conditions": [{"type": "Available", "status": "True", "reason": "MinimumReplicasAvailable", "message": "Deployment has minimum availability.", "lastUpdateTime": "2026-10-31T20:52:18Z"}, {"type": "Progressing", "status": "True", "reason": "NewReplicaSetAvailable", "message": "ReplicaSet \"payments-6cd96d74c9\" has successfully progressed.", "lastUpdateTime": "2026-11-01T02:16:38Z"}], "revisions": [{"revision": 35, "current": true, "created_at": "2026-11-01T02:16:32Z", "change_cause": "release v2-slow", "image": "demo-app:dev", "env": {"SERVICE_NAME": "payments", "RELEASE": "v2-slow"}, "ready_replicas": 1}, {"revision": 34… - 0:27
query_metrics_rangePrometheushistogram_quantile(0.95, sum by (service, le) (rate(http_request_duration_seconds_bucket{namespace="demo"}[1m])))minutes: 10
What it saw · 4 ms
{"window": "2026-11-01T02:07:49Z to 2026-11-01T02:17:49Z", "total_series": 3, "series": [{"labels": {"service": "checkout"}, "min": 0.092, "max": 1.854, "first": 0.09385, "last": 1.854, "points": [{"minutes_ago": 8.5, "value": 0.09423}, {"minutes_ago": 7.8, "value": 0.09291}, {"minutes_ago": 7.0, "value": 0.09328}, {"minutes_ago": 6.3, "value": 0.09371}, {"minutes_ago": 5.5, "value": 0.09325}, {"minutes_ago": 4.8, "value": 0.09317}, {"minutes_ago": 4.0, "value": 0.0951}, {"minutes_ago": 3.3, "value": 0.09312}, {"minutes_ago": 2.5, "value": 0.09263}, {"minutes_ago": 1.8, "value": 0.09378}, {"minutes_ago": 1.0, "value": 0.09347}, {"minutes_ago": 0.3, "value": 1.85}]}, {"labels": {"service": "p… - 0:27
search_logsLoki{namespace="demo", service="payments"}minutes: 5
What it saw · 14 ms
{"window": "2026-11-01T02:12:49Z to 2026-11-01T02:17:49Z", "total_lines": 2, "truncated": false, "groups": [{"service": "payments", "pod": "payments-6cd96d74c9-5js7g", "message": "fraud check v2 enabled for all charges", "first_seen": "2026-11-01T02:16:33Z", "last_seen": "2026-11-01T02:16:33Z", "example_fields": {"level": "info", "service": "payments", "release": "v2-slow"}, "count": 1}, {"service": "payments", "pod": "payments-6cd96d74c9-5js7g", "message": "service started", "first_seen": "2026-11-01T02:16:33Z", "last_seen": "2026-11-01T02:16:33Z", "example_fields": {"level": "info", "service": "payments", "release": "v2-slow", "port": 8080}, "count": 1}]} - 0:40
I'm comparing the latency at 02:02–02:16 under revision 34, which was healthy, so I'll roll back to 34. This has happened repeatedly since v2-slow was deployed three times. The 30-minute burn rate of 6.8x looks high given the spike only started a minute ago, so the earlier 01:51 v2-slow incident is probably still inside that window, and that's fine.
- 0:40
Report ready
payments · Bad deployment
- 0:40
Fix proposed, waiting for approval
Roll back payments to revision 34 (release v1) to undo the slow v2-slow release that has been running since 02:16:32. (medium risk)
- 0:47
Approved by eval runner
- 0:47
Fix applied
- 1:20
Same cause: grouped into this incident
storefront is using up its "Orders complete within half a second" error budget too fast
- 2:11
Same cause: grouped into this incident
High p99 latency on checkout
- 2:11
Same cause: grouped into this incident
High p99 latency on storefront
- 2:26
Same cause: grouped into this incident
High p99 latency on payments
- 2:57
Recovery verified after 130 s
- 2:59
Closed by the eval runner before the next scenario
- 3:30
Postmortem draft written
The report
Payments was rolled out to revision 35 (release v2-slow, which turns on 'fraud check v2') at 02:16:32. Within about a minute, p95 latency on payments rose from about 0.09 s to about 1.5 s, and checkout and storefront followed to about 1.85 to 1.9 s, which breaks the 0.5 s orders-fast SLO. Rolling payments back to revision 34 (v1), which was healthy from 02:02 to 02:16, should restore latency. This is the third time v2-slow has been deployed in about an hour.
Root cause
paymentsBad deploymenthigh confidence
Payments release v2-slow (revision 35, deployed 02:16:32) turns on 'fraud check v2 enabled for all charges'. That raised payments p95 latency about 16x, from about 0.09 s to about 1.5 s. Checkout waits on payments and storefront waits on checkout, so the delay reaches every order.
Evidence
- kubernetespayments rollout history: revision 35 'release v2-slow' (RELEASE=v2-slow) was created 2026-11-01T02:16:32Z and the old ReplicaSet payments-57c8769d78 was scaled down at 02:16:38. The previous revision 34 runs RELEASE=v1.
- metricsp95 latency (1m rate) was steady at about 0.09 s for payments, checkout and storefront until 02:16. In the next minute it reached payments 1.48 to 1.62 s, checkout 1.85 s and storefront 1.90 s, the same minute as the rollout.
- logsThe new payments pod payments-6cd96d74c9-5js7g, release v2-slow, logged 'fraud check v2 enabled for all charges' at 02:16:33.
- metricsDependency calls look healthy apart from latency: checkout→payments stays at about 4.9 req/s with status 200, checkout→redis at about 5 req/s ok with no errors, and storefront→checkout 502s are close to 0 (0.0095/s). This is a slowdown, not an error spike.
- kubernetesRevision history shows v2-slow deployed at 01:27 (rev 29), 01:51 (rev 32) and 02:16 (rev 35), and SREBot rolled it back to v1 each time (rev 30, 33, 34). That explains why the 30m burn rate is 6.8x.
Fix SREBot can apply
Roll back payments to revision 34 (release v1) to undo the slow v2-slow release that has been running since 02:16:32. verified
Postmortem draft: Slow payments release made storefront orders miss the half-second target
At 02:16:32 UTC payments was rolled out to revision 35 (release v2-slow). That release turns on 'fraud check v2' for all charges. Payments p95 latency rose about 16x, and checkout and storefront slowed with it, breaking the 0.5 s orders-fast SLO. SREBot traced the slowdown to the payments rollout and proposed a rollback. The rollback to revision 34 (release v1) was approved and applied at 02:18:09, and recovery was confirmed at 02:20:19. This was the third time v2-slow had gone out in about an hour: 01:27, 01:51 and 02:16. Each earlier time it was rolled back, and nothing stopped it from being deployed again.
- P1 Find what keeps deploying payments release v2-slow (it went out at 01:27, 01:51 and 02:16) and stop it.
- P1 Block release v2-slow from deploying to payments, or pin payments to v1, until fraud check v2's latency is fixed.
- P2 Put fraud check v2 behind a feature flag. Fix its performance, or move it off the synchronous charge path, before enabling it for all charges.
- P2 Add a canary or progressive rollout for payments that halts and reverts automatically if p95 latency regresses against the previous revision.
- P2 Alert when a deployment rolls out a release that was rolled back within the last 24 hours.
- P2 When a release is rolled back for an incident, automatically open a follow-up ticket to block or fix that release, so a rollback is never the last step.
- P3 Review the HighLatency alert windows and thresholds: they fired after the rollback here. Tune them to fire alongside the burn-rate alert, or remove them if the burn-rate alert covers the case.
Redis, where checkout keeps the carts, is scaled to zero, and every order fails. Six alerts fire on storefront and checkout. SREBot groups them into one incident, follows the errors to Redis and proposes scaling it back up.
- Alert
- Investigating
- Root cause
- Fix
- Recovered
- 0:00
Alert fired
storefront is using up its "Customers can place orders" error budget too fast
- 0:20
Investigation started on claude-opus-5-5
- 0:24
I'm going to start looking into this in an efficient way.
- 0:24
query_metrics_rangePrometheussum by (service, target, status) (rate(http_client_requests_total{namespace="demo"}[1m]))minutes: 30
What it saw · 10 ms
{"window": "2026-11-01T02:02:25Z to 2026-11-01T02:32:25Z", "total_series": 9, "series": [{"labels": {"service": "checkout", "status": "200", "target": "payments"}, "min": 0.0, "max": 6.694, "first": 6.694, "last": 0.0, "points": [{"minutes_ago": 27.5, "value": 4.801}, {"minutes_ago": 25.0, "value": 4.956}, {"minutes_ago": 22.5, "value": 4.867}, {"minutes_ago": 20.0, "value": 4.978}, {"minutes_ago": 17.5, "value": 4.978}, {"minutes_ago": 15.0, "value": 4.89}, {"minutes_ago": 12.5, "value": 4.978}, {"minutes_ago": 10.0, "value": 4.978}, {"minutes_ago": 7.5, "value": 4.534}, {"minutes_ago": 5.0, "value": 4.978}, {"minutes_ago": 2.5, "value": 4.978}, {"minutes_ago": 0.0, "value": 0.0}]}, {"label… - 0:24
query_metrics_rangePrometheussum by (service, status) (rate(http_requests_total[1m]))
minutes: 30
What it saw · 7 ms
{"window": "2026-11-01T02:02:25Z to 2026-11-01T02:32:25Z", "total_series": 7, "series": [{"labels": {"service": "checkout", "status": "200"}, "min": 0.0, "max": 6.694, "first": 6.694, "last": 0.0, "points": [{"minutes_ago": 27.5, "value": 4.801}, {"minutes_ago": 25.0, "value": 4.956}, {"minutes_ago": 22.5, "value": 4.867}, {"minutes_ago": 20.0, "value": 4.978}, {"minutes_ago": 17.5, "value": 4.978}, {"minutes_ago": 15.0, "value": 4.89}, {"minutes_ago": 12.5, "value": 4.978}, {"minutes_ago": 10.0, "value": 4.978}, {"minutes_ago": 7.5, "value": 4.534}, {"minutes_ago": 5.0, "value": 4.978}, {"minutes_ago": 2.5, "value": 4.978}, {"minutes_ago": -0.0, "value": 0.0}]}, {"labels": {"service": "chec… - 0:24
get_eventsKubernetesnamespace: demo · minutes: 60
What it saw · 18 ms
{"namespace": "demo", "events": [{"object": "Pod/redis-5676bdcdb6-47hxh", "type": "Normal", "reason": "Killing", "message": "Stopping container redis", "count": 1, "last_seen": "2026-11-01T02:31:26Z"}, {"object": "ReplicaSet/redis-5676bdcdb6", "type": "Normal", "reason": "SuccessfulDelete", "message": "Deleted pod: redis-5676bdcdb6-47hxh", "count": 1, "last_seen": "2026-11-01T02:31:26Z"}, {"object": "Deployment/redis", "type": "Normal", "reason": "ScalingReplicaSet", "message": "Scaled down replica set redis-5676bdcdb6 from 1 to 0", "count": 1, "last_seen": "2026-11-01T02:31:26Z"}, {"object": "Pod/payments-7bc8fb7455-bm4zb", "type": "Normal", "reason": "Killing", "message": "Stopping contain… - 0:24
list_podsKubernetesnamespace: demo
What it saw · 15 ms
{"namespace": "demo", "pods": [{"name": "checkout-6669676d8d-9xqtp", "service": "checkout", "phase": "Running", "started_at": "2026-11-01T02:01:53Z", "containers": [{"name": "checkout", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "loadgen-57bdf4565-gf4rb", "service": "loadgen", "phase": "Running", "started_at": "2026-11-01T02:01:53Z", "containers": [{"name": "loadgen", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "payments-57c8769d78-whdvt", "service": "payments", "phase": "Running", "started_at": "2026-11-0… - 0:28
Redis was scaled down from one replica to zero at 02:31:26, so it currently has no running pods. I'm going to check the Redis rollout history and the checkout logs to see what happened around that time.
- 0:28
get_rollout_historyKubernetesnamespace: demo · deployment: redis
What it saw · 14 ms
{"deployment": "redis", "desired_replicas": 0, "ready_replicas": 0, "conditions": [{"type": "Available", "status": "True", "reason": "MinimumReplicasAvailable", "message": "Deployment has minimum availability.", "lastUpdateTime": "2026-10-31T20:58:47Z"}, {"type": "Progressing", "status": "True", "reason": "NewReplicaSetAvailable", "message": "ReplicaSet \"redis-5676bdcdb6\" has successfully progressed.", "lastUpdateTime": "2026-11-01T02:01:57Z"}], "revisions": [{"revision": 7, "current": true, "created_at": "2026-11-01T02:01:53Z", "change_cause": null, "image": "redis:8-alpine", "env": {}, "ready_replicas": 0}, {"revision": 6, "current": false, "created_at": "2026-11-01T01:36:54Z", "change_c… - 0:28
search_logsLoki{namespace="demo", service="checkout", level="error"}minutes: 5
What it saw · 27 ms
{"window": "2026-11-01T02:27:29Z to 2026-11-01T02:32:29Z", "total_lines": 309, "truncated": false, "groups": [{"service": "checkout", "pod": "checkout-6669676d8d-9xqtp", "message": "cart lookup failed: redis unavailable", "first_seen": "2026-11-01T02:31:26Z", "last_seen": "2026-11-01T02:32:28Z", "example_fields": {"level": "error", "service": "checkout", "release": "v1", "error": "Timeout connecting to server"}, "count": 309}]} - 0:28
query_metricsPrometheuskube_deployment_status_replicas_available{namespace="demo"}What it saw · 3 ms
{"total_series": 5, "series": [{"labels": {"__name__": "kube_deployment_status_replicas_available", "container": "kube-state-metrics", "deployment": "loadgen", "endpoint": "http", "instance": "10.244.0.15:8080", "job": "kube-state-metrics", "namespace": "demo", "pod": "kube-prometheus-stack-kube-state-metrics-78dc75b868-rbzz9", "service": "kube-prometheus-stack-kube-state-metrics"}, "value": 1.0}, {"labels": {"__name__": "kube_deployment_status_replicas_available", "container": "kube-state-metrics", "deployment": "storefront", "endpoint": "http", "instance": "10.244.0.15:8080", "job": "kube-state-metrics", "namespace": "demo", "pod": "kube-prometheus-stack-kube-state-metrics-78dc75b868-rbzz9… - 0:46
I've confirmed Redis was scaled to 0 at 02:31:26, so the fix is to scale it back to 1, which is a low-risk move. The earlier payments rollouts with crash backoff caused brief blips, but payments is healthy now. The open question is whether the Redis carts were lost, since there may be no persistence configured.
- 0:46
Report ready
redis · Configuration change
- 0:46
Fix proposed, waiting for approval
Scale the redis Deployment from 0 back to 1 replica to restore checkout's cart store. (low risk)
- 0:50
Approved by eval runner
- 0:50
Fix applied
- 1:17
Same cause: grouped into this incident
High error rate on storefront
- 1:20
Same cause: grouped into this incident
storefront is using up its "Orders complete within half a second" error budget too fast
- 1:32
Same cause: grouped into this incident
High error rate on checkout
- 2:17
Same cause: grouped into this incident
High p99 latency on checkout
- 2:17
Same cause: grouped into this incident
High p99 latency on storefront
- 3:05
Recovery verified after 135 s
- 6:00
Alert resolved
- 6:00
Incident resolved: its alerts cleared
- 6:32
Postmortem draft written
The report
At 02:31:26 the redis Deployment was scaled from 1 replica to 0, so redis has no running pods. Checkout cannot reach its cart store: every cart lookup times out, checkout returns 503, and storefront returns 502 on every order (about 5 req/s). This is what is burning the orders-succeed error budget. Scaling redis back to 1 replica should restore service.
Root cause
redisConfiguration changehigh confidence
The redis Deployment's desired replica count was changed from 1 to 0 at 02:31:26 (event 'Scaled down replica set redis-5676bdcdb6 from 1 to 0'). The image did not change and no new revision was created, so this was a scale change, not a release. With no redis pod, checkout's cart lookups fail, and the errors pass up through checkout to storefront.
Evidence
- kubernetesEvent at 02:31:26Z: Deployment/redis 'Scaled down replica set redis-5676bdcdb6 from 1 to 0', and pod redis-5676bdcdb6-47hxh was stopped. get_rollout_history shows desired_replicas=0 and ready_replicas=0. Current revision 7 (02:01:53Z) uses the same image redis:8-alpine with no env changes.
- metricskube_deployment_status_replicas_available{deployment="redis"} = 0. Every other demo Deployment shows 1.
- logsFrom 02:31:26Z to 02:32:28Z checkout logged 309 errors 'cart lookup failed: redis unavailable' (error: 'Timeout connecting to server', release v1). The first error came at the same second as the scale-down.
- metricshttp_client_requests_total for checkout→redis: status ok fell from about 4.98/s to 0 and status error rose to about 4.85/s in the last minute. Checkout's own responses moved from 200 to 503 (about 4.85/s), and storefront's from 200 to 502 (about 4.98/s). Before 02:31 storefront had been at about 4.98/s of 200 responses.
- metricscheckout→payments calls fell to 0 because requests now fail at the cart lookup before payments is called. Payments has no current errors and is the cause of nothing here.
- kubernetesEarlier, payments rolled between ReplicaSets three times (02:18 to 02:26) and pod payments-7bc8fb7455-bm4zb went into BackOff. That produced short 500/502 blips (for example about 2.1/s checkout→payments errors around 02:25 to 02:26). It recovered by 02:26 on payments-57c8769d78 and does not explain the current outage.
- alertErrorBudgetBurn (slo=orders-succeed) has been firing since 02:31:42Z, 16 s after the scale-down, at an 18.4x burn rate.
Fix SREBot can apply
Scale the redis Deployment from 0 back to 1 replica to restore checkout's cart store. verified
Postmortem draft: Redis scaled to zero; every storefront order failed
At 02:31:26 UTC the redis Deployment was scaled from 1 replica to 0. Checkout keeps its cart store in redis, so every cart lookup timed out. Checkout returned 503 and storefront returned 502 on every order (about 5 req/s), which burned the orders-succeed error budget at an 18.4x rate. SREBot found the cause 46 seconds after the incident opened. Scaling redis back to 1 replica was approved and applied at 02:32:51, and recovery was confirmed at 02:35:06. It is still unknown what scaled redis to zero.
- P1 Use API server audit logs to identify who or what scaled deployment/redis to 0 at 02:31:26 UTC. Confirm it will not re-apply replicas=0, including through GitOps sync.
- P1 Set redis replicas in source control with drift detection, and add an admission policy that rejects scaling the redis Deployment below 1 replica.
- P1 Add an alert when kube_deployment_status_replicas_available{deployment="redis"} is 0, routed to the same on-call as the orders-succeed SLO.
- P2 Check whether redis persists cart data. Confirm whether carts were lost in this incident and, if so, assess the customer impact.
- P2 Make the cart store resilient to losing one pod by running redis replicated with persistence, so one pod going away does not fail every order.
- P2 Investigate why payments went through three rollouts with a crash-looping pod (payments-7bc8fb7455-bm4zb) between 02:18 and 02:26, and whether the same actor caused it.
The card processor starts declining a few percent of charges: below every error-rate alert, but enough to burn the 99.9% orders SLO. Only the burn-rate alert catches it. SREBot traces the errors to the card processor outside the cluster and proposes no fix, because nothing in the cluster would help.
- Alert
- Investigating
- Root cause
- 0:00
Alert fired
storefront is using up its "Customers can place orders" error budget too fast
- 0:20
Investigation started on claude-opus-5-5
- 0:23
I'm starting the investigation now.
- 0:23
query_metrics_rangePrometheussum by (service, status) (rate(http_requests_total{status=~"5.."}[2m]))minutes: 60
What it saw · 14 ms
{"window": "2026-11-01T01:10:40Z to 2026-11-01T02:10:40Z", "total_series": 4, "series": [{"labels": {"service": "checkout", "status": "502"}, "min": 0.0, "max": 1.924, "first": 0.0, "last": 0.1238, "points": [{"minutes_ago": 55.0, "value": 0.0}, {"minutes_ago": 50.0, "value": 0.0}, {"minutes_ago": 45.0, "value": 0.0}, {"minutes_ago": 40.0, "value": 0.0}, {"minutes_ago": 35.0, "value": 0.0}, {"minutes_ago": 30.0, "value": 0.0}, {"minutes_ago": 25.0, "value": 0.1333}, {"minutes_ago": 20.0, "value": 0.0}, {"minutes_ago": 15.0, "value": 0.0}, {"minutes_ago": 10.0, "value": 0.0}, {"minutes_ago": 5.0, "value": 0.4286}, {"minutes_ago": -0.0, "value": 0.1238}]}, {"labels": {"service": "checkout", "s… - 0:23
query_metrics_rangePrometheussum by (service, target, status) (rate(http_client_requests_total[2m]))
minutes: 60
What it saw · 11 ms
{"window": "2026-11-01T01:10:40Z to 2026-11-01T02:10:40Z", "total_series": 9, "series": [{"labels": {"service": "checkout", "status": "200", "target": "payments"}, "min": 3.048, "max": 5.479, "first": 4.972, "last": 4.848, "points": [{"minutes_ago": 55.0, "value": 4.972}, {"minutes_ago": 50.0, "value": 4.981}, {"minutes_ago": 45.0, "value": 4.972}, {"minutes_ago": 40.0, "value": 5.019}, {"minutes_ago": 35.0, "value": 4.981}, {"minutes_ago": 30.0, "value": 4.972}, {"minutes_ago": 25.0, "value": 4.838}, {"minutes_ago": 20.0, "value": 4.981}, {"minutes_ago": 15.0, "value": 4.972}, {"minutes_ago": 10.0, "value": 4.962}, {"minutes_ago": 5.0, "value": 4.543}, {"minutes_ago": 0.0, "value": 4.848}]}… - 0:23
get_eventsKubernetesnamespace: demo · minutes: 90
What it saw · 29 ms
{"namespace": "demo", "events": [{"object": "Pod/payments-854f45fd8-d7kzc", "type": "Normal", "reason": "Killing", "message": "Stopping container payments", "count": 1, "last_seen": "2026-11-01T02:02:03Z"}, {"object": "ReplicaSet/payments-854f45fd8", "type": "Normal", "reason": "SuccessfulDelete", "message": "Deleted pod: payments-854f45fd8-d7kzc", "count": 1, "last_seen": "2026-11-01T02:02:03Z"}, {"object": "Deployment/payments", "type": "Normal", "reason": "ScalingReplicaSet", "message": "Scaled down replica set payments-854f45fd8 from 1 to 0", "count": 2, "last_seen": "2026-11-01T02:02:03Z"}, {"object": "Pod/storefront-6ff5759b86-dk2cv", "type": "Normal", "reason": "Killing", "message": "… - 0:27
All deployments finished rolling at 02:01:55. Payments 500s have spiked both around 02:03, about seven minutes ago, and earlier, 23 to 33 minutes back. I'll pull the payments rollout history and logs next.
- 0:27
get_rollout_historyKubernetesnamespace: demo · deployment: payments
What it saw · 19 ms
{"deployment": "payments", "desired_replicas": 1, "ready_replicas": 1, "conditions": [{"type": "Available", "status": "True", "reason": "MinimumReplicasAvailable", "message": "Deployment has minimum availability.", "lastUpdateTime": "2026-10-31T20:52:18Z"}, {"type": "Progressing", "status": "True", "reason": "NewReplicaSetAvailable", "message": "ReplicaSet \"payments-57c8769d78\" has successfully progressed.", "lastUpdateTime": "2026-11-01T02:02:03Z"}], "revisions": [{"revision": 34, "current": true, "created_at": "2026-11-01T02:01:53Z", "change_cause": "rollback to revision 31 (SREBot)", "image": "demo-app:dev", "env": {"SERVICE_NAME": "payments", "RELEASE": "v1"}, "ready_replicas": 1}, {"r… - 0:27
search_logsLoki{namespace="demo", service="payments", level="error"}minutes: 45
What it saw · 64 ms · 1 masked before the model saw them
{"window": "2026-11-01T01:25:43Z to 2026-11-01T02:10:43Z", "total_lines": 500, "truncated": true, "groups": [{"service": "payments", "pod": "payments-854f45fd8-gf9bv", "message": "card processor request failed: upstream returned 503", "first_seen": "2026-11-01T01:37:19Z", "last_seen": "2026-11-01T02:10:23Z", "example_fields": {"level": "error", "service": "payments", "release": "v1", "route": "/charge", "customer": "[REDACTED:email]"}, "count": 500}]} - 0:27
query_metrics_rangePrometheussum(rate(http_requests_total{service="payments"}[1m])) by (status)minutes: 45
What it saw · 5 ms
{"window": "2026-11-01T01:25:43Z to 2026-11-01T02:10:43Z", "total_series": 2, "series": [{"labels": {"status": "200"}, "min": 2.2, "max": 6.826, "first": 4.978, "last": 4.8, "points": [{"minutes_ago": 41.2, "value": 5.0}, {"minutes_ago": 37.5, "value": 4.978}, {"minutes_ago": 33.7, "value": 4.978}, {"minutes_ago": 30.0, "value": 4.978}, {"minutes_ago": 26.2, "value": 4.889}, {"minutes_ago": 22.5, "value": 4.978}, {"minutes_ago": 18.7, "value": 3.1}, {"minutes_ago": 15.0, "value": 4.956}, {"minutes_ago": 11.2, "value": 4.978}, {"minutes_ago": 7.5, "value": 3.511}, {"minutes_ago": 3.7, "value": 4.978}, {"minutes_ago": -0.0, "value": 4.8}]}, {"labels": {"status": "500"}, "min": 0.0, "max": 2.77… - 0:32
The payments logs show a 503 from the external card processor, and the pod name there (gf9bv) doesn't match the current one (57c8769d78). That's odd, since 854f45fd8 was scaled down at 02:02:03 but its logs run until 02:10:23, so I'm wondering whether a pod is still lingering. I'll list the pods and pull logs from the current one, and check the other sources too. I'm checking whether the 500s line up with those card processor errors, and the 500 rate has dropped to 0.11/s, which is worth comparing against the error log. Next I'll list the pods and pull recent logs filtered by level.
- 0:32
list_podsKubernetesnamespace: demo
What it saw · 9 ms
{"namespace": "demo", "pods": [{"name": "checkout-6669676d8d-9xqtp", "service": "checkout", "phase": "Running", "started_at": "2026-11-01T02:01:53Z", "containers": [{"name": "checkout", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "loadgen-57bdf4565-gf4rb", "service": "loadgen", "phase": "Running", "started_at": "2026-11-01T02:01:53Z", "containers": [{"name": "loadgen", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "payments-57c8769d78-dmb7m", "service": "payments", "phase": "Running", "started_at": "2026-11-0… - 0:32
search_logsLoki{namespace="demo", service="payments"} != "card processor"minutes: 15
What it saw · 12 ms
{"window": "2026-11-01T01:55:48Z to 2026-11-01T02:10:48Z", "total_lines": 1, "truncated": false, "groups": [{"service": "payments", "pod": "payments-57c8769d78-dmb7m", "message": "service started", "first_seen": "2026-11-01T02:01:59Z", "last_seen": "2026-11-01T02:01:59Z", "example_fields": {"level": "info", "service": "payments", "release": "v1", "port": 8080}, "count": 1}]} - 0:32
search_logsLoki{namespace="demo", service=~"checkout|storefront", level="error"}minutes: 15
What it saw · 29 ms
{"window": "2026-11-01T01:55:48Z to 2026-11-01T02:10:48Z", "total_lines": 1, "truncated": false, "groups": [{"service": "checkout", "pod": "checkout-796f75ff98-9jk86", "message": "cart lookup failed: redis unavailable", "first_seen": "2026-11-01T02:01:57Z", "last_seen": "2026-11-01T02:01:57Z", "example_fields": {"level": "error", "service": "checkout", "release": "v1", "error": "Connection closed by server."}, "count": 1}]} - 0:35
I'm noticing card processor errors tied to pod 854f45fd8-gf9bv, which doesn't seem to exist, so these logs may be stale or mixed up. I'll pull the card processor logs for the current pod from the last 8 minutes instead.
- 0:35
search_logsLoki{namespace="demo", service="payments", pod="payments-57c8769d78-dmb7m"} |= "card processor"minutes: 10
What it saw · 30 ms · 1 masked before the model saw them
{"window": "2026-11-01T02:00:51Z to 2026-11-01T02:10:51Z", "total_lines": 289, "truncated": false, "groups": [{"service": "payments", "pod": "payments-57c8769d78-dmb7m", "message": "card processor request failed: upstream returned 503", "first_seen": "2026-11-01T02:02:24Z", "last_seen": "2026-11-01T02:10:44Z", "example_fields": {"level": "error", "service": "payments", "release": "v1", "route": "/charge", "customer": "[REDACTED:email]"}, "count": 289}]} - 0:35
query_metrics_rangePrometheusslo:sli_error:ratio_rate1m{slo="orders-succeed"}minutes: 60
What it saw · 7 ms
{"window": "2026-11-01T01:10:51Z to 2026-11-01T02:10:51Z", "total_series": 1, "series": [{"labels": {"__name__": "slo:sli_error:ratio_rate1m", "service": "storefront", "slo": "orders-succeed"}, "min": 0.0, "max": 0.5134, "first": 0.0, "last": 0.03571, "points": [{"minutes_ago": 55.0, "value": 0.0}, {"minutes_ago": 50.0, "value": 0.0}, {"minutes_ago": 45.0, "value": 0.0}, {"minutes_ago": 40.0, "value": 0.0}, {"minutes_ago": 35.0, "value": 0.0}, {"minutes_ago": 30.0, "value": 0.0}, {"minutes_ago": 25.0, "value": 0.04018}, {"minutes_ago": 20.0, "value": 0.0}, {"minutes_ago": 15.0, "value": 0.0}, {"minutes_ago": 10.0, "value": 0.0}, {"minutes_ago": 5.0, "value": 0.0}, {"minutes_ago": -0.0, "valu… - 0:53
I've pinned the root cause to payments' external card processor returning 503s, and since the errors began after the rollback to v1, this doesn't look like a release problem. The failures come in bursts with some ongoing low-level noise, and they cascade from payments through checkout to the storefront. There's no fix on my side for this one. Other agents have already rolled payments back twice (revisions 33 and 34), so I shouldn't do that again. Separately, all deployments and the load generator restarted together at 02:01:55, which may mean the whole environment was reset.
- 0:53
Report ready
payments (external card processor dependency) · Dependency failure
- 1:01
Closed by the eval runner before the next scenario
- 1:37
Postmortem draft written
The report
Customers are getting 502s when placing orders. The errors start in payments: its outside card processor keeps answering /charge with HTTP 503. Payments turns that into a 500, checkout passes it on as a 502, and storefront returns the 502 to the customer. Payments is already on the known-good release v1 and SREBot has rolled it back twice, so another rollback, restart or scale-up inside the cluster would not fix this.
Root cause
payments (external card processor dependency)Dependency failurehigh confidence
The external card processor that payments calls on /charge keeps returning HTTP 503 ('card processor request failed: upstream returned 503'). Payments returns 500 for those charges, and the error is passed back through checkout to storefront.
Evidence
- logsPayments error logs say 'card processor request failed: upstream returned 503' on route /charge, release v1. They began at 01:37:19Z and continue to 02:10:44Z. The current pod payments-57c8769d78-dmb7m alone logged 289 since 02:02:24Z.
- metricsPayments served 500s in bursts: about 0.6–0.9/s around 01:37–01:39Z, a small blip around 01:45Z, a peak of 2.78/s around 02:04Z, and about 0.11/s now. Over the same windows, checkout's calls to payments returned 500 (up to 1.92/s) and storefront returned 502 at matching rates (peak 2.06/s, 0.12/s now).
- metricsCheckout's calls to Redis stay healthy at about 4.97/s 'ok' with no errors, so Redis is not the cause. Storefront's orders-succeed 1m error ratio was 0 until 01:45Z, reached 4% then, and is 3.6% now, against a 99.9% objective.
- kubernetesPayments is on revision 34, release v1, created by an SREBot rollback at 02:01:53Z. Revision 33 was also an SREBot rollback to v1, at 01:36:54Z. The card processor errors began at 01:37:19Z, while v1 was running, and came back after the second rollback. So the release is not the cause.
- kubernetesAt about 02:01:55Z every Deployment (storefront, checkout, payments, redis, loadgen) got a new pod at the same time. They all became ready within seconds and none have restarted or been OOMKilled. Checkout logged a single 'redis unavailable' during that switchover. These were brief and are not the ongoing cause.
Fix SREBot can apply
None: the change belongs in code or configuration, so the report says what to change.
- Check the card processor provider's status page or support channel, and confirm the 503s are on their side: an outage, rate limiting, or a credential or account problem.
- Watch the payments 500 rate and the storefront SLO error ratio to see whether the provider's errors are intermittent and recovering.
sum by (status) (rate(http_requests_total{service="payments"}[1m])); slo:sli_error:ratio_rate5m{slo="orders-succeed"} - Do not roll back payments again. It is already on v1 (revision 34), and the errors continued after both earlier rollbacks.
kubectl -n demo rollout history deployment/payments
Postmortem draft: Card processor outage made customer orders fail with 502s
Customers got HTTP 502s when placing orders on storefront. The external card processor that payments calls on /charge kept returning HTTP 503. Payments turned that into a 500, checkout passed it on as a 502, and storefront returned the 502 to the customer. Errors began at 01:37:19 UTC and came in bursts. The error budget burn alert fired at 02:10:16 UTC, about 33 minutes later. SREBot found the cause in 52.9 seconds. No fix was applied, because the failure is outside the cluster. The incident was marked resolved by hand at 02:11:17 UTC while errors were still occurring at a low rate.
- P1 Add retries with backoff and a circuit breaker to the payments card processor client for /charge.
- P2 Make payments return a clear, retryable error when the card processor fails, and have checkout and storefront show customers a retryable message instead of a generic 502.
- P3 Evaluate adding a fallback card processor for payments when the primary returns 5xx.
- P1 Add an alert on the rate of payments card processor upstream errors (e.g. 'upstream returned 503' on /charge), so dependency failures page within minutes instead of waiting for SLO budget burn.
- P2 Review the orders-succeed burn-rate alert windows and thresholds, since the alert fired about 33 minutes after errors began.
- P1 Require a recovery check before an incident can be closed: storefront 502 rate and orders-succeed error ratio back to baseline for a set period.
- P2 Before an automated rollback, check that the error start lines up with a release change, and skip it when the target release is the one already running.
- P1 Contact the card processor provider to find out whether the 503s were an outage, rate limiting, or a credential or account problem. Record the provider's status page and support contact in the payments runbook.
- P3 Find out why every Deployment in the namespace got a new pod at about 02:01:55 UTC, and make such redeploys or resets visible in the event record.
- P2 Check whether a stray payments process from ReplicaSet payments-854f45fd8 is still running or whether the log labels are stale, and fix whichever it is.
A release points at an image tag that was never pushed. The old pod keeps serving, so customers see nothing, but the rollout is stuck. SREBot names the missing tag and, once approved, rolls back to the last healthy revision. Recorded with Claude Haiku 5.5.
- Alert
- Investigating
- Root cause
- Fix
- Recovered
- 0:00
Alert fired
Rollout of payments is stuck
- 0:20
Investigation started on claude-haiku-5-5
- 0:22
I'm starting the investigation by running several checks in parallel: rollout history, pod status, and events.
- 0:22
get_rollout_historyKubernetesnamespace: demo · deployment: payments
What it saw · 40 ms
{"deployment": "payments", "desired_replicas": 1, "ready_replicas": 1, "conditions": [{"type": "Available", "status": "True", "reason": "MinimumReplicasAvailable", "message": "Deployment has minimum availability.", "lastUpdateTime": "2026-10-31T20:52:18Z"}, {"type": "Progressing", "status": "False", "reason": "ProgressDeadlineExceeded", "message": "ReplicaSet \"payments-56588cbd97\" has timed out progressing.", "lastUpdateTime": "2026-10-31T21:04:11Z"}], "revisions": [{"revision": 23, "current": true, "created_at": "2026-10-31T17:36:11Z", "change_cause": "deploy demo-app:v5-missing", "image": "demo-app:v5-missing", "env": {"SERVICE_NAME": "payments", "RELEASE": "v1"}, "ready_replicas": 0}, {… - 0:22
list_podsKubernetesnamespace: demo
What it saw · 28 ms
{"namespace": "demo", "pods": [{"name": "checkout-5874464f85-fsz6p", "service": "checkout", "phase": "Running", "started_at": "2026-10-31T20:16:41Z", "containers": [{"name": "checkout", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "loadgen-c49b9d-k26q4", "service": "loadgen", "phase": "Running", "started_at": "2026-10-31T20:16:41Z", "containers": [{"name": "loadgen", "image": "demo-app:dev", "ready": true, "restarts": 0, "state": "running", "last_termination": null, "memory_limit": "128Mi"}]}, {"name": "payments-55f6585458-bvnmk", "service": "payments", "phase": "Running", "started_at": "2026-10-31T2… - 0:22
get_eventsKubernetesnamespace: demo · minutes: 30
What it saw · 35 ms
{"namespace": "demo", "events": [{"object": "Pod/payments-56588cbd97-fhpl4", "type": "Normal", "reason": "BackOff", "message": "Back-off pulling image \"demo-app:v5-missing\"", "count": 5, "last_seen": "2026-10-31T21:04:53Z"}, {"object": "Pod/payments-56588cbd97-fhpl4", "type": "Warning", "reason": "Failed", "message": "Error: ImagePullBackOff", "count": 5, "last_seen": "2026-10-31T21:04:53Z"}, {"object": "Pod/payments-56588cbd97-fhpl4", "type": "Normal", "reason": "Pulling", "message": "Pulling image \"demo-app:v5-missing\"", "count": 4, "last_seen": "2026-10-31T21:04:40Z"}, {"object": "Pod/payments-56588cbd97-fhpl4", "type": "Warning", "reason": "Failed", "message": "Failed to pull image \… - 0:32
I'm checking the stuck rollout: revision 23 points at demo-app:v5-missing, which isn't in the registry. The last healthy state looks like revision 22, which came from a rollback to revision 20 and has one ready replica. The running pod started at 20:52, so it's probably revision 20, though revision 22 was created at 17:08 and I'm still sorting out how those line up. I'm now weighing whether the running pod, started at 20:52:17 on demo-app:dev, is actually revision 20, since that revision is missing from the listing. Revision 22 is the last one with a ready replica and release v1, so rolling back to it would restore that image, though I haven't verified the environment yet. Rolling back to revision 22 looks like a sound move, since it's the last revision with a ready replica and it was itself a rollback to a healthy state. I'm also noting that a related incident, INC-E41C5A14, shows the same cause, and the events and rollout history together give me enough confidence to proceed without further checks. The plan is to undo the deployment to revision 22 now and then fix the bad image tag in the pipeline.
- 0:32
Report ready
payments · Bad deployment
- 0:32
Same cause: grouped into this incident
A new payments pod cannot start
- 0:32
Fix proposed, waiting for approval
Roll back payments to revision 22 (image demo-app:dev, release v1), the last healthy revision, to replace the unpullable demo-app:v5-missing image. (medium risk)
- 0:34
Approved by eval runner
- 0:34
Fix applied
- 0:49
Recovery verified after 15 s
- 0:58
Closed by the eval runner before the next scenario
- 1:08
Postmortem draft written
The report
The payments rollout to revision 23 is stuck because its image demo-app:v5-missing cannot be pulled (repository does not exist), so the new pod never starts and the progress deadline expired at 21:04:11. The previous healthy pod on demo-app:dev (revision 22, release v1) is still serving, so customers are not yet affected, but the deployment stays stuck until the bad revision is rolled back or the image is corrected.
Root cause
paymentsBad deploymenthigh confidence
Revision 23 (change cause 'deploy demo-app:v5-missing') points at an image tag that does not exist in the registry. Kubelet gets 'pull access denied, repository does not exist' and the pod sits in ErrImagePull/ImagePullBackOff, so the ReplicaSet never becomes ready and the Deployment reports ProgressDeadlineExceeded.
Evidence
- kubernetesPod payments-56588cbd97-fhpl4 (ReplicaSet of revision 23) was created at 21:03:11 with image demo-app:v5-missing and is in waiting state ErrImagePull, 0 restarts, 0 ready replicas.
- kubernetesEvents show 'Failed to pull image "demo-app:v5-missing": ... repository does not exist or may require authorization' repeated 4 times, then ImagePullBackOff with count 5 through 21:04:53.
- kubernetesDeployment payments conditions: Progressing=False reason ProgressDeadlineExceeded at 21:04:11 ('ReplicaSet payments-56588cbd97 has timed out progressing'); Available=True with 1 ready replica from the older revision.
- kubernetesRollout history: revision 23 (current, image demo-app:v5-missing, created 17:36:11) has ready_replicas 0. Revision 22 (rollback to revision 20 by SREBot, image demo-app:dev, RELEASE v1) has ready_replicas 1 and is the last revision that was healthy.
- alertDeploymentRolloutStuck fired at 21:04:25 for payments, matching the ProgressDeadlineExceeded timestamp and the pod start time.
Fix SREBot can apply
Roll back payments to revision 22 (image demo-app:dev, release v1), the last healthy revision, to replace the unpullable demo-app:v5-missing image. verified
Postmortem draft: Payments rollout stuck on unpullable image; customers stayed on the previous version
A new payments revision pointed at an image tag that does not exist in the registry, so its pod could never start and the rollout hit its progress deadline. The previous healthy pod kept serving traffic. SREBot identified the cause within about 32 seconds, and the deployment was rolled back to revision 22 (demo-app:dev, release v1). The incident was resolved at 21:05:36 UTC, about 58 seconds after it opened.
- P1 Add an image-existence check to the payments release pipeline so a tag missing from the registry fails the deploy before the rollout starts
- P2 Find out why demo-app:v5-missing was referenced, by checking the CI run that produced revision 23 and whether the tag was mistyped or never published, then fix the pipeline
- P2 Add an alert on ImagePullBackOff or ErrImagePull for deployments, so the on-call hears about a bad image as soon as the pod fails instead of waiting for the progress deadline
- P3 Make the rollout history readable: record the reason and source for each rollback, and confirm revision ordering in the cluster tooling
- P3 Document the rollback procedure for payments, including how to confirm which revision is the last healthy one before rolling back
A commit changes how discounts are rounded, and a unit test fails in GitHub Actions. SREBot reads the run, the log and the commit, and explains which business rule the code and the test disagree on. Recorded with Claude Haiku 5.5.
- Alert
- Investigating
- Root cause
- 0:00
Alert fired
Shop pipeline failed on lab/broken-test
- 0:20
Investigation started on claude-haiku-5-5
- 0:22
get_workflow_runGitHubrepo: batu-sonmez/srebot · run_id: 41249808938
What it saw · 549 ms
{"workflow": "Shop pipeline", "workflow_file": ".github/workflows/shop-pipeline.yml", "event": "workflow_dispatch", "branch": "lab/broken-test", "commit": "1a364b4fccf5d3229c150902cd19f99e3a7da21e", "commit_message": "Round discounts per item so receipt lines add up", "attempt": 1, "conclusion": "failure", "started_at": "2026-10-31T22:48:27Z", "finished_at": "2026-10-31T22:48:58Z", "triggered_by": "batu-sonmez", "jobs": [{"id": 124680769523, "name": "Vulnerability scan", "conclusion": "success", "started_at": "2026-10-31T22:48:29Z", "finished_at": "2026-10-31T22:48:57Z", "steps": ["1. Set up job: success", "2. Run actions/checkout@v7: success", "3. Block critical vulnerabilities in dependenc… - 0:23
get_job_logGitHubrepo: batu-sonmez/srebot · job_id: 124680769623 · lines: 40
What it saw · 356 ms
{"step_command": "Run python -m pytest tests -q\npython -m pytest tests -q\nshell: /usr/bin/bash -e {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib", "errors": ["Process completed with exit code 1."], "excerpt": "Successfully installed annotated-doc-0.0.5 annotated-types-0.8.0 anyio-4.15.1 certifi-2026.10.23 click-8.5.0 fastapi-0.162.0 h11-0.16.0 httpcore-1… - 0:23
get_commitGitHubrepo: batu-sonmez/srebot · sha: 1a364b4fccf5d3229c150902cd19f99e3a7da21e
What it saw · 274 ms
{"sha": "1a364b4fccf5d3229c150902cd19f99e3a7da21e", "message": "Round discounts per item so receipt lines add up", "author": "Batu Sonmez", "date": "2026-10-31T20:12:14Z", "parents": ["62db6d01cd52fe93021824722aaac203a50ac117"], "files": [{"file": "demo/app/pricing.py", "status": "modified", "additions": 4, "deletions": 4, "patch": "@@ -7,11 +7,11 @@\n \n def order_total(unit_price_cents: int, quantity: int, discount_percent: int = 0) -> int:\n \"\"\"What a customer pays, in cents: the order's price less a percentage\n- discount, rounded half up to a whole cent once for the whole order.\"\"\"\n+ discount. Each item is rounded half up to a whole cent, so the line totals\n+ on the… - 0:31
The per-item rounding change makes one unit price 1076 rather than 1075.5 rounded once at the order level, so the total comes to 3228 instead of the test's expected 3227. That means the code breaks a test that encodes the intended contract, and since the commit message says per-item rounding was deliberate and tests/test_pricing.py was left unchanged, the defect is in the code, not the test. The remaining plan is to give the fix options: revert the commit in demo/app/pricing.py, or align the test if per-item rounding is the intended business rule, and leave that call to the owner. A revert seems the safer recommendation, and I'd note it's a medium-risk git revert of 1a364b4. Rerunning the tests wouldn't change anything.
- 0:31
Report ready
Shop pipeline / Unit tests / Run unit tests · Code defect
- 0:37
Closed by the eval runner before the next scenario
The report
The Shop pipeline run failed in the Unit tests job, at the step that runs pytest. Commit 1a364b4 changed order_total in demo/app/pricing.py to round the discount per item instead of once per order, so test_discount_is_rounded_once_for_the_whole_order now gets 3228 instead of 3227. The Build image job was skipped as a result. This is a real failure, not a flaky one, and it needs a decision on which rounding rule is intended.
Root cause
Shop pipeline / Unit tests / Run unit testsCode defecthigh confidence
The commit 1a364b4 changed the rounding in demo/app/pricing.py from once per order to per item. For 3 x 1195 cents at 10% off, that gives 3 x round(1075.5) = 3 x 1076 = 3228, while the existing test expects 3227. The code change and the unchanged test disagree on the intended business rule.
Evidence
- pipelineRun 41249808938 (Shop pipeline, branch lab/broken-test, commit 1a364b4) concluded failure at 22:48:58Z. Vulnerability scan succeeded. Unit tests failed at step '5. Run unit tests'. Build image was skipped.
- logsUnit tests log:
FAILED tests/test_pricing.py::test_discount_is_rounded_once_for_the_whole_order - assert 3228 == 3227, withwhere 3228 = order_total(1195, 3, discount_percent=10). Result: '1 failed, 4 passed'. - logsThe test comment reads: '3 x 11.95 = 35.85, less 10% = 32.265, which rounds to 32.27', so the test expects a single rounding for the whole order.
- codeCommit 1a364b4 (message 'Round discounts per item so receipt lines add up', author Batu Sonmez) changes demo/app/pricing.py:
gross*(100-d)/100rounded once is replaced byunit = Decimal(unit_price_cents) * (100 - discount_percent) / 100, rounded per unit and then multiplied by quantity. The docstring is updated to match. tests/test_pricing.py is not changed by the commit.
Fix SREBot can apply
None: the change belongs in code or configuration, so the report says what to change.
- Decide which rounding rule is correct. If once-per-order rounding is still the rule, revert commit 1a364b4 (or restore the previous
order_totalin demo/app/pricing.py) so the existing test passes. If per-item rounding is the new rule, update the expected value in tests/test_pricing.py::test_discount_is_rounded_once_for_the_whole_order to 3228 and rename or rewrite the test to match. Either way, push the fix to lab/broken-test and rerun the pipeline.git revert 1a364b4 && git push origin lab/broken-test - Do not rerun the pipeline unchanged. The failure is deterministic and will repeat until the code or the test is changed.
A commit pins PyJWT 1.7.1, and the Trivy gate blocks the build for a critical vulnerability. SREBot names the package, the CVE and the version that fixes it, and says that rerunning will not help. Recorded with Claude Haiku 5.5.
- Alert
- Investigating
- Root cause
- 0:00
Alert fired
Shop pipeline failed on lab/vulnerable-dependency
- 0:20
Investigation started on claude-haiku-5-5
- 0:22
get_workflow_runGitHubrepo: batu-sonmez/srebot · run_id: 41250203854
What it saw · 707 ms
{"workflow": "Shop pipeline", "workflow_file": ".github/workflows/shop-pipeline.yml", "event": "workflow_dispatch", "branch": "lab/vulnerable-dependency", "commit": "603a52b214a7827423527a110208ba8b22f75b9c", "commit_message": "Add PyJWT to verify signed callbacks from the payment provider", "attempt": 1, "conclusion": "failure", "started_at": "2026-10-31T22:53:58Z", "finished_at": "2026-10-31T22:54:31Z", "triggered_by": "batu-sonmez", "jobs": [{"id": 124681942611, "name": "Unit tests", "conclusion": "success", "started_at": "2026-10-31T22:54:01Z", "finished_at": "2026-10-31T22:54:15Z", "steps": ["1. Set up job: success", "2. Run actions/checkout@v7: success", "3. Run actions/setup-python@v7… - 0:24
get_job_logGitHubrepo: batu-sonmez/srebot · job_id: 124681942795 · lines: 40
What it saw · 458 ms
{"step_command": "Run entrypoint.sh\nentrypoint.sh\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n INPUT_SCAN_TYPE: fs\n INPUT_IMAGE_REF: \n INPUT_SCAN_REF: demo/app\n INPUT_TRIVYIGNORES: \n INPUT_GITHUB_PAT: \n INPUT_LIMIT_SEVERITIES_FOR_SARIF: \n TRIVY_CACHE_DIR: /home/runner/work/srebot/srebot/.cache/trivy", "errors": ["Process completed with exit code 1."], "excerpt": "\n\n\ud83d\udce3 Notices:\nReport Summary\n\n - Version 0.76.1 of Trivy is now available, current version is 0.70.0\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u250… - 0:24
get_commitGitHubrepo: batu-sonmez/srebot · sha: 603a52b214a7827423527a110208ba8b22f75b9c
What it saw · 310 ms
{"sha": "603a52b214a7827423527a110208ba8b22f75b9c", "message": "Add PyJWT to verify signed callbacks from the payment provider", "author": "Batu Sonmez", "date": "2026-10-31T20:12:15Z", "parents": ["62db6d01cd52fe93021824722aaac203a50ac117"], "files": [{"file": "demo/app/requirements.txt", "status": "modified", "additions": 1, "deletions": 0, "patch": "@@ -3,3 +3,4 @@ uvicorn==0.54.0\n httpx==0.28.1\n redis==8.1.0\n prometheus-client==0.26.0\n+pyjwt==1.7.1"}]} - 0:30
The pinned pyjwt==1.7.1 has a critical CVE fixed in 2.14.0, which is what blocked the Trivy gate, so I'm weighing a bump to pyjwt>=2.14.0 as the fix. This counts as a security finding since the scanner gate rejected it, and the fix kind is none. The lab branch name might mean it's intentional, but my confidence is high. I'm going to edit line 6 of the requirements file to pin pyjwt to 2.14.0 or the latest release, then push a new commit, since rerunning the failed job wouldn't pick up the change. There are no related incidents to flag.
- 0:30
Report ready
Vulnerability scan / Block critical vulnerabilities in dependencies · Security finding
The report
The Shop pipeline run failed in the Vulnerability scan job because Trivy found a CRITICAL CVE (CVE-2026-102268, authentication bypass) in pyjwt 1.7.1. Commit 603a52b pinned pyjwt==1.7.1 in demo/app/requirements.txt, and the fixed version is 2.14.0. The Build image job was skipped as a result; the change needs a newer PyJWT pin, not a rerun.
Root cause
Vulnerability scan / Block critical vulnerabilities in dependenciesSecurity findinghigh confidence
The commit added an outdated pin, pyjwt==1.7.1, to demo/app/requirements.txt. Trivy reports CVE-2026-102268 (CRITICAL) against it, with the fix in 2.14.0, and the severity gate fails the job.
Evidence
- pipelineRun 41250203854 (Shop pipeline, branch lab/vulnerable-dependency, commit 603a52b) concluded failure. Unit tests succeeded. Vulnerability scan failed at step 'Block critical vulnerabilities in dependencies'. Build image was skipped.
- logsTrivy scan of requirements.txt (pip): 'Total: 1 (CRITICAL: 1)'. The row reads: pyjwt, CVE-2026-102268, CRITICAL, fixed, installed 1.7.1, fixed version 2.14.0, 'PyJWT: Authentication bypass via improper public key validation'. The step then exited with 'Process completed with exit code 1.'
- codeCommit 603a52b, 'Add PyJWT to verify signed callbacks from the payment provider', changes demo/app/requirements.txt (+1 line, line 6): '+pyjwt==1.7.1'. This is the only file changed.
Fix SREBot can apply
None: the change belongs in code or configuration, so the report says what to change.
- On branch lab/vulnerable-dependency, change demo/app/requirements.txt line 6 from pyjwt==1.7.1 to pyjwt==2.14.0 or later, commit, and push. This clears the CRITICAL finding and lets Build image run.
sed -i 's/^pyjwt==1.7.1$/pyjwt==2.14.0/' demo/app/requirements.txt && git commit -am 'Bump PyJWT to 2.14.0 (CVE-2026-102268)' && git push - After the bump, confirm the Unit tests job still passes, since PyJWT 1.x to 2.x is a major upgrade with API changes that may affect the callback verification code.
- Do not rerun this run as-is. It will fail again on the same pinned version. Only re-run after the pin is changed.
The console
The team works in SREBot's own console: service health and SLOs, incidents with their reports and timelines, approvals, and the chaos lab.


How it works
- 01
Detect
Prometheus and Alertmanager send alerts, including SLO burn-rate alerts, and a watcher polls GitHub Actions for failed runs. SREBot opens one incident per problem: repeats are deduplicated, and alerts with the same cause are grouped.
- 02
Investigate
An agent loop on the Claude API picks its own next step: PromQL, LogQL, Kubernetes rollouts and events, or a run's logs, commits and files. Every tool is read-only, results are masked before the model sees them, and the loop has a budget.
- 03
Report
The answer is structured, not prose: where the failure starts, what kind of failure it is, how sure SREBot is, the evidence, and the recommended actions with their risk.
- 04
Fix
If a rollback, a scale-up or a restart would restore service, the report proposes one. Code, not the model, rates the risk, and nothing runs until a person approves. Then SREBot watches the metrics to confirm recovery.
- 05
Learn
When the incident resolves, SREBot drafts a blameless postmortem from its own timeline: impact, detection, root cause, what went well and the action items.
Reads
- Prometheus
- Loki
- Kubernetes API
- GitHub API
- Runbooks
Only an approved fix crosses this line, through a separate, opt-in role.
Writes
- rollback
- scale
- restart
Built so it cannot make things worse
An agent that can touch production has to be boring in the right places. These are the rules SREBot runs by.
Read-only by default
The investigator's tools can only read. Apart from the demo's chaos lab, the one write path is an approved fix, and it needs a separate, opt-in Kubernetes Role that can patch and scale Deployments in the watched namespaces and nothing else.
The model proposes, code decides
A fix is one of three typed actions: roll back, scale up or restart a Deployment. A policy in code rates the risk and blocks what it does not allow, whatever the model asked for.
A person approves
Every fix waits for an approval in the console. Who decided, when, and what happened next are recorded on the incident's timeline.
Verified, not assumed
After a change, SREBot checks that the service recovered. A fix that did not help is reported as unverified instead of quietly closing the incident.
Masked before the model
Keys, tokens, email addresses, card numbers and public IP addresses are masked in tool results before they reach the model, and the timeline records how many values were masked.
Untrusted text stays data
Logs and commit messages can contain text that looks like instructions. The prompts treat tool results as data, GitHub access is limited to the watched repositories, and the agent cannot run commands.
Bounded cost
Each investigation has a cap on tool calls and on cost, and SREBot stops starting new ones when the day's model budget is spent. Tokens, cost and latency are Prometheus metrics with their own dashboard.
Measured, not assumed
Every lab scenario has an expected answer: where the failure starts, what kind of failure it is, which fix to propose, and facts the report has to state. A runner starts each scenario on the live system, waits for the report and grades it. Where a fix was proposed, it approves the fix through the same API as the console and waits for SREBot to verify recovery. Grading is field and text checks, so no model grades another model.
| Scenario | Claude Haiku 5.5 | Claude Opus 5.5 |
|---|---|---|
| Production | ||
| Payment provider outage | correct | correct |
| A few payments fail | correct | correct |
| Slow payments release | correct | correct |
| Memory leak in payments | correct | correct |
| Cart database outage | correct | correct |
| Delivery | ||
| Deploy with a missing image | correct | not run |
| Deploy that needs a missing secret | correct | not run |
| Release that never gets ready | correct | not run |
| CI pipeline | ||
| A change breaks a unit test | correct | not run |
| A dependency version that does not exist | correct | not run |
| A publish step without its secret | correct | not run |
| A dependency with a critical CVE | correct | not run |
| 12 of 12 correct · median 33 s to report · $0.04 in total | 5 of 5 correct · median 46 s to report · $0.67 in total | |
Claude Haiku 5.5 runs every scenario at a fraction of a cent. Claude Opus 5.5, which recorded the production replays above, ran the five production scenarios and got all five right, at about $0.13 per investigation; the rest were left out to keep model budget for live demos.
The first pipeline run found a real problem: the prompt let a dependency pinned to a version that does not exist pass as a code defect. After rewording the prompt to classify failures by what is broken, the next run got it right. Finding that kind of mistake is what the evals are for.
In these runs and in the replays above, “eval runner” is the runner pressing Approve.
Runs like production
SREBot is deployed the way a team would run it, so the demo also exercises the platform work around it.
Infrastructure as code
Terraform creates the kind cluster, installs Argo CD and points it at the repository. One command builds everything; another tears it down.
GitOps
An Argo CD app-of-apps deploys the rest from Helm charts: the monitoring stack, the demo shop and SREBot itself.
Observability and SLOs
Prometheus, Alertmanager, Loki, Tempo and Grafana. SLOs are Kubernetes resources: an operator written in Go turns each one into recording rules and multiwindow, multi-burn-rate alerts, unit-tested with promtool.
Console and MCP
A React console for incidents, approvals and the chaos lab, and an MCP server, so Claude Code or another agent can read incidents and use SREBot's tools behind a token.
Quality gates
Every pull request runs ruff, mypy, pytest with a 90% coverage gate, the console's checks, helm lint, kubeconform, Terraform validation, promtool tests and a Trivy scan.
Decisions and trade-offs
- An agent loop, not one big prompt
- Collecting every metric and log into one prompt is cheaper per call, but it guesses up front what matters. Letting the model choose its queries costs a few more calls and finds causes two hops away, such as checkout errors that start in Redis.
- Approval before any change
- Full autonomy is not trustworthy yet, and an incident is the worst time to find that out. Proposing one typed fix and waiting for a person keeps the speed of the investigation and leaves the judgement with the team.
- Deterministic evals
- Because the report is structured, grading is field and text checks. Results are reproducible and cheap, and the checks caught a prompt mistake that a model acting as judge could have explained away.
- Pipelines are incidents too
- Many production problems start in delivery. A failed GitHub Actions run becomes an incident with its own read-only tools, so CI failures get the same timeline, report and process.
- A cheap model for daily work
- Development and most eval runs use Claude Haiku 5.5 at under a cent per incident; the recordings here use Claude Opus 5.5. The model is one deployment setting, so the choice is easy to revisit.
What I would build next
- An independent verifier that tries to disprove the first hypothesis before the report goes out.
- Memory across incidents, so a repeat failure starts from what was learned the last time.
- More sources through MCP, such as Datadog, Sentry, PagerDuty, Slack and Jenkins.
- A pilot on real traffic, measuring time to mitigation before and after.
Stack
- Python
- FastAPI
- Claude API
- MCP
- React
- TypeScript
- Kubernetes
- Helm
- Argo CD
- Terraform
- Prometheus
- Alertmanager
- Loki
- Tempo
- Grafana
- OpenTelemetry
- GitHub Actions
- Trivy