# ashkmb.com: full text
> Ashkan Kamyab is a Senior DevOps and infrastructure engineer in Berlin. This site has hands-on writing on Kubernetes, AWS, Terraform, CI/CD, observability and self-hosted AI agents, in English, German and Persian.
---
# Multi-user Hermes Agent on Kubernetes
> Give every person on your team their own Hermes Agent on one Kubernetes cluster. Each user gets a namespace, a Helm release, a volume, a secret, a network policy and an HTTPS hostname, so no agent can read another's memory or files, use another's API key or dashboard password, or connect to another agent directly inside the cluster. Every command here was run end to end on a fresh cluster.
- URL: https://ashkmb.com/tutorials/multi-user-hermes-agent-kubernetes/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-20
- Language: en
- Difficulty: intermediate
- Duration: 60 min
- Prerequisites: Docker, for a local practice cluster with kind (or any cluster whose CNI enforces NetworkPolicy); kubectl 1.36 or newer, Helm 3.8 or newer (OCI charts), kind, curl, openssl and python3; An OpenRouter API key, ideally a separate one with a small credit limit
- Tested: 2026-11-20; kubernetes 1.37.0 (kind 0.33.0); hermes-agent v2026.9.24 (0.21.5); helm 4.3.1; calico 3.33.1; envoy-gateway 1.10.0 (Gateway API 1.6.1); cert-manager 1.21.3
By the end of this tutorial, every person on your team has their own [Hermes Agent](https://github.com/NousResearch/hermes-agent) running on one Kubernetes cluster, at their own HTTPS address such as `alice.hermes.example.com`. Each agent lives in its own namespace with its own volume, secret and API key. Network policy stops any agent from connecting to another directly, and none of them holds credentials for the Kubernetes API. Adding a person is one command.
I ran every command below in order on a fresh local cluster before publishing. The versions are in the box above. If you have a cluster already, the only hard requirement is a CNI that enforces NetworkPolicy, which kind's default one does not.
## Why one Hermes per user
Hermes can serve several people from one process. Its messaging gateway has user allowlists, and its profiles give each agent its own config and memory. Both share one process and one filesystem, though. The agent has a real shell (the default terminal backend is `local`, so it runs commands inside its own container), and anything one person's agent can read, another person's agent can read too.
So the unit of isolation here is the pod: one namespace, one Deployment, one volume per person. Kubernetes then gives you hard boundaries for free: separate filesystems, separate secrets, network policy and resource quotas.
Is a general agent per person the right tool at all? I moved my own automation from Hermes to [fixed pipelines](https://ashkmb.com/blog/why-i-left-hermes-agent/), because my jobs were known in advance. A team that wants a general assistant, one that answers open questions, browses and runs tools on request, is exactly where a general agent fits. If you only need one agent for yourself, the [single-user version on EKS](https://ashkmb.com/blog/hermes-agent-eks-deployment/) is simpler.
## What you'll build
```mermaid
flowchart TB
alice(["https://alice.hermes.example.com"])
bob(["https://bob.hermes.example.com"])
gw["Gateway hermes Envoy Gateway, wildcard TLS from cert-manager"]
alice --> gw
bob --> gw
subgraph A["namespace hermes-alice"]
adep["Deployment hermes, 1 pod :8642 API (/v1), :9119 dashboard (/)"]
apvc[("PVC hermes-data /opt/data: memory")]
asec[/"Secret hermes-secrets keys, password"/]
apol["NetworkPolicy, quota in: gateway only out: DNS + public HTTPS"]
adep --- apvc
adep --- asec
adep --- apol
end
subgraph B["namespace hermes-bob"]
bdep["Deployment hermes, 1 pod same chart, own values"]
bown["own PVC, Secret, NetworkPolicy, quota"]
bdep --- bown
end
gw --> adep
gw --> bdep
```
Everything per user comes from one small Helm chart that you write in Step 3. The gateway and the certificate are shared and installed once.
Before you start, put your OpenRouter key in your shell. All later commands read it from there:
```bash no-run
export OPENROUTER_API_KEY='sk-or-...'
```
Create a working directory for the files you are about to write:
```bash
mkdir -p hermes-k8s && cd hermes-k8s
```
## Step 1: Create a practice cluster
Skip this step if you already have a cluster whose CNI enforces NetworkPolicy (Calico, Cilium and most managed offerings do).
kind's default CNI accepts NetworkPolicy objects and then ignores them: the policies look applied while every connection still goes through, and the isolation checks in Step 9 fail. So the cluster starts without a CNI and gets [Calico](https://docs.tigera.io/calico/latest/about/):
```bash
cat > kind-hermes.yaml <<'EOF'
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
disableDefaultCNI: true # kind's default CNI ignores NetworkPolicy; Calico enforces it
podSubnet: 192.168.0.0/16
nodes:
- role: control-plane
- role: worker
EOF
kind create cluster --name hermes --config kind-hermes.yaml --image kindest/node:v1.37.0
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.33.1/manifests/calico.yaml >/dev/null
kubectl -n kube-system rollout status ds/calico-node --timeout=300s
kubectl wait --for=condition=Ready nodes --all --timeout=180s
```
**Verify:** both nodes are `Ready`.
```bash
kubectl get nodes
```
```text
NAME STATUS ROLES AGE VERSION
hermes-control-plane Ready control-plane 2m v1.37.0
hermes-worker Ready 2m v1.37.0
```
## Step 2: Install Envoy Gateway and cert-manager
Users reach their agent over HTTPS through the [Gateway API](https://gateway-api.sigs.k8s.io/). **Envoy Gateway** implements it and installs the Gateway API CRDs with its chart. I picked the Gateway API over an Ingress controller on purpose: the community ingress-nginx project was archived in March 2026 ([what that meant in practice](https://ashkmb.com/blog/ingress-nginx-archived-upstream/)). **cert-manager** issues the TLS certificate.
```bash
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.10.0 \
-n envoy-gateway-system --create-namespace --wait >/dev/null
helm install cert-manager oci://quay.io/jetstack/charts/cert-manager --version v1.21.3 \
-n cert-manager --create-namespace --set crds.enabled=true --wait >/dev/null
```
**Verify:** both controllers are running and the Gateway API CRDs exist.
```bash
kubectl get deploy -n envoy-gateway-system envoy-gateway -o jsonpath='{.status.readyReplicas}{"\n"}'
kubectl get deploy -n cert-manager cert-manager -o jsonpath='{.status.readyReplicas}{"\n"}'
kubectl get crd gateways.gateway.networking.k8s.io -o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/bundle-version}{"\n"}'
```
```text
1
1
v1.6.1
```
## Step 3: Write the per-user Helm chart
The chart creates everything one user needs inside their namespace. Two facts about the official image shape it.
**The image starts as root and then drops to an unprivileged user.** Its init system (s6-overlay) fixes ownership of the data volume, then runs every Hermes process as user `hermes` (UID 10000). Setting `runAsNonRoot` breaks that start, and the image refuses an arbitrary `--user`. So the pod keeps the default entrypoint, but with privilege escalation off, every Linux capability dropped except the five the init needs, and the default seccomp profile.
**The model is pinned in Hermes' own config.** The gateway reads the model from `config.yaml` on the volume. The image's default is a large, expensive model, and an environment variable does not override it for the gateway. An init container runs `hermes config set` on every start, so the Helm value stays the source of truth.
The files:
```bash
mkdir -p charts/hermes-user/templates
cat > charts/hermes-user/Chart.yaml <<'EOF'
apiVersion: v2
name: hermes-user
description: One isolated Hermes Agent for one user
type: application
version: 0.1.0
appVersion: "v2026.9.24"
EOF
cat > charts/hermes-user/values.yaml <<'EOF'
# The user this release belongs to. Used in labels and the hostname.
user: ""
image:
repository: nousresearch/hermes-agent
tag: v2026.9.24
pullPolicy: IfNotPresent
# Model the agent uses, through OpenRouter.
model: google/gemini-2.5-flash
# Secret (created outside Helm) holding OPENROUTER_API_KEY, API_SERVER_KEY,
# HERMES_DASHBOARD_BASIC_AUTH_PASSWORD and HERMES_DASHBOARD_BASIC_AUTH_SECRET.
existingSecret: hermes-secrets
storage:
size: 5Gi
storageClassName: "" # empty = cluster default
resources:
requests: { cpu: 250m, memory: 512Mi }
limits: { cpu: "2", memory: 2Gi }
quota:
cpu: "2"
memory: 4Gi
storage: 20Gi
gateway:
enabled: false
name: hermes
namespace: hermes-gateway
domain: hermes.example.com # the user gets .
EOF
cat > charts/hermes-user/templates/_helpers.tpl <<'EOF'
{{- define "hermes.labels" -}}
app.kubernetes.io/name: hermes
app.kubernetes.io/instance: {{ .Release.Name }}
hermes.example.com/user: {{ required "set --set user=" .Values.user | quote }}
{{- end }}
{{- define "hermes.selector" -}}
app.kubernetes.io/name: hermes
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
EOF
```
The ServiceAccount mounts no token, so the agent's shell has no credentials for the Kubernetes API. The volume is kept when the release is uninstalled, because it holds the user's memory:
```bash
cat > charts/hermes-user/templates/serviceaccount.yaml <<'EOF'
apiVersion: v1
kind: ServiceAccount
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
automountServiceAccountToken: false
EOF
cat > charts/hermes-user/templates/pvc.yaml <<'EOF'
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hermes-data
labels: {{- include "hermes.labels" . | nindent 4 }}
annotations:
helm.sh/resource-policy: keep # uninstalling the release keeps the user's memory
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: {{ .Values.storage.size }}
{{- with .Values.storage.storageClassName }}
storageClassName: {{ . }}
{{- end }}
EOF
```
The Deployment runs the gateway with the OpenAI-compatible API server (port 8642) and the web dashboard (port 9119) in one pod. The dashboard refuses to start on a non-loopback address without an auth provider, so it gets the built-in username and password provider:
```bash
cat > charts/hermes-user/templates/deployment.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
replicas: 1
strategy:
type: Recreate # the volume is ReadWriteOnce: never two pods at once
selector:
matchLabels: {{- include "hermes.selector" . | nindent 6 }}
template:
metadata:
labels: {{- include "hermes.labels" . | nindent 8 }}
spec:
serviceAccountName: hermes
automountServiceAccountToken: false
securityContext:
seccompProfile: { type: RuntimeDefault }
initContainers:
# Pin the model in the user's config.yaml on every start, so the Helm value is the source of truth.
- name: set-model
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["sh", "-c"]
args:
- |
hermes config set model.provider openrouter &&
hermes config set model.default "$MODEL"
env:
- { name: MODEL, value: {{ .Values.model | quote }} }
- { name: HERMES_DOCKER_EXEC_AS_ROOT, value: "1" }
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
add: [CHOWN, DAC_OVERRIDE, FOWNER]
volumeMounts:
- { name: data, mountPath: /opt/data }
containers:
- name: hermes
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["gateway", "run"]
env:
- { name: API_SERVER_ENABLED, value: "true" }
- { name: API_SERVER_HOST, value: "0.0.0.0" }
- { name: API_SERVER_MODEL_NAME, value: {{ printf "hermes-%s" .Values.user | quote }} }
- { name: HERMES_DASHBOARD, value: "1" }
- { name: HERMES_DASHBOARD_BASIC_AUTH_USERNAME, value: {{ .Values.user | quote }} }
envFrom:
- secretRef:
name: {{ .Values.existingSecret }}
ports:
- { name: api, containerPort: 8642 }
- { name: dashboard, containerPort: 9119 }
readinessProbe:
httpGet: { path: /health, port: api }
periodSeconds: 10
livenessProbe:
httpGet: { path: /health, port: api }
initialDelaySeconds: 60
periodSeconds: 30
resources: {{- toYaml .Values.resources | nindent 12 }}
securityContext:
# The image's init starts as root, fixes ownership of /opt/data,
# then runs every Hermes process as the unprivileged user hermes (UID 10000).
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
add: [CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID]
volumeMounts:
- { name: data, mountPath: /opt/data }
volumes:
- name: data
persistentVolumeClaim:
claimName: hermes-data
EOF
cat > charts/hermes-user/templates/service.yaml <<'EOF'
apiVersion: v1
kind: Service
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
selector: {{- include "hermes.selector" . | nindent 4 }}
ports:
- { name: api, port: 8642, targetPort: api }
- { name: dashboard, port: 9119, targetPort: dashboard }
EOF
```
A quota caps what one user can consume, so one runaway agent cannot starve the others:
```bash
cat > charts/hermes-user/templates/quota.yaml <<'EOF'
apiVersion: v1
kind: ResourceQuota
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
hard:
limits.cpu: {{ .Values.quota.cpu | quote }}
limits.memory: {{ .Values.quota.memory }}
requests.storage: {{ .Values.quota.storage }}
persistentvolumeclaims: "2"
pods: "4"
---
apiVersion: v1
kind: LimitRange
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
limits:
- type: Container
default: { cpu: 500m, memory: 512Mi }
defaultRequest: { cpu: 100m, memory: 128Mi }
EOF
```
**Verify:** the chart lints cleanly.
```bash
helm lint ./charts/hermes-user --set user=alice | tail -1
```
```text
1 chart(s) linted, 0 chart(s) failed
```
## Step 4: Add the first user
Each user gets a namespace (labelled as a tenant, which the gateway uses in Step 7) and a Secret with four values: the OpenRouter key, a random API key for their agent, and a random dashboard password plus session-signing secret. The Secret is created outside Helm, so the keys never land in a values file or in Helm's release history.
To keep the example short, every user gets the same OpenRouter key. Each agent can read the keys in its own environment, so on a real team give each person their own OpenRouter key (see Hardening).
```bash
u=alice
kubectl create namespace hermes-$u
kubectl label namespace hermes-$u hermes.example.com/tenant=true
kubectl -n hermes-$u create secret generic hermes-secrets \
--from-literal=OPENROUTER_API_KEY="$OPENROUTER_API_KEY" \
--from-literal=API_SERVER_KEY="$(openssl rand -hex 32)" \
--from-literal=HERMES_DASHBOARD_BASIC_AUTH_PASSWORD="$(openssl rand -hex 16)" \
--from-literal=HERMES_DASHBOARD_BASIC_AUTH_SECRET="$(openssl rand -hex 32)"
helm install hermes ./charts/hermes-user -n hermes-$u --set user=$u --wait --timeout 10m >/dev/null
```
The first start pulls a large image, so `--wait` can take a few minutes.
**Verify:** the pod is running and the init container pinned the model.
```bash
kubectl -n hermes-alice get pods
kubectl -n hermes-alice logs deploy/hermes -c set-model
```
```text
NAME READY STATUS RESTARTS AGE
hermes-6d9f8b7c4d-x2k8p 1/1 Running 0 3m
✓ Set model.provider = openrouter in /opt/data/config.yaml
✓ Set model.default = google/gemini-2.5-flash in /opt/data/config.yaml
```
## Step 5: Talk to your agent
Before any public hostname exists, reach Alice's agent through a port-forward. Her API key is in her Secret:
```bash
kubectl -n hermes-alice port-forward svc/hermes 8642:8642 >/dev/null &
PF=$!
sleep 3
ALICE_KEY=$(kubectl -n hermes-alice get secret hermes-secrets -o jsonpath='{.data.API_SERVER_KEY}' | base64 -d)
curl -s localhost:8642/health; echo
curl -s -o /dev/null -w 'without a key: %{http_code}\n' localhost:8642/v1/models
```
```text
{"status": "ok", "platform": "hermes-agent", "version": "0.21.5"}
without a key: 401
```
Now a real request. The API speaks the OpenAI chat format, so any OpenAI-compatible client works too:
```bash
curl -s localhost:8642/v1/chat/completions \
-H "Authorization: Bearer $ALICE_KEY" -H 'Content-Type: application/json' \
-d '{"model": "hermes-alice", "messages": [{"role": "user", "content": "Reply with exactly: hello from alice"}]}' \
| python3 -c 'import sys, json; print(json.load(sys.stdin)["choices"][0]["message"]["content"])'
kill $PF
```
**Verify:** the agent answers through the model.
```text
hello from alice
```
The dashboard works the same way on port 9119. Her username is `alice`, and the password is `HERMES_DASHBOARD_BASIC_AUTH_PASSWORD` in her Secret.
## Step 6: Lock down the network
Right now any pod in the cluster can reach Alice's agent, and her agent can reach anything. Three policies fix that: deny everything, then allow DNS and HTTPS to the public internet out, and allow only the gateway's proxies in.
The outbound rule is deliberately broad. Hermes is a general assistant whose web tools need the open internet, and a standard NetworkPolicy cannot match hostnames anyway. What it does exclude matters more: every private range, so no other tenant's pod, no cluster-internal service address and no cloud metadata endpoint (`169.254.169.254`, where node credentials live on most clouds).
Two things this policy does not stop. Through the public Gateway, one user's agent can reach another user's hostname like any client on the internet, so there the per-user API key and dashboard password are what protect it. And if your cluster's API server has a public endpoint, the agent can reach it on port 443; the missing token and RBAC are what stop it there. To close the first gap, add your Gateway's load balancer address to the `except` list.
```bash
cat >> charts/hermes-user/values.yaml <<'EOF'
networkPolicy:
enabled: true
# Namespace of the gateway's proxy pods, the only allowed inbound source.
proxyNamespace: envoy-gateway-system
EOF
cat > charts/hermes-user/templates/networkpolicy.yaml <<'EOF'
{{- if .Values.networkPolicy.enabled }}
# 1. Nothing in or out by default.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
podSelector: {}
policyTypes: [Ingress, Egress]
---
# 2. Out: DNS, and HTTPS to the public internet only (model API, web tools).
# Private ranges are excluded: no other tenant, no cluster service, no cloud metadata.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: hermes-egress
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels: {{- include "hermes.selector" . | nindent 6 }}
policyTypes: [Egress]
egress:
- to:
- namespaceSelector:
matchLabels: { kubernetes.io/metadata.name: kube-system }
podSelector:
matchLabels: { k8s-app: kube-dns }
ports:
- { protocol: UDP, port: 53 }
- { protocol: TCP, port: 53 }
- to:
- ipBlock:
cidr: 0.0.0.0/0
except: [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16]
ports:
- { protocol: TCP, port: 443 }
---
# 3. In: only from the gateway's proxies.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: hermes-ingress
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels: {{- include "hermes.selector" . | nindent 6 }}
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector:
matchLabels: { kubernetes.io/metadata.name: {{ .Values.networkPolicy.proxyNamespace }} }
ports:
- { protocol: TCP, port: 8642 }
- { protocol: TCP, port: 9119 }
{{- end }}
EOF
helm upgrade hermes ./charts/hermes-user -n hermes-alice --set user=alice --wait >/dev/null
```
**Verify:** the policies exist, the agent still reaches the internet, and the metadata address times out (`curl` exit code 28).
```bash
kubectl -n hermes-alice get networkpolicy
kubectl -n hermes-alice exec deploy/hermes -c hermes -- \
curl -s -m 8 -o /dev/null -w 'public HTTPS: %{http_code}\n' https://openrouter.ai/api/v1/models
kubectl -n hermes-alice exec deploy/hermes -c hermes -- \
sh -c 'curl -s -m 5 http://169.254.169.254/ || echo "metadata: blocked (exit $?)"'
```
```text
NAME POD-SELECTOR AGE
default-deny 5s
hermes-egress app.kubernetes.io/instance=hermes,app.kubernetes.io/name=hermes 5s
hermes-ingress app.kubernetes.io/instance=hermes,app.kubernetes.io/name=hermes 5s
public HTTPS: 200
metadata: blocked (exit 28)
```
## Step 7: Expose each user on their own hostname
One shared Gateway terminates TLS for `*.hermes.example.com` and accepts routes only from namespaces labelled as tenants. Each user's release adds an HTTPRoute for their own hostname: `/v1` goes to the API, everything else to the dashboard.
For practice, cert-manager creates a small private CA and signs the wildcard certificate with it. **In production**, replace the `hermes-ca` ClusterIssuer with Let's Encrypt and a DNS-01 solver (a wildcard certificate needs DNS-01), and point `*.hermes.example.com` at the Gateway's address.
```bash
mkdir -p platform
cat > platform/gateway.yaml <<'EOF'
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: v1
kind: Namespace
metadata:
name: hermes-gateway
---
# Practice CA: a self-signed root that signs the wildcard certificate.
# In production, replace the "hermes-ca" ClusterIssuer with Let's Encrypt and a DNS-01 solver
# (a wildcard certificate needs DNS-01).
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: hermes-practice-ca
namespace: cert-manager
spec:
isCA: true
commonName: hermes-practice-ca
secretName: hermes-practice-ca
privateKey: { algorithm: ECDSA, size: 256 }
issuerRef: { name: selfsigned, kind: ClusterIssuer }
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: hermes-ca
spec:
ca:
secretName: hermes-practice-ca
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: hermes-wildcard
namespace: hermes-gateway
spec:
secretName: hermes-wildcard-tls
commonName: "*.hermes.example.com"
dnsNames: ["*.hermes.example.com"]
issuerRef: { name: hermes-ca, kind: ClusterIssuer }
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: hermes
namespace: hermes-gateway
spec:
gatewayClassName: eg
listeners:
- name: https
protocol: HTTPS
port: 443
hostname: "*.hermes.example.com"
tls:
mode: Terminate
certificateRefs:
- name: hermes-wildcard-tls
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
hermes.example.com/tenant: "true"
EOF
kubectl apply -f platform/gateway.yaml
kubectl -n hermes-gateway wait --for=condition=Ready certificate/hermes-wildcard --timeout=120s
kubectl -n hermes-gateway wait --for=condition=Accepted gateway/hermes --timeout=120s
```
Now the route template, and Alice's release with the gateway turned on:
```bash
cat > charts/hermes-user/templates/httproute.yaml <<'EOF'
{{- if .Values.gateway.enabled }}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hermes
labels: {{- include "hermes.labels" . | nindent 4 }}
spec:
parentRefs:
- name: {{ .Values.gateway.name }}
namespace: {{ .Values.gateway.namespace }}
sectionName: https
hostnames:
- {{ printf "%s.%s" .Values.user .Values.gateway.domain | quote }}
rules:
# OpenAI-compatible API
- matches:
- path: { type: PathPrefix, value: /v1 }
backendRefs:
- { name: hermes, port: 8642 }
# Everything else: the web dashboard
- backendRefs:
- { name: hermes, port: 9119 }
{{- end }}
EOF
helm upgrade hermes ./charts/hermes-user -n hermes-alice --set user=alice --set gateway.enabled=true --wait >/dev/null
```
On a cloud cluster the Gateway gets a load balancer address (`kubectl -n hermes-gateway get gateway hermes`). kind has no load balancer, so the Gateway stays `Programmed=False` with reason `AddressNotAssigned`, and you reach the proxy through a port-forward instead. `curl --resolve` sends the real hostname, so TLS and routing are exercised exactly as in production:
```bash
kubectl -n envoy-gateway-system wait --for=condition=Ready pod \
-l gateway.envoyproxy.io/owning-gateway-name=hermes --timeout=180s >/dev/null
kubectl -n hermes-gateway get secret hermes-wildcard-tls -o jsonpath='{.data.ca\.crt}' | base64 -d > hermes-ca.crt
GW_SVC=$(kubectl -n envoy-gateway-system get svc -l gateway.envoyproxy.io/owning-gateway-name=hermes -o name)
kubectl -n envoy-gateway-system port-forward "$GW_SVC" 8443:443 >/dev/null &
GW_PF=$!
sleep 3
hcurl() { curl -s --cacert hermes-ca.crt --resolve "$1.hermes.example.com:8443:127.0.0.1" "${@:2}"; }
hcurl alice https://alice.hermes.example.com:8443/v1/chat/completions \
-H "Authorization: Bearer $ALICE_KEY" -H 'Content-Type: application/json' \
-d '{"model": "hermes-alice", "messages": [{"role": "user", "content": "Reply with exactly: hello over https"}]}' \
| python3 -c 'import sys, json; print(json.load(sys.stdin)["choices"][0]["message"]["content"])'
hcurl alice -o /dev/null -w 'dashboard: %{http_code}\n' https://alice.hermes.example.com:8443/
```
**Verify:** the API answers over HTTPS, and the dashboard redirects to its login page.
```text
hello over https
dashboard: 302
```
## Step 8: Add more users
Steps 4 and 7 for one user fit in a small script. It is safe to re-run: it keeps an existing Secret, so a user's keys do not change.
```bash
cat > add-user.sh <<'EOF'
#!/usr/bin/env bash
# Usage: ./add-user.sh (needs OPENROUTER_API_KEY in the environment)
set -euo pipefail
u="$1"
ns="hermes-$u"
kubectl create namespace "$ns" --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace "$ns" hermes.example.com/tenant=true --overwrite
if ! kubectl -n "$ns" get secret hermes-secrets >/dev/null 2>&1; then
kubectl -n "$ns" create secret generic hermes-secrets \
--from-literal=OPENROUTER_API_KEY="$OPENROUTER_API_KEY" \
--from-literal=API_SERVER_KEY="$(openssl rand -hex 32)" \
--from-literal=HERMES_DASHBOARD_BASIC_AUTH_PASSWORD="$(openssl rand -hex 16)" \
--from-literal=HERMES_DASHBOARD_BASIC_AUTH_SECRET="$(openssl rand -hex 32)"
fi
helm upgrade --install hermes ./charts/hermes-user -n "$ns" \
--set user="$u" --set gateway.enabled=true --wait --timeout 10m
EOF
chmod +x add-user.sh
./add-user.sh bob >/dev/null
```
**Verify:** two agents, one per namespace.
```bash
kubectl get pods -A -l app.kubernetes.io/name=hermes
```
```text
NAMESPACE NAME READY STATUS RESTARTS AGE
hermes-alice hermes-7c5d9b8f6-q4wzl 1/1 Running 0 6m
hermes-bob hermes-5f8b6c7d9-m2xkj 1/1 Running 0 1m
```
To remove a user, uninstall the release and delete the namespace. The `keep` policy on the volume means `helm uninstall` alone keeps their memory, and deleting the namespace removes it for good:
```bash no-run
helm uninstall hermes -n hermes-bob
kubectl delete namespace hermes-bob
```
## Step 9: Prove the isolation
Five checks, each one a boundary that matters.
**1. Alice's agent cannot reach Bob's.** Her egress policy blocks private addresses, and his ingress policy accepts only the gateway. `curl` gives up after 5 seconds (exit code 28):
```bash
kubectl -n hermes-alice exec deploy/hermes -c hermes -- \
sh -c 'curl -s -m 5 http://hermes.hermes-bob:8642/health || echo "alice -> bob: blocked (exit $?)"'
```
**2. Nothing else in the cluster can reach Bob's agent either**, not even a pod in a namespace with no policies:
```bash
kubectl run probe -n default --rm -i --restart=Never --quiet --image=curlimages/curl:8.17.0 --command -- \
sh -c 'curl -s -m 5 http://hermes.hermes-bob:8642/health || echo "default -> bob: blocked (exit $?)"'
```
**3. Alice's key does not open Bob's agent:**
```bash
hcurl bob -o /dev/null -w 'alice key on bob: %{http_code}\n' \
-H "Authorization: Bearer $ALICE_KEY" https://bob.hermes.example.com:8443/v1/models
```
**4. The agent has no Kubernetes credentials.** No token is mounted, and the service account may not read anything:
```bash
kubectl -n hermes-alice exec deploy/hermes -c hermes -- \
sh -c 'ls /var/run/secrets/kubernetes.io/serviceaccount 2>/dev/null || echo "no service account token"'
kubectl auth can-i get secrets -n hermes-bob --as=system:serviceaccount:hermes-alice:hermes || true
```
**5. Bob's own key still works for Bob:**
```bash
BOB_KEY=$(kubectl -n hermes-bob get secret hermes-secrets -o jsonpath='{.data.API_SERVER_KEY}' | base64 -d)
hcurl bob -o /dev/null -w 'bob key on bob: %{http_code}\n' \
-H "Authorization: Bearer $BOB_KEY" https://bob.hermes.example.com:8443/v1/models
kill $GW_PF
```
**Verify:** all five, in order.
```text
alice -> bob: blocked (exit 28)
default -> bob: blocked (exit 28)
alice key on bob: 401
no service account token
no
bob key on bob: 200
```
## Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Network policies exist but Step 9 check 1 or 2 connects | The CNI does not enforce NetworkPolicy (kind's default kindnet, some minimal setups) | Use Calico or Cilium, as in Step 1 |
| Pod exits at start with `[stage2] ERROR: container started with --user` | `runAsUser`/`runAsNonRoot` set on the pod | Remove them; the image's init must start as root and drops to UID 10000 itself (Step 3) |
| Agent answers, but your OpenRouter bill shows an expensive model | The gateway reads the model from `config.yaml`, not from `HERMES_INFERENCE_MODEL` | Keep the `set-model` init container; check with `kubectl exec deploy/hermes -c hermes -- hermes config get model.default` |
| Gateway shows `Programmed=False`, reason `AddressNotAssigned` | No load balancer (kind, bare metal) | Expected on kind; use the port-forward in Step 7, or install MetalLB or cloud-provider-kind |
| `curl: (60)` or macOS curl `couldn't get X509-issuer name` | The client does not trust the practice CA, or the certificate is a subject-less self-signed leaf | Pass `--cacert hermes-ca.crt`; keep the CA issuer from Step 7 instead of signing the wildcard with `selfSigned` directly |
| API returns `401` with the right key | An `API_SERVER_KEY` line in `/opt/data/.env` wins over the pod environment (the logs warn about it) | Remove the line from `.env` on the volume, or rotate the key in the Secret and restart |
| Dashboard does not come up, logs mention a missing auth provider | The dashboard fails closed on a non-loopback bind without auth | Keep the `HERMES_DASHBOARD_BASIC_AUTH_*` values, or configure OIDC |
| The agent cannot resolve any hostname after Step 6 | The cluster runs NodeLocal DNSCache (`169.254.20.10`), which is inside the excluded `169.254.0.0/16` range | Add an egress rule for `169.254.20.10/32` on port 53 UDP and TCP |
| `helm install --wait` times out on the first user | The image is large and the first pull is slow | Raise `--timeout`; check `kubectl -n hermes-alice describe pod` for pull progress |
## Hardening for production
- **Restrict egress further** if your users do not need the open web. Standard NetworkPolicy matches IP ranges only. Cilium's `toFQDNs` rules can limit egress to `openrouter.ai` by name.
- **Use OIDC for the dashboard** instead of the shared username and password. Hermes supports a self-hosted OpenID Connect provider (`HERMES_DASHBOARD_OIDC_ISSUER`, `HERMES_DASHBOARD_OIDC_CLIENT_ID`). Exposed, unauthenticated Hermes dashboards and API servers were scanned and abused on the internet in June 2026, which is why the dashboard now refuses to start without auth. Treat every agent endpoint as a remote shell, because that is what it is.
- **One OpenRouter key per user**, each with its own credit limit. A leaked key then exposes one person, one person's runaway loop cannot drain everyone's budget, and spend is visible per person.
- **Back up the volumes.** `/opt/data` holds each user's memory, sessions and skills. A volume snapshot schedule (or Velero) is the difference between a pod restart and a lost assistant.
- **An operator instead of Helm.** A community Hermes operator exists on OperatorHub. A plain Helm release per user is easier to read and debug, which is why this tutorial uses one.
## Cleanup
Delete the practice cluster and everything in it:
```bash
cd ..
kind delete cluster --name hermes
```
---
# My AI Agents Got a Memory and a Night Shift. Here Is What Broke First.
> When I turned off Hermes Agent in October, I lost two things: a memory that followed me between tools, and someone to hand open-ended work to. Five weeks later I have both back, built my own way: a search over my notes for my chat, a walled memory server for my coding agents, and a task board that Claude works through every night. This is the story of how that came together, and of every place it broke on the way.
- URL: https://ashkmb.com/blog/ai-agents-night-shift-memory/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-25
- Language: en
One morning in late November, two pull requests were waiting for me on this site's repo. One converted nineteen German posts from the informal *du* to the formal *Sie*. The other fixed four small findings a code review had left behind. Neither was written by me. They were written overnight by Claude Code, on a mini-PC in my flat, from cards I had put on a task board the afternoon before. Each one came with a note saying what it had changed, which checks it had passed, and, for one of them, three questions it wanted me to decide. I read both, merged both ([#65](https://github.com/ashkmb/ashkmb.com/pull/65), [#66](https://github.com/ashkmb/ashkmb.com/pull/66)), and that was my morning.
That moment took five weeks to build. It rests on four small, dull systems, each of which fixed one thing I had lost, and each of which broke in its own way before it worked.
## What I lost when I turned off Hermes
On 18 October I turned off Hermes Agent and replaced it with [a harness of fixed pipelines](https://ashkmb.com/blog/why-i-left-hermes-agent/), one gated door to the models and an allowlist per job. I do not regret it. But I was honest in that post about the cost, and two items on that list kept bothering me.
The first was memory. Hermes remembered things across conversations. My new harness did not, and neither did the chat UI I use for quick questions. Every new chat started from zero, and so did every coding session.
The second was open-ended work. "Go and work out X on the box" was a normal request with Hermes. The harness runs a fixed list of jobs, and nothing else. My list of small tasks was not getting shorter, and nobody was picking any of them up.
I fixed the memory first, twice, because the first fix taught me why I needed a second one.
## A search over my own notes
I keep an [Obsidian](https://obsidian.md/) vault. It started as notes and became the long-term memory of my coding agent: decisions, lessons, what I did on which day, which approach failed and why. It already held most of what a chat assistant would need to know about me. It just lived on my laptop.
So two days after Hermes went off, I built **SuperBrain**: a small server on the mini-PC that searches a copy of the vault and answers with the note it found. My Mac pushes the vault to it every hour, over a key that can only write into that one folder. The server is read-only, and it has no route to the internet. That last part mattered most to me. My notes are the most private thing on any of my machines, so the embeddings are computed on the box itself and never leave it.
Picking the embedding model was the first surprise. I expected the bigger model to win. On a twelve-question test against my own notes, Google's small `embeddinggemma-300m` beat a Qwen3 embedding model with twice the parameters on recall, rebuilt the whole index in 16 minutes instead of 52, and used a quarter of the memory. I kept the bigger model on disk as a standby and have not needed it. Search is hybrid: plain keyword search and vector search, merged, because people search their own notes by exact words more often than they think.
SuperBrain is a tool I switch on per chat in **chat.ashkmb.com**, my self-hosted LibreChat. Most days I use it for three things. I ask what I decided about something weeks ago, and get the decision with a link to the note. I type "Daily" and the name of a workspace, and a small skill reads that day's journal through SuperBrain and gives me my standup bullets. And I research things in chat, which brings me to the part I did not plan.
## The chat that remembers itself
Research chats are worth keeping, but I never remember to copy anything out of them. So the harness now does it. Once an hour it looks for chats that have been quiet for a day. A cheap model throws out the obvious throwaways, writes a summary of the rest, and a sanitizer strips anything that looks like a key, an address or a work detail. A small classifier then answers one question about the summary: is this worth remembering? Kept summaries become a second source in SuperBrain, labelled as unreviewed, so a later chat can find what an earlier one worked out.
Calibrating it was a lesson in how literal machines are. Of my first twelve chats, one was clearly worth keeping: a comparison of Raspberry Pi alternatives. Another scored 0.90, comfortably above my cut-off of 0.85. It was a chat called "Memory Inquiry", in which I had asked SuperBrain to look something up in my notes. The classifier was right that it was about memory. It was wrong that the memory was new: saving it would only store a copy of a note I already had. It dropped out once the criteria said so in plain words. For the cases the classifier gets wrong the other way, I tag a chat `keep` and it skips the judges.
SuperBrain solved memory for the chat. It did not solve it for my coding agents, and that is where it got harder.
## Why one memory was not enough
My coding agent already read the vault, through a skill that searched and wrote notes. It worked, but it had two problems I could no longer ignore.
The first was cost. One run of that skill read between 300,000 and more than two million tokens, mostly cached, because finding the right note meant reading a lot of notes.
The second was worse. I work in four places that must never mix: my day job, my startup, my personal projects and a volunteer initiative. My vault knew all of them. Nothing stopped a session in my startup's repo from recalling a detail from my day job, or from repeating it somewhere it did not belong. My rules said "don't". The model had to remember to obey them.
So on 1 November I built **Treant**, a memory server with walls. Every workspace gets its own schema in Postgres, with its own access token, and a token can only read and write its own workspace. Next to the walled workspaces sits a shared `general` area for know-how that is useful anywhere, something like "Bot Fight Mode can't be skipped with WAF rules". No token can write there directly.
The folder I am working in picks the workspace. When a session starts in my startup's repo, it gets a short briefing from that workspace only. When it ends, the session is saved, scrubbed twice, and handed to a worker that distills it into facts and links between them: this repo uses that service, this decision replaced that one, this thread is still open. Distilling costs about two cents per saved session, on a cheap model, from a budget of three dollars per workspace per month. Nothing a session learns goes into `general` until a gate has checked it: rules first, for anything shaped like a ticket number, an IP address or an account ID, then a model that asks whether the fact would reveal anything about where it came from.
```mermaid
flowchart LR
vault["Obsidian vault my notes"] -->|hourly copy| sb["SuperBrain read-only search"]
sb --> chat["chat.ashkmb.com LibreChat"]
chat -->|kept chats, summarized| sb
code["Coding sessions on my Mac"] -->|brief at start, save at end| tr["Treant one wall per workspace"]
night["Night shift board cards"] -->|run journal| tr
tr -.->|next?| chat
```
## The guard that asked too much
Treant came with a second idea: a guard that checks every shell command an agent wants to run, and asks me first if the command points somewhere that does not belong to the current workspace. A `kubectl` against a work cluster from a startup folder. A `git push` from a work repo to GitHub. A Terraform run in another workspace's folder.
My first version asked about every target it did not recognise, and I switched it off the same day. In one startup session, every plain `kubectl`, `helm` and `aws` call prompted me, because the cluster my shell happened to point at was a work cluster. My note from that evening says the guard was "more blocker than helper". A safety tool I turn off protects nothing.
The version that stayed asks about two things only: production, and targets that belong to another workspace. Everything else runs. It is a weaker rule on paper, and a much stronger one in practice, because it is on.
Along the way I learned something about Claude Code itself. A hook that answers "ask" makes Claude Code prompt even when it runs with permission checks bypassed. It does that on purpose: a hook has the last word. That is exactly what I want from a guard, but it took me a while to understand why my "skip permissions" sessions kept stopping.
## The bug that hid most of my memory
The worst Treant bug was quiet. It surfaced in the second week as a review queue full of stale items, and digging into why led somewhere worse. Every time a session was saved again, Treant treated the new save as the full truth and marked anything the older saves had said, and the new one did not repeat, as superseded. Sessions get saved many times: at the end, before the context is compacted, after resuming. So each save quietly retired most of what the earlier ones had learned. When I counted, about 86% of the facts in my workspaces were hidden from search. My personal workspace had 78 current facts and 811 superseded ones.
The fix was a change of mind more than of code: a save adds, it does not restate. Only the list of open threads is replaced by the newest save, because that list really is a snapshot. Then I took a backup and ran a restore. By then my personal workspace was down to 64 current facts; the restore brought it back to 769.
Nothing had been deleted, which is the only reason that story has a happy ending. Treant never deletes a fact; it marks it superseded and keeps its history. That rule was in the design from the start, and it is what made the bug recoverable.
## A dashboard for the memory
A memory you cannot see is a memory you cannot trust, so Treant got a dashboard at **treant-ui.ashkmb.com**, on my home network only. It is deliberately plain: server-rendered pages and no JavaScript at all. The graph view is drawn on the server as a picture.
I use it for three things. The review queue shows what wants to move from a workspace into `general`, with a short rule of thumb on every item: a public tool or principle, approve; my own host, repo or person, drop; when unsure, drop, because the workspace keeps its copy. The graph view shows how a workspace has grown. On the first day, my work workspace got 36 nodes from three sessions, almost all of them ticket numbers, which raised the question of whether a ticket should be a fact instead of a node. I still have not decided. And the duplicates page finds facts that say the same thing twice and merges them, with history kept.
Anything sensitive, like approving a fact into `general` or showing a token, needs a fresh login. That part broke too, in the most confusing way. After a few minutes, the Approve button did nothing at all. The page's own security policy only allowed forms to post back to the dashboard, so the browser silently refused the redirect to the login page. One line of policy fixed it.
## A board, and a night shift
Memory was back. Open-ended work was still missing.
The harness already had a dashboard at **[agent.ashkmb.com](https://ashkmb.com/blog/why-i-left-hermes-agent/)**, the one that replaced Hermes's: research digests, invoice review, the spend page. In November it got a task board. A card is a task with a description, and optionally a written spec and an implementation plan attached. Every night at 23:00, a runner picks up the cards I have marked as ready and hands each one to Claude Code in a sandbox. It runs in two lanes, one per Claude subscription. By morning, every card is back in Review as a draft pull request, a held git bundle I push by hand, or a written note. One message on my phone summarises the night. The runner never merges, never deploys and never pushes to main.
It only touches cards that I created and that only I have edited. The board also has agent accounts, and a card an agent wrote is not an instruction I gave.
The first week of the night shift taught me more than the design had, and none of it was where I expected.
**Subagents died with their parent.** My plans are written for subagent-driven work: the main agent hands each task to a fresh subagent, and a reviewer checks the result. The first real plan card had 17 tasks and stopped after one. The main agent had started the next subagent in the background and ended its turn, and in headless mode Claude Code exits when the main agent replies. The runner saw a clean exit with 16 tasks left. One environment variable that turns off background tasks fixed it, and any headless run that uses subagents will need the same.
**Stop meant delete.** I stopped a running card once, to deploy a fix. The cleanup removed the work directory before anything was published, and three finished tasks and their final review were gone. Now a stop keeps whatever is committed. I wrote the lesson down bluntly: never promise "committed work is kept" without reading the code that runs on SIGTERM.
**A template ate a newline.** The sandbox units are rendered from templates, and one template tag at the end of a line removed the newline after it. The next directive was glued onto the end of a firewall line. systemd did not complain; it ignored what it could not parse. Two of my workspaces ran their night jobs with no DNS, and nothing said so until a job tried to resolve a hostname.
**The limit message changed.** The runner tells "out of usage" apart from "Claude crashed" by the wording Claude Code prints. An upgrade changed the wording, and a card that only needed to wait for the other lane was filed as an error. After every upgrade, I now search the new binary for the limit messages.
Every one of these is an assumption that held in my tests and failed in production, because my tests ran my code against my idea of the tools around it.
## Read everything, change nothing
A night agent that cannot look at anything is useless for "why does this service keep restarting". One that can change things is not something I want running while I sleep. The design gives the agent read access to its workspace's infrastructure and no write path at all, and neither half depends on the agent behaving well.
The agent has no GitHub credentials. Its code leaves the sandbox as a git bundle, and a different user checks the bundle before anything reaches GitHub. Cloud access uses short-lived, read-only credentials, minted outside the job from a key the job never sees. SSH goes to a user on my machines that can only run a fixed menu of read commands. After every job, a leak guard scans everything that leaves for every credential the job could have seen, and nothing is pushed without its "ok".
There is also a deny list in Claude Code's settings that refuses write commands. I treat it as a second layer, not the control. If the deny list missed something, the provider would still say no.
## Done, according to whom?
For the first week, a card was done because the agent said so. Then a test card broke one of its own rules, running two commands in parallel when the card said not to, and nothing noticed.
So now a plan can end with an `## Acceptance` block: the shell commands I would run myself to believe the work is done. When a run finishes, a separate check user with no credentials clones the pushed branch into a fresh directory and runs them. No result counts as failed. A failed check sends the card back to the agent with the output as its first job, at most twice. A plan without checks is marked "unverified", not "done".
The two pull requests from the start of this post were among the first real cards through that gate. They passed their checks, three and four of them, on the first run, with no fix attempts. That is a small sample, and I will not pretend it is more.
## What comes next: Treant in the chat
Today my memories live in two places that do not talk to each other. The chat knows my notes and its own past chats, through SuperBrain. My coding sessions and the night shift know what they learned, through Treant. When the night shift finds out why a service keeps restarting, my chat has no idea.
The next step I am considering is to give chat.ashkmb.com a read-only key to Treant's personal workspace. Treant already scopes every token to one workspace and to specific actions, so a key that can only search is a configuration change, not new code. Writing is a different question. A chat that can write to the memory my agents rely on is an easy way to poison that memory, so if it ever happens, it will go through the same review queue as everything else.
## What the five weeks taught me
**Walls beat rules.** "Don't mix workspaces" was a rule in a prompt for months. A schema per workspace, and a token that cannot read the others, made it a fact.
**A safety tool you switch off protects nothing.** The guard got useful when it asked less.
**Never delete; supersede.** It is the only reason the bug that hid 86% of my memory was a bad week and not a lost month.
**Ask for proof, not a report.** "Done" from an agent is a claim. An acceptance check is a command I would have run anyway.
**Most bugs live at the seams.** A changed message in a CLI, a lifecycle I had not read about, a template that ate a newline, a browser silently refusing a redirect. Very little broke inside my own code. Almost everything broke where my code met something else.
None of these systems is clever. SuperBrain is a search box. Treant is Postgres with walls. The board is a list, and the night shift is a timer. Together they gave me back what I missed from Hermes, and this time I know where every fence is, because I built each one.
---
# My Blog Was Invisible to AI. Cloudflare Was the Reason.
> I wanted ChatGPT, Claude and Perplexity to read and cite this site. Before writing a single llms.txt, I checked whether their crawlers could reach it: they got 403. The "Block AI bots" switch was already off; Bot Fight Mode was the culprit. Here is how I found it, the second surprise behind it, and what an AI reader needs from a site once it can get in.
- URL: https://ashkmb.com/blog/cloudflare-blocked-ai-crawlers-geo/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-25
- Language: en
More and more of my own lookups start in an AI assistant, not a search box. If someone asks one of them how to run Hermes Agent for a team on Kubernetes, I want the answer to come from this site, with a link. The name for that work is [generative engine optimization](https://en.wikipedia.org/wiki/Generative_engine_optimization), or GEO: SEO for readers that are language models.
Most GEO advice starts with content: write clear answers, add structured data, publish an `llms.txt`. I started one step earlier and asked a dumber question. Can the crawlers even get in?
```bash
curl -s -o /dev/null -w '%{http_code}\n' \
-A 'Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)' \
https://ashkmb.com/blog/ingress-nginx-archived-upstream/
```
`403`. The same for ClaudeBot and PerplexityBot. Every post I had written was invisible to the three assistants I cared most about.
## The switch that was already off
Cloudflare sits in front of the site, and its dashboard has an obvious suspect: a toggle called **Block AI bots**. It was off. I had never turned it on.
The zone's bot settings live behind one API endpoint, `GET /zones//bot_management`, and reading the whole object told a different story than the dashboard page I had been staring at:
```json
{
"fight_mode": true,
"ai_bots_protection": "disabled",
"crawler_protection": "disabled",
"ai_training": "disallow",
"ai_search": "disabled",
"ai_user": "only_on_ad_pages",
"is_robots_txt_managed": false
}
```
`ai_bots_protection` is the "Block AI bots" toggle, and it was `disabled`, as the dashboard said. The line that mattered was the first one. **Bot Fight Mode** is Cloudflare's free-plan bot filter. It challenges traffic that looks automated, and an AI crawler is automated by definition. It does not read `robots.txt`, and it cannot be tuned: Cloudflare's own docs say you [cannot bypass or skip it with WAF custom rules](https://developers.cloudflare.com/bots/get-started/bot-fight-mode/), because it runs outside the rules engine. On the free plan it is all or nothing.
In hindsight there had been a hint. For about a week, plain requests from my laptop had been getting Cloudflare's "Just a moment..." page, while the same site on its `pages.dev` address answered normally. I had noted it as a curiosity and moved on. Since the change, those requests go through too.
The `ai_training`, `ai_search` and `ai_user` fields look relevant, but they were not the cause. They describe the policy Cloudflare writes into a `robots.txt` that it manages for you. Mine is my own file (`is_robots_txt_managed: false`), so they had no effect on the 403. I set them anyway, so the settings say what I mean:
```bash
curl -s -X PUT \
-H "Authorization: Bearer $CF_TOKEN" \
-H "Content-Type: application/json" \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/bot_management" \
-d '{"fight_mode": false, "ai_bots_protection": "disabled",
"ai_training": "disabled", "ai_search": "disabled",
"ai_user": "disabled", "is_robots_txt_managed": false}'
```
The token needs one permission, Zone → Bot Management → Edit, on this zone only. After the change, the same three requests returned `200 200 200`.
A borrowed user agent is not the real crawler. Cloudflare recognises the real ones by their IP ranges, so a spoofed GPTBot string from my laptop is a rough check, not proof. It is still the right first test: it went from 403 to 200 with exactly one setting changed, and it costs nothing to run after every Cloudflare change.
The decision behind the PUT is worth stating plainly, because it is a real trade-off. There are two kinds of AI bots: search and retrieval bots that fetch a page to answer a question right now, and training crawlers that collect text for the next model. Many sites allow the first and block the second. I allow both. Everything on this site is written to be read and reused; a model that learned from it is one more reader. `public/robots.txt` now says so explicitly, with a group for each major AI agent, even though `User-agent: *` already allows everything. An explicit group documents intent, for crawlers and for whoever edits the file next.
## Every URL existed
With the door open, I started probing for the files I planned to add, and hit the second surprise. `https://ashkmb.com/llms.txt` returned `200` before I had created it. So did any path I made up.
Cloudflare Pages treats a site without a `404.html` as a single-page app and answers every unknown path with the home page and status 200. For a human that is a mild annoyance. For a machine it is a lie: every probe for a Markdown file or an `llms.txt` "succeeded", and a crawler that follows a dead link indexes my home page under that URL.
The fix was one file, `src/pages/404.astro`, marked `noindex`. Astro builds it to `404.html`, Pages serves it with a real 404, and status codes mean something again. It also changed how I verify deploys: a 200 used to prove nothing, so I still check the page title, not just the status.
## What an AI reader needs once it can get in
Once crawlers could reach the site and status codes told the truth, the content work started. In order of how much each one is worth:
**Markdown twins.** Every post has a plain Markdown version at the same URL with `.md` instead of the trailing slash, for example [/blog/ingress-nginx-archived-upstream.md](https://ashkmb.com/blog/ingress-nginx-archived-upstream.md). An HTML page carries navigation, scripts, an audio player and a lot of markup around a few thousand words. The twin is just the words, with a short header so a model knows what it is reading and who wrote it:
```text
# The Upstream Is Archived. The CVE Is Not.
> Two unauthenticated NGINX HTTP/2 RCEs landed overnight, ...
- URL: https://ashkmb.com/blog/ingress-nginx-archived-upstream/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-19
- Language: en
```
The body below is the raw post with root-relative links rewritten as absolute ones, so a link still works once the text is lifted out of the site. Code blocks survive untouched, which matters for technical posts, where the command is the part worth citing. Each HTML page points at its twin with ``, and a line in `public/_headers` serves `.md` files as `text/markdown`. All of it is generated at build time by an Astro endpoint, so a new post gets its twin without anyone remembering to make one.
**`llms.txt` and `llms-full.txt`.** [`/llms.txt`](https://ashkmb.com/llms.txt) is a short index: one paragraph on who writes this site and what about, then every tutorial and post with its excerpt, linking the Markdown twins. [`/llms-full.txt`](https://ashkmb.com/llms-full.txt) is the full English text of every post in one file, about 440 KB. The format is a [community proposal](https://llmstxt.org/), not a standard, and I have no evidence that any major assistant reads it today. It costs one build step to generate, so it is cheap insurance.
**Structured data that says when, who and what.** Posts already had `BlogPosting` JSON-LD. It now also carries `dateModified` (from an optional `updated` field in the front matter), `keywords` from the tags, and the author's `sameAs` links to GitHub, LinkedIn, X, Instagram and YouTube, so a model can tie the posts to one person. Freshness matters more to an AI answer than to a human skimming: "tested in November 2026" is a reason to trust a command.
**robots.txt that matches the Cloudflare settings.** Two places decide whether a crawler gets in, and they have to agree. Mine now do, and the repo's CLAUDE.md records the exact Cloudflare state, so the next change does not quietly undo it.
## Tutorials are the content AI tools reach for
A lot of what people ask assistants is "how do I do X". A narrative post answers that badly: the steps are buried in a story. So the site now has a separate [Tutorials](https://ashkmb.com/tutorials/) section with its own schema: difficulty, duration, prerequisites and the exact versions it was tested with. Each tutorial page carries `HowTo` JSON-LD, with the steps generated from its `## Step N:` headings:
```json
{
"@type": ["TechArticle", "HowTo"],
"totalTime": "PT60M",
"proficiencyLevel": "intermediate",
"step": [
{ "@type": "HowToStep", "position": 1, "name": "Step 1: Create a practice cluster", "url": "…#step-1-create-a-practice-cluster" }
]
}
```
The first one is [multi-user Hermes Agent on Kubernetes](https://ashkmb.com/tutorials/multi-user-hermes-agent-kubernetes/): one isolated agent per person, each with its own namespace, volume, secret, network policy and HTTPS hostname.
Tutorials come with one rule: nothing is published that was not run. A script pulls every `bash` block out of the Markdown in order, and the whole tutorial runs end to end against a throwaway [kind](https://kind.sigs.k8s.io/) cluster. That rule paid for itself on the first clean run. My exploratory run had passed, but on a fresh cluster the port-forward in one step started before the gateway's proxy pod was ready, and failed. A human following along would have waited a few seconds without noticing. A reader who copies the commands one after another hits the race every time. One `kubectl wait` fixed it, and only a clean run could have found it.
Two reviews caught things the run could not. One found a logic error in my own explanation of what happens on a cluster whose network plugin ignores network policies. The other caught overclaims about isolation: through the public gateway, agents can still reach each other's hostnames, and a shared API key is readable by every agent. The tutorial now says exactly where the isolation ends. An overclaim in a blog post misleads one reader. Quoted by an assistant, it misleads everyone who asks.
## Keeping it from rotting
Generated files fail quietly. A twin that stops rendering or a draft that leaks into `llms.txt` breaks nothing a person would notice. So there is a small Python test suite, standard library only, that runs over the built `dist/` folder in CI after every build: every published post and tutorial has its twin in all three languages, no twin keeps a root-relative link, `llms.txt` lists every published post and tutorial and no drafts, the JSON-LD carries the right dates, and every tutorial has its HowTo steps. Adding a generated file now means adding a check for it.
## What I don't know yet
All of this makes the site easy for an AI to read and cite. None of it proves anyone will. Citations take weeks to show up, and the assistants do not report referrals the way search engines do. I will look again in a few months and write down what moved, if anything.
If you want the short version for your own site, it is the order I wish I had started in:
1. Request one of your pages with a GPTBot, ClaudeBot and PerplexityBot user agent. If you get anything but 200, check Bot Fight Mode (or your host's equivalent) before you touch content.
2. Request a path that does not exist. If it returns 200, fix that first.
3. Make your `robots.txt` and your CDN's bot settings agree, and write down why.
4. Give every page a clean text version, and an index that links them.
5. Put dates and an author on everything, and test any command before an assistant quotes it.
---
# The Upstream Is Archived. The CVE Is Not.
> Two unauthenticated NGINX HTTP/2 RCEs landed overnight, and our ingress controllers were exposed. The usual fix, bumping to the latest release, closed nothing: ingress-nginx was archived in March, and its last release ships an NGINX that will never be patched. This is how I proved what was reachable, turned HTTP/2 off as a stopgap, backported the fixes into our own build, and rolled it out without an outage.
- URL: https://ashkmb.com/blog/ingress-nginx-archived-upstream/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-19
- Language: en
On 18 November, F5 released NGINX 1.30.7 and 1.31.9 with fixes for two unauthenticated remote code execution bugs. Both need HTTP/2. CVE-2026-123007 is a flow-control underflow that hits any NGINX serving HTTP/2. CVE-2026-123633 is a use-after-free that needs HTTP/2 plus proxying, which describes every ingress controller ever deployed.
For most software the next step is boring: read the release notes, bump the chart, roll it out. That step did not exist here. The community `kubernetes/ingress-nginx` project was archived in March 2026. Its last release, controller v1.15.1, bundles NGINX 1.27.1, and nobody is going to rebuild it. "Upgrade to the latest version" was already done. It closed nothing.
This post walks through what we did instead, in the order it happened: prove what is actually reachable, take the cheap mitigation where it is free, then build and ship a patched controller ourselves, and give that build an end date.
## First, find out what is actually exposed
The advisory says "NGINX with HTTP/2". That sentence covers a lot less of a cluster than the panic suggests, and a lot more than just the ingress controllers.
**Find every NGINX, not just the obvious ones.** Ingress controllers are the first suspects, but application frontends often ship their own NGINX to serve static files. I ran `nginx -v` in every running container, in parallel, and kept the hits. The controller image tag tells you nothing about the NGINX version inside it; only the binary does. Our controllers turned out to run NGINX 1.25.5 and 1.27.1, neither of which will ever get a fix.
**Then ask whether HTTP/2 is even on.** Inside a controller, `grep -c "http2 on" /etc/nginx/nginx.conf` answers it. In the frontends, `nginx -T` showed plain `listen 80` with no `http2`, no `ssl`, sitting behind a load balancer that speaks HTTP/1.1 to its targets. Not exploitable, so rebuilding them on a fixed base image became routine upkeep instead of an emergency.
**Where TLS ends decides whether clients can reach HTTP/2.** Browsers negotiate HTTP/2 through ALPN during the TLS handshake. If the load balancer terminates TLS, NGINX only ever sees plain HTTP on port 80. If the load balancer passes TCP through, NGINX does the handshake and offers h2. The Service annotations tell you which: a TCP backend with no TLS ports configured on the load balancer means TLS ends at NGINX.
**Probe from outside, and probe the bare hostname.** An attacker does not need a valid Host header, so test the load balancer address itself, not only your public names:
```bash
# Does TLS negotiate h2?
curl -s -o /dev/null --http2 -w '%{http_version}\n' https://app.example.com/
# Does plain port 80 accept h2c? (NGINX 1.25.1+ with "http2 on" does)
curl -s -o /dev/null --http2-prior-knowledge -w '%{http_version}\n' http:///
```
The second probe is the trap. Since NGINX 1.25.1, `http2 on` also makes the plain listener accept HTTP/2 with prior knowledge (h2c). Our internal controller sat behind a load balancer that ended TLS, so I expected it to be safe. It was not: port 80 answered `2`.
The result was three controllers in scope. One internal, with TLS ending at the load balancer and h2c open on port 80. Two internet-facing, with TLS ending at NGINX, one of them serving a partner integration that authenticates with client certificates. Mutual TLS did not help there either: the default server asks for no client certificate, so an attacker gets to the HTTP/2 layer without one.
## The stopgap that costs nothing, and its limits
ingress-nginx has a ConfigMap switch that removes every `http2 on` from the generated config, including the h2c path on port 80:
```yaml
controller:
config:
use-http2: "false"
```
It is a reload, not a restart, so no connections drop. Before flipping it, check that nothing uses `backend-protocol: GRPC`, because gRPC needs HTTP/2 end to end. After flipping it, verify three things: `nginx.conf` contains zero `http2 on`, `curl --http2` negotiates `1.1`, and a prior-knowledge request shows up in the access log as `"PRI * HTTP/2.0" 400`.
On the internal controller this was simply the right setting. TLS ends at the load balancer without ALPN, so no client ever had HTTP/2 there; h2c on port 80 was pure attack surface. It stays off for good.
On the internet-facing controllers it was a worse trade. Turning HTTP/2 off there is a real behaviour change for real clients. And the same NGINX release fixed a third bug, an infinite loop on TLS 1.3 request bodies (CVE-2026-118899), that has nothing to do with HTTP/2. A switch cannot close that one. Only a patched binary can.
## Where NGINX actually lives in the controller image
The obvious idea is "rebuild the controller on NGINX 1.30.7". It does not work, and the reason is in the repository layout.
The controller image is two builds stacked. The Go controller sits on top of a base image built from `images/nginx/`, and that base is NGINX 1.27.1 plus 34 OpenResty patches plus a set of Lua modules. Those patches and modules are pinned to 1.27.1. Bump NGINX underneath them and you are maintaining a port of OpenResty, not a security fix.
What does work is backporting. The base build script applies every file in `patches/` in name order, so a fix is one more numbered file. nginx.org no longer publishes standalone patch files for advisories, but the fix commits are public in the `nginx/nginx` repository, and GitHub serves any commit as a patch:
```bash
gh api repos/nginx/nginx/commits/ \
-H 'Accept: application/vnd.github.patch' \
> images/nginx/rootfs/patches/_nginx-1.27.1-CVE-2026-123007.patch
```
The HTTP/2 fixes were about ten lines each and applied cleanly to 1.27.1. I replayed all patches, upstream's and ours, on a clean 1.27.1 tree before every build and treated any fuzz or offset in ours as a failure. A patch that applies "close enough" to the wrong lines is worse than one that fails loudly.
One check made the whole approach trustworthy: at the v1.15.1 tag, `images/nginx/` is byte for byte what produced upstream's published base image. So our build reproduces upstream exactly, plus the patches we added, and nothing else.
## Making the fork boring to run
A fork is only safe if releasing it is boring. The pipeline I set up does four things that each removed a way to get it wrong.
**Native builds per architecture.** Each architecture builds on its own runner and pushes `-`, and a final step joins them into one multi-arch manifest. No emulation, so no "works on amd64, crashes on arm64" surprises. It also made the cost visible: the x86 base build took 36 minutes, the arm one 13.
**The controller builds FROM the base by digest, not by tag.** A tag can move; a digest cannot. The controller you test is guaranteed to sit on the base you just built.
**A smoke test that exercises the patched code paths.** Not "the container starts", but HTTP/2 and HTTP/1.1 over TLS 1.2 and 1.3, a 200 KB request body, parallel streams over one connection, a proxied request, and a check that no worker process crashed. If a backport broke HTTP/2 framing, this is where it shows up, not in production.
**Tags are never overwritten.** A release is a version bump; an existing tag in the registry is skipped unless someone forces a rebuild on purpose. The helper that checks whether a tag exists has to fail on registry errors instead of reading them as "absent", otherwise one bad API call quietly overwrites a release.
While I was in there, rebuilding the Go controller on a current toolchain and current `golang.org/x` modules took `govulncheck` from 19 findings to 0. That is the other half of an archived project: it is not only NGINX that stops getting updates.
One lesson came from running upstream's unit tests outside upstream's own Docker wrapper. The CI job runs as a pod inside a Kubernetes cluster, so Kubernetes injects `KUBERNETES_SERVICE_HOST` into its environment. A test that builds an API server client from the environment picked that up and tried to talk to the real cluster the runner lived in. It failed, which was the lucky outcome:
```bash
unset KUBERNETES_SERVICE_HOST KUBERNETES_SERVICE_PORT
```
## Rolling it out without surprises
**Override the digest, not just the tag.** The base image is only a build stage; what you deploy is the controller image, with the chart of the matching version (v1.15.1 goes with chart 4.15.1). The chart pins upstream's image digest. Override only the registry and tag, and you get your repository with their digest, and the pull fails:
```yaml
controller:
image:
registry: registry.example.com
image: ingress-nginx/controller
tag: v1.15.1-patched.2
digest: sha256:
```
**Diff the live release against the values file before anything else.** One controller had been installed by hand long ago and later adopted by Terraform. The live release carried settings the values file did not: snippet annotations allowed, the default IngressClass flag, a hand-scaled replica count. The Helm provider does not see that drift, so the first apply from the file would have silently flipped all three. I fixed the values file first, until `helm diff` showed only the image and labels changing.
**Rollback is `helm rollback`, not a revert pipeline.** Reverting through CI takes ten minutes or more. `helm rollback ` takes one or two. Roll back first, then revert the change through the pipeline so the state matches again.
**Baseline every host before, compare after.** Before each swap I recorded the HTTP status for every host through a controller pod, and again after. 42 hosts on one controller and 12 on another came back identical, so "nothing changed" was a diff, not a feeling. One trap: probing from a controller pod to its own load balancer fails intermittently, because the load balancer drops hairpinned connections. Probe from outside the target nodes before you call it an outage.
The partner controller rolled out in 55 seconds.
## Sixteen quiet minutes
Then the partner sent nothing. Not errors, nothing. For a client that authenticates with certificates, silence right after swapping the TLS terminator looks exactly like a handshake failure.
It was not. Their client had been sitting idle on connections the old pods closed during the rollout, and after 16 minutes it reconnected and carried on with 200s. What let me wait instead of rolling back was this, switched on for a couple of minutes (a reload, no restart):
```yaml
controller:
config:
error-log-level: info
```
At info level, a failed handshake logs `SSL_do_handshake() failed` with the reason. There were none. The only handshake lines were `client closed connection while SSL handshaking`, with no SNI, from node IPs: the load balancer's TCP health checks, not a client. Without that log level, both cases look the same, which is to say they both look like nothing.
## A fork needs an end date
After that afternoon, all three controllers ran the patched build: HTTP/2 off on the internal one for good, on for the two internet-facing ones, no outage on any.
That does not make NGINX 1.27.1 current. 2026 already had other NGINX fixes that never made it into that version, and each one needs the same triage: does it apply to our config, and does the fix backport cleanly. Patching the headline CVEs closed the emergency, not the gap.
That is why the fork has a retirement plan written down next to it: move the internal traffic to a cloud load balancer's native routing and the partner path to a load balancer that does mutual TLS itself, then delete the fork. Owning a security fork of an archived project is a reasonable bridge. It is a bad destination, because every future advisory is now yours to read, backport and test, for as long as the fork lives.
---
# My video studio is code. A new benchmark tested agents on the same job.
> AgenticStudio is the code behind my YouTube channel: daily Shorts, a Sunday digest, a cartoon debate show and a kit for videos I present myself. No frame comes from a video model. VibeVideoBench just measured frontier agents on code-driven video. Here is how my setup compares, and the one thing no benchmark can tell you.
- URL: https://ashkmb.com/blog/agenticstudio-code-driven-video/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-13
- Language: en
AgenticStudio is my name for the code that makes my [YouTube channel](https://www.youtube.com/@ashkmb-tech). It makes four things:
- Shorts most days.
- A Sunday digest.
- A cartoon debate show called *Pick a Side*.
- A kit for the videos I present on camera myself.
Not one frame comes from an image or video model. Every slide, chart, cartoon owl and subtitle is drawn by code, and the only generated media is the voice. The photos are real ones, from the articles or a stock library.
Last month a paper called [VibeVideoBench](https://arxiv.org/abs/2610.35864) tested frontier AI agents on exactly this kind of work. Reading it next to my own repo was more useful than most benchmark papers, because it measures the problem I actually have. This post is a tour of the studio, held up against that paper.
## What VibeVideoBench measures
The authors start from a point I agree with completely. Diffusion video models make striking clips, but they cannot reliably render an exact formula, a correct chart or narration that lines up with what is on screen. The other route is an agent that writes code to render every frame and synthesize every sound.
The setup:
- **239 tasks in 12 categories,** in English and Chinese, from data stories and music-driven pieces to classroom lessons and paper explainers.
- **Each agent runs in its own vendor harness,** inside a sandbox with no image or video model, and has **one hour** to deliver a finished MP4 with sound.
- **Grading in three levels:** program checks of the delivery spec, then about 13,000 task-specific rubric checks, each traced to the requirement it enforces, then five quality dimensions scored by three panels of vision-language model judges.
Across nine agent systems and 2,151 scored runs, GPT-6 Astra and Claude Opus 5.5 came first and second, for the judges and for blind human raters alike. The best system met every core requirement on **76.3%** of tasks.
Two findings matter more than the ranking:
- **Missing videos change the ranking.** About three quarters of the lost videos were final renders that started too late, ran too slowly or never started. The authors call it a failure of how agents plan their hour.
- **Agents inspect their own frames, but how much they look does not predict quality.**
Both match what I have learned the slow way.
## What AgenticStudio makes
- **Shorts.** An hourly job reads my blog and a set of tech news feeds. A model judges each story: make it, rewrite the angle, or skip it. A Short is about a minute of narrated, animated slides in the channel's look, and it goes public only after a final check against the article.
- **The Sunday digest.** It's 20 to 30 minutes long and retells the two to four stories whose Shorts did best in their first 72 hours. It builds on Sunday morning and waits for me in a dashboard. Nothing uploads until I click Publish.
- **Pick a Side.** I fill in a form: the question, two to four panelists and the side each one argues, plus a few source links. The pipeline researches the topic into a ledger of quoted facts, writes the script and renders a cartoon studio with animal panelists behind desks and an owl as host. The show never gives a verdict. It ends with "Which side convinced you? Tell us in the comments."
- **The presenter kit.** This is the human version. It turns a topic into a research brief, a teleprompter script and slides with a reserved band at the bottom for my webcam. After I record, it aligns the known script to my voice with [WhisperX](https://github.com/m-bain/whisperX) and writes English subtitles, then German, French and Persian translations. I built it after the faceless videos lost their novelty: viewers stopped clicking after the first week.

*Every format follows the same shape. The models fill in steps and code checks them. A Short goes out on its own only if every check passes; the digest and the show always wait for my click.*
The render side is plain: **Pillow** draws the slides, and **ffmpeg** animates matted layers and mixes the sound. I picked boring tools because they are deterministic. The same script renders the same video, so a bug can be reproduced and a fix can be tested.
The voices are Google's Chirp 3 HD [TTS](https://en.wikipedia.org/wiki/Speech_synthesis). They have quirks no benchmark would list: Chirp spells "Hmph" and "Pfft" letter by letter, so the panelists scoff with "Oh, please" and "Yeah, right" instead. A real laugh comes from a second TTS model that understands a `[laughing]` tag.
All of it runs on the same always-on mini-PC as [my agent harness](https://ashkmb.com/blog/why-i-left-hermes-agent/). Over 30 days AgenticTube, the automatic part, was about half of the 3.66 USD my apps spent on models. Text-to-speech is billed separately.
## Where the paper and the studio agree: code draws exact things
The paper's opening argument has been the studio's first rule since version one: no AI imagery and no invented numbers. A chart is drawn from values that came out of the source, so a chart cannot hallucinate.
Sync is the same story. Chirp takes no timing marks, so I get no word timestamps. Each card's moment is computed instead: where its words first appear in the text, as a share of the text, times the length of the audio. It is accurate to about half a second, which is enough for a card to arrive as the narrator says it. A diffusion model would have to guess that.
## Where they differ, part 1: my agents do not plan their hour
The paper's agents build a rendering pipeline from scratch inside a one-hour budget, and most of the videos they lose die at the render. Mine never face that decision, because the pipeline is fixed and its costs are known:
- **A Short** renders in about 22 seconds.
- **A 12-minute debate episode** takes about two minutes on six workers.
- **A test build of a 26-minute digest** took 20.5 minutes wall clock and 2 hours 24 minutes of CPU, against a 3-hour limit on the job.
I only know those numbers because I rehearse: a copy of the live database in a sandbox, a fake YouTube client, and the real job's own settings. In my studio the model writes the words. Scheduling, retries and the render are plain code.
That is the same conclusion I reached about [general agents versus fixed pipelines](https://ashkmb.com/blog/why-i-left-hermes-agent/), now with a benchmark behind it. When the job is known, asking a model to plan it on every run adds a failure mode that buys nothing.
## Where they differ, part 2: rubric checks or gates
VibeVideoBench grades every video against about 54 rubric checks on average, each traced to a requirement. That is the right idea, and I do the same thing, except my checks run *before* publishing and block it:
- **Every number on screen or on air must match a cited fact by value and unit.** That includes spelled-out numbers, "two thirds of", "$5bn" and "10x".
- **At most three figures per Short,** because the model's brief pulls out every number in the article, and the early scripts read like earnings calls.
- **Every Short ends with a neutral question.**
- **The debate never gives a verdict or advice.**
- **A panelist may cite a fact in at most two lines.** No sentence may share 60% or more of its content words with one that panelist already said.
None of these came from a spec. Each came from watching an episode. The repetition rule exists because one episode cited the same fact in 13 lines from the same panelist. A rubric tells you afterwards that a video failed. A gate tells the pipeline to try again before anyone sees it.
## Where they differ, part 3: looking is not quality
The paper's finding that how much agents look does not predict quality is the one I would underline. My own version: **pixel tests passed four real visual defects.** The tests checked that each frame rendered, had content and fitted its layout. None of them noticed a photo squeezed to a thumbnail, or a headline cut off with room to spare.
What caught them was a contact sheet of real renders that I looked at after every change. Then there are the things no frame check knows about. YouTube draws the channel name, the title and the Subscribe button over the bottom of a Short, and the published figures for that safe zone disagree with each other. My content now stays above row 1520 of 1920 and 140 pixels from both edges, and the final check was holding the phone in my hand.
## What no benchmark measures: whether anyone watches
Here is the honest part. For a while, Shorts on heavy topics got 2 to 37 views, and 0 to 7% of each one was watched. A friend outside tech told me the explanations were hard to follow. Every one of those Shorts would have passed a strict rubric.
So I retargeted the channel at that friend:
- General news feeds instead of most vendor engineering blogs.
- One Short per event.
- Claims wait for an on-record statement or a second independent outlet; opinions are skipped.
- At most three numbers, and no unexplained jargon.
That change was a decision about an audience, not a fix to a pipeline. A benchmark can say whether an agent met 76% of a spec. It cannot tell you whether the spec was worth meeting. That is why the long formats still end with me clicking Publish or Rework, and why a Short that fails a check waits for me too.
## Reading the paper with care
- **Each agent ran in its own vendor harness,** so the ranking scores a model and its harness together. A good model in a weak harness and a weak model in a good one cannot be told apart.
- **The judges' ranking matched blind human preferences.** That is a statement about ranking systems, not proof that a judge can approve a single video. The Publish button stays.
- **I have read the abstract and a third-party review, not the full paper.** The numbers above come from the abstract.
## What I am taking from it
The paper gives a name to something I had only felt: delivery is its own axis. A video that is 90% good and arrives is worth more than a perfect one that never finishes rendering. Fixed pipelines win that axis by default, and that is most of why AgenticStudio looks the way it does.
The part I want to steal is the traceability. Every rubric check in VibeVideoBench points to the requirement it enforces. My gates do not yet say which of my decisions they come from, and after five months of rules that started with "I noticed", they should.
---
# A 30B coding model on a CPU mini-PC. 17 tokens a second, and the prompt is the limit.
> I put Qwen3-Coder 30B on the always-on mini-PC that runs my agent harness, with no GPU. It writes at about 17 tokens a second, which sounds usable. The real limit is reading the prompt: a 10K-token context takes about two and a half minutes before the first word. Here are the numbers, the tuning that did not help, and what would.
- URL: https://ashkmb.com/blog/local-coding-model-cpu-mini-pc/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-10
- Language: en
The question was simple: can the mini-PC that already runs my [agent harness](https://ashkmb.com/blog/why-i-left-hermes-agent/) also run a coding model? No GPU, no new hardware, zero cost per call, and nothing leaves the house.
The answer is yes, with one catch that matters more than the headline number. This post is about that catch.
## The box
- Intel Core i9-12900HK, 32 GB DDR4-3200, no GPU.
- It already runs the harness, LiteLLM, a chat UI and the AgenticTube video renders. The model has to share.
## First try: stream a huge model from disk
I started with colibri, a project that runs very large [MoE](https://en.wikipedia.org/wiki/Mixture_of_experts) models (284B and up) by streaming experts from NVMe instead of holding them in RAM. It works. DeepSeek V4 Flash ran at about 0.9 tokens a second, even from fast NVMe. That is a demo, not a tool, so I dropped it.
The cloud version of that idea is not better. Streaming experts needs instance-store NVMe (EBS at about 1 GB/s is too slow), which means large memory or storage instances at roughly 2 to 5 USD an hour, so 1.5k to 4k USD a month for 1 to 6 tokens a second. A hosted API is far cheaper for the same models.
## Why a 30B model is the fast option
On a CPU, generating a token means reading the weights that token uses from RAM. Memory bandwidth is the ceiling, so speed follows **active** parameters, not total size.
Qwen3-Coder-30B-A3B is an MoE model with about 3B parameters active per token. At 4-bit, that is roughly 2 GB read per token, which puts the theoretical ceiling for dual-channel DDR4 somewhere in the mid-20s tokens a second. A dense 14B coder would read about four times as much per token and be about four times slower, even though it is "smaller". There is no smaller Qwen3-Coder anyway: Ollama ships 30B-A3B and 480B.
So I picked `qwen3-coder:30b-a3b` (Q4_K_M) and, as the alternative, Gemma 4 26B-A4B (QAT).
## How it runs
- **Ollama** on loopback only, one model loaded and one request at a time, 16K context, capped at 24 GB of memory and a low CPU weight, so the harness and the renders win when they compete.
- **LiteLLM** exposes two aliases, `local-code` and `local-code-alt`, priced at zero with a long timeout and a fallback from one to the other. Apps never talk to Ollama directly.
- **An on/off switch.** `sudo local-llm off` stops Ollama, and deploys respect it. With it off, `local-code` fails at once instead of hanging, which matters more than it sounds when a scheduled job is waiting on it.
The LiteLLM side is a few lines:
```yaml
model_list:
- model_name: local-code
litellm_params:
model: ollama_chat/qwen3-coder:30b-a3b-q4_K_M
api_base: http://:11434
timeout: 900
model_info:
input_cost_per_token: 0
output_cost_per_token: 0
```
Putting it behind the same gateway as the cloud models means every app gets it through the same key and budget rules, and swapping it for a hosted model later is a config change.
## The numbers
| Model | Writing | Reading the prompt | Cold load |
|---|---|---|---|
| Qwen3-Coder 30B-A3B, Q4_K_M | 16.8 tok/s | 65 tok/s | 17 s |
| Gemma 4 26B-A4B, QAT | 13.8 tok/s | 59 tok/s | 14 s |
Seventeen tokens a second of output reads fine. You can follow it as it writes.
One oddity: ask Qwen what it is and it sometimes says "Claude". That is a training-data artifact. The gateway logs say which model actually answered, which is one more reason to put it behind one.
## The catch: the prompt
Generation is bound by memory bandwidth. Reading the prompt is bound by compute, the matrix work a GPU is built for, and a laptop CPU does it at about 60 tokens a second.
That is fine for a question. It is not fine for a coding agent, which sends the whole context on every turn: system prompt, tool definitions, open files, the conversation so far. A 10K-token context takes about **two and a half minutes** before the first output token. Output also slows as context grows: about 15 tokens a second after a short prompt, about 9 after a 2.4K-token one.
Even the chat UI feels it. With its house-style prompt and one tool schema, around 1K tokens before I type anything, the first word takes 15 to 20 seconds, plus 16 seconds of cold load after five idle minutes.
## Tuning that did not help
I tested the usual levers on Ollama 0.31.2 with a 2,448-token prompt and 300-token answers:
| Setup | Short: write | Long: read | Long: write | Long total |
|---|---|---|---|---|
| **6 threads, f16 KV cache (default)** | 16.9 | 61.7 | 8.9 | ~73 s |
| 10 threads | 18.2 | 44.9 | 10.4 | ~83 s |
| 14 threads | 18.8 | 51.1 | 11.7 | ~73 s |
| q8_0 KV cache, 6 threads | 17.0 | 32.5 | 10.1 | ~105 s |
| q8_0 KV cache, 10 threads | 18.4 | 30.9 | 11.7 | ~105 s |
- **Flash attention** was already on. Ollama's `auto` setting enables it on this CPU.
- **A quantized KV cache is a loss on CPU.** q8_0 saves about 0.7 GB but halves prompt reading, because every attention step pays to dequantize it.
- **More threads** help short answers by about 2 tokens a second and tie on long requests, while taking every core away from everything else. These were single runs with about 15% noise. Ollama picks 6, the performance cores, and I kept that.
- **Plain llama.cpp** instead of Ollama would gain little. Ollama already runs it.
I kept every default.
## What would actually help
- **Smaller prompts.** Retrieval does not make generation faster, but it keeps the context small, and the context is the bottleneck. The box already runs an embedding model for my notes search.
- **A GPU, or Apple silicon.** My M2 Pro Mac has about 200 GB/s of memory bandwidth and a GPU for the prompt. My estimate, not a measurement, is 40 to 50 tokens a second of output and several hundred of prompt reading. The cost is that it sleeps and travels, so the gateway would try the Mac first and fall back to the mini-PC.
- **More RAM, same speed class.** A 2×32 GB upgrade, about 100 to 150 EUR, would fit Qwen3-Coder-Next 80B-A3B at 4-bit. It has the same active size, so roughly the same speed with a smarter model.
## Verdict: usable, not good
About 17 tokens a second is roughly three times human reading speed. That is fine for chat and single-file edits, and low for agentic coding.
Some reference points for dense models at Q4, in tokens a second of output. These are typical ranges, not my measurements, except the last row:
| Setup | 7-8B Q4 | 30-32B Q4 | 70B Q4 |
|---|---|---|---|
| RTX 4090 / 3090 | 90-130 | 35-50 | 18-25 |
| M2/M3 Max | 50-70 | 18-25 | 8-12 |
| CPU only (DDR5) | 5-10 | 2-4 | 1-2 |
| This box, MoE 30B-A3B (measured) | | 17 | |
The last row is why the MoE choice matters. A dense 30B on this CPU would sit in the low single digits. With only about 3B parameters read per token, this model runs at small-model speed with 30B-class quality.
What it costs in practice, at about 17 tokens a second:
- **A 500-token answer:** about 30 s. Tolerable.
- **A 2,000-token refactor or file rewrite:** about 2 minutes, more as the context grows. You notice.
- **An agent loop with 5 tool calls that each emit 300 tokens:** about 90 s of pure decode, plus reading the whole prompt again on every turn.
Things that matter more than raw output speed for coding agents:
- **Prefill speed.** Long context (repo files, tool results) is where the time goes. Watch time to first token, not tokens a second. A 30K-token prompt at 500 tok/s of prefill, a good GPU number, is already 60 s before the first token. At this box's 60 tok/s it would take over 8 minutes, and it does not even fit the 16K context I configured.
- **Parallel requests.** If your agent fires subagents or you run several chats, total throughput matters more than single-stream speed. This setup serves one request at a time on purpose, so a second caller waits.
- **The quantization trade-off.** Dropping from Q4 to Q3, or to a smaller model, to gain speed usually hurts code quality more than the speedup helps. I stayed at Q4.
If your 20 tok/s comes from a dense 30B-class model at Q4 on a single consumer GPU or a Max chip, that is normal and I would keep it. If it comes from a 7B model, something is wrong: check for the KV cache offloaded to the CPU, missing flash attention, or Ollama running on the CPU instead of the GPU (`ollama ps` shows the split).
For me it stays a batch worker: summaries, first drafts and background jobs that can wait a few minutes and should not cost per call or leave the house. The interactive agent loop stays on hosted models until the prompt can be read faster.
---
# Why I left Hermes Agent and built my own harness
> In July I wrote that Hermes Agent ran the logistics of my digital life. On 18 October I turned it off and replaced it with a small harness of fixed pipelines, one gated door to the models and an allowlist per job. Here is why, what the rewrite cost me, and when I would still pick a general agent.
- URL: https://ashkmb.com/blog/why-i-left-hermes-agent/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-11-07
- Language: en
In July I wrote that [Hermes Agent](https://ashkmb.com/blog/hermes-automation/) handled the logistics around my blog, YouTube and taxes. On 18 October I turned it off and replaced it with a harness I wrote myself. It had run for about three months.
This is not a takedown. Hermes worked, and that post is still accurate about what it did. It stopped fitting for two reasons, and the second one only became visible once I had lived with the first.
## What I was actually running
Look at what the box did every week and it is a short list: a morning research digest, invoice extraction, a few YouTube pipelines, a fitness coach, a spend page. Each one is the same sequence of steps, run again and again, with a human approving the output.
That matters, because a general agent is built for the opposite case: work where nobody knows the steps in advance.
## Reason 1: the fence was a prompt
I ran Hermes natively on the mini-PC, as my own user, with passwordless sudo. I did that on purpose, so it could see `terraform`, `kubectl` and `gh` like I can. The cost was written in my own notes: a Telegram message was a root shell.
The real fence was two things, a Telegram allowlist and a dashboard password. The gateway turns Telegram on from the bot token alone, with no enable flag, so a missing allowlist entry means anyone who finds the bot gets a shell.
On top of that I added guardrails as skills: plan before apply, never auto-apply, branch before commit, no AI attribution. I needed them because the agent never read my own `CLAUDE.md`. I tested them, and it did refuse "deploy to prod now".
But a skill is a request to a model. Only its description sits in context all the time; the rest is loaded when the model decides it is relevant. A rule the model has to remember to apply is a hope, not a control. I wanted rules that still hold on the day the model gets it wrong.

*How it looked: one general loop, full tool access, and two fences that were not part of the loop itself.*
## Reason 2: a general layer hides where it fails
The failure that made this concrete was OCR. Through Hermes, an image never reached the model. It invented an answer from the filename: four attempts, four fabrications, including a wrong digit and a made-up test card. The same vision model, called directly, transcribed the image perfectly.
That is a plumbing bug, and plumbing bugs get fixed. The lesson is about where it shows up. In a general agent, a broken layer between you and the model looks exactly like the model being wrong. In a pipeline, one step makes one model call with one checkable output, and you can see which part lied.
There was other friction of the same kind: provider secrets could not come from a plugin source because the loader runs before plugins register, and the dashboard session token rotated on every restart, so each deploy logged the desktop app out. None of it was fatal. All of it was somebody else's decisions sitting between me and my own jobs.
## What I built instead
The harness is deliberately dull. Code owns the flow; the model fills in steps.
- **Skills are fixed pipelines.** A skill is a small config plus a prompt, run by one runner, and each skill gets its own tool allowlist. No skill lets a model loop freely over tools.
- **One door to the models.** Everything goes through a single module. It applies alias rules, an approval gate for the expensive aliases and a monthly cap on the strongest one. Models sit behind LiteLLM with a virtual key per client, so a new app cannot spend what it was not given.
- **Validators in code.** The debate show checks every number against its source, including spelled-out ones. A Short may carry at most three numbers. If I force a claim the sources do not support, the script says "X reports" instead of stating it as fact.
- **Boring storage.** The queues are SQLite tables behind a handful of functions. A digest is staged as an outbox, so a kill mid-send repeats at most one part. Postgres and a real queue are a swap behind that one file, and I will do it when volume asks for it.

*The harness at a glance. Everything that can spend money passes through the gate, and a human tap is part of the path.*
A simplified sketch of the gate, because this is the part that Hermes could not give me:
```python
def call(alias, messages, purpose):
if alias in GATED and not approved(purpose):
raise ApprovalRequired(alias, purpose) # waits for a Telegram tap
if alias == "strong" and month_spend("strong") >= STRONG_CAP:
raise BudgetExceeded(alias)
return gateway.complete(alias, messages, tags=[purpose])
```
I put the rule in code instead of in a prompt because code does not get talked out of it. The same idea later moved into my coding-agent setup as a command guard that lives in a config file and is checked by a hook before a command runs.
The spend page shows what this buys. Over the last 30 days all model spend across the apps was 3.66 USD: AgenticTube half, the chat UI a quarter, my memory server a fifth, the harness itself 3%, the fitness coach nothing. Each number has a purpose tag behind it, so I know what it was for.
## Why I did not just adopt an SDK
I looked at AWS's open-source Strands Agents, which is well made and has the multi-agent primitives I would have to write otherwise. I decided to copy its patterns and not use it. Pointed at LiteLLM directly, it would bypass the single door: no approval gate, no cap. If I ever spike with it, it gets its own key limited to the cheap aliases and a small budget.
That is the whole build-versus-adopt argument for me. The thing I care about most sits exactly where a framework wants to put its own loop.
## What it cost, honestly
- **Time.** I rebuilt things Hermes shipped: the Telegram front door, approvals, a dashboard, a job queue, nightly backups. That is weeks of work I did not have to do before.
- **Open-ended asks.** "Go work out X on the box" was a normal request with Hermes. The harness cannot do that. Free-text chat that routes to the existing skills is on my list and not built.
- **It is all mine to maintain.** When something breaks there is no upstream, only me.
- **Some of what annoyed me was fixable.** The OCR bug and the token rotation were both things I could have wrapped or patched. If those had been the only issues I would probably still be running it. The real reason is structural: I wanted enforcement in code, and I had a narrow set of jobs.
## When I would still pick a general agent
When I do not yet know the jobs. Hermes was a good way to find out what I wanted to automate, because it let me try things without building anything. The harness only exists because three months of that told me what the fixed list was.
If your work is a handful of repeating pipelines and you care about who can spend, send or delete what, build the dull version. If you are still exploring, start general, write down what you keep doing, and treat the day that list stops changing as the signal to leave.
---
# The Cluster Used 160 Millicores. Its Requests Needed Six Nodes.
> Before our first customer I asked whether three medium nodes could hold production. The cluster was using about 160 millicores of CPU, yet its resource requests kept six nodes busy. Here is why requests, not usage, decide node count, why the autoscalers read requests too, and why the capacity of a cluster is not the capacity of the product when the expensive work runs at a vendor.
- URL: https://ashkmb.com/blog/node-sizing-requests-not-usage/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-10-27
- Language: en
The question was simple: would three medium nodes hold production? The product had no customers yet, the cluster had been rebuilt the day before, and the node bill looked high for something that was mostly idle. Production had no metrics-server, so before answering anything I installed it as an EKS add-on and looked.
The whole cluster was using about **160 millicores of CPU and 6 GiB of memory**. It was running on six nodes, roughly $245 a month of compute for a workload that would have fit comfortably on a laptop.
The rest of this post is about the gap between those two facts, because it is the single most common misunderstanding about Kubernetes capacity, and it decides what you pay.
## The scheduler never looks at usage
The Kubernetes scheduler places a pod on a node when the pod's **requests** fit into what is left of the node's allocatable resources. It does not read live CPU. It never asks how busy the pod is. A node with 5% real utilization is full, as far as the scheduler is concerned, if the requests on it add up to the node's size.
That is why `kubectl top` is the wrong tool for sizing, and why the output of `kubectl describe node` is the right one:
```sh
kubectl top nodes # what is being used
kubectl describe node | grep -A8 "Allocated resources" # what is reserved
```
The first number was tiny. The second was what had packed three large nodes, one medium node and two small core nodes. The reservations came from a handful of components, none of them busy:
- the node provisioner (Karpenter) asked for a full CPU,
- a warm-pool placeholder reserved 900 millicores so new nodes would already be warm,
- the CPU embedding server ran two replicas at one CPU and 1.5 GiB each, and idled at about 12 MiB of memory.
Together those requests, not any traffic, decided how many machines existed. The cluster was being sized by what its workloads had asked for in a hurry, not by what they did.
The lesson is blunt: **requests decide node count.** If you want a smaller bill, the lever is the numbers in your manifests, and you can only trust those numbers once you have measured real use next to them.
## The reshape
With the measurement in hand, I picked the shape:
- **Three `m7g.large` nodes, one per availability zone.** Not `m6g`, which is slower for the same money, and not `m8g`, which costs more for CPU we did not need.
- **Cluster Autoscaler instead of Karpenter.** For a cluster this small and this predictable, one managed node group and a simple autoscaler is easier to reason about than a provisioner that picks instance types on the fly. This was a call made while there were no customers; I would not make it blindly on a large, spiky fleet.
- **Embedding server trimmed to 250 millicores and 1 GiB.** It idled at about 12 MiB, so even that is generous.
- **Zone spread on the workloads**, so losing a zone does not take out a whole service.
After the change, the requests fit on two nodes at about 92% CPU and 62% memory, and the third node exists for the zone spread. Scale-up to a fourth node took 75 seconds; scale-down back to three took about 12 minutes. The application answered 200 at every check during the migration.
## The autoscalers read requests too
Here is where it gets interesting, because the same rule that inflated the node count also quietly breaks both autoscalers.
**The Horizontal Pod Autoscaler's utilization target is a percentage of requests.** With a tiny request, 80% is a tiny number:
```yaml
resources:
requests:
cpu: 100m
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80 # fires at 80m of CPU, not 80% of a core
```
A service doing almost nothing crosses 80 millicores immediately, so every service pins at its maximum replica count almost at once. The target looks reasonable in review and means nothing in production.
**Cluster Autoscaler grows the cluster on pending pods, not on busy CPU.** With tiny requests, three replicas of everything fit comfortably on three nodes, so no pod is ever pending, so the autoscaler never adds a node, even while the CPU is pegged. The failure mode is a cluster that is hot and refuses to grow.
Both problems have the same fix: set requests near real use before you turn autoscaling on. Otherwise HPA fires too early and Cluster Autoscaler fires too late, and both are working exactly as designed.
## The trap that costs about $60 a month, silently
One review finding is worth its own paragraph, because it is invisible until you read the bill. Cluster Autoscaler defaults to `skip-nodes-with-system-pods=true`. Any node that holds a non-DaemonSet `kube-system` pod without a PodDisruptionBudget is never scaled down. Two of our controllers, the load balancer controller and the EFS CSI controller, had no PDB.
So a node that scaled up under load and happened to receive one of them would stay forever, about $60 a month per stuck node, with no alert and nothing in the logs. A scale test with a throwaway pod on the new node does not catch it, because the throwaway pod is not a system pod. I changed the module default to `false` and applied it live. If you run Cluster Autoscaler, check this flag and check your system pods for PDBs.
## When the expensive work runs somewhere else
The follow-up question was the natural one: how many users can this serve? The answer has less to do with the nodes than I expected.
The cluster's nodes are nearly idle because the language model runs at a hosted provider. A chat message costs a few Spring hops, one query embedding on the CPU embedding server, and a vector query; the heavy lifting happens on someone else's hardware. So the first walls on capacity are not CPU:
1. the provider plan's rate limits, since one key serves everything,
2. document uploads queuing on the CPU embedding server,
3. fixed replica counts, and
4. the database's maximum capacity setting.
Only after those does compute matter. My rough model, which is an estimate and not a load test, says about 800 to 1,500 concurrent active users on three nodes once autoscaling and the vendor limits are sorted, and a realistic cost around $2,400 a month at 10,000 concurrent users, using a growth rule of three more nodes per 800 users. The per-request CPU in that model is a guess good to about a factor of two, and a load test against the demo environment is the thing that replaces it with numbers.
The point is not the figure. It is that **when the expensive work runs at a vendor, your cluster's capacity is not your product's capacity.** Read the vendor's limits before you scale your own nodes.
## What to keep
- **Requests decide node count, not usage.** Measure real use, then set requests next to it. Compare `kubectl top` with the allocated-resources block, not with your intuition.
- **Check autoscalers against your requests.** HPA's percentage is a share of requests, and Cluster Autoscaler only reacts to pending pods. Tiny requests make the first fire early and the second never fire.
- **Audit scale-down blockers.** `skip-nodes-with-system-pods` plus a missing PDB leaves paid nodes running forever, silently.
- **Find the real bottleneck before sizing.** If the expensive step runs at a vendor, its limits come before your CPU does.
---
# We Lost 50 Million Spans and Nothing Logged It.
> A deploy repointed every service's traces at a new collector that was sized for a trickle. The collector blocked, the services' SDKs dropped the overflow, and roughly 50 million spans vanished over two hours with no counter and no log line anywhere. The only warning was about the wrong thing. Here is how the loss stayed invisible, how I measured something nothing had counted, and why the real bottleneck was not the one I reached for first.
- URL: https://ashkmb.com/blog/otel-cutover-silent-span-loss/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-10-16
- Language: en
The alert that fired was a warning about a saturated export queue. Its description said to expect consumer lag upstream. That was the only signal, and it was pointing at the wrong problem. By the time I understood what had happened, an observability pipeline had spent two hours silently dropping the very data it exists to collect: roughly **45 to 50 million spans**, about **600,000 of them billing spans**, gone with no counter incremented and no error logged anywhere in the fleet.
The trigger was mundane. A morning deploy repointed every service's `OTEL_EXPORTER_OTLP_ENDPOINT` from the old trace path onto a new collector running as a StatefulSet. The new collector was correct in every way except one: it had been sized for a trickle, and the cutover handed it the firehose.
## Why the loss left no trace
The new collector's exporter had a persisted send queue of 100 records and used `block_on_overflow`. That one setting is the whole reason the incident was invisible.
When the queue fills, `block_on_overflow` makes the receiver stop accepting data until a slot frees up. The backpressure travels back down the gRPC stream to the service's OpenTelemetry SDK, and the SDK does what SDKs do when they cannot hand a span off: it drops it. The collector's own loss counters, the ones you would alert on, all stayed at exactly zero, because the collector never dropped anything. It refused to accept, cleanly, and the loss happened one hop upstream, inside hundreds of application processes, where nothing was counting.
I swept the logs of 230 pods for an export error. There were none. The SDKs drop silently by default; a dropped span is a metric you have to go looking for, not a line that appears in a log. This is the trap worth internalising: **in an OTLP pipeline, the loss does not happen where you are watching.** The collector is the obvious place to instrument, and the collector is exactly the component that stayed clean through the whole event.
## Measuring what nothing had counted
With no counter to read, the only way to size the loss was conservation: compare the spans that arrived against the spans that should have arrived. The tracing backend still had the accepted data, so I pulled per-service span rates for the same wall-clock window on three days, the day of the incident, the day before, and a week before.
Two things fell out of that comparison. First, the shape. High-volume services had lost 45 to 85 percent of their spans in the window, while low-volume services were flat. A uniform outage does not look like that; backpressure does, because the services producing the most are the ones that hit the closed door first. Second, the size: about 25.5 million spans arrived in the two-hour-ten-minute window, against 73.8 million the day before and 77.6 million a week earlier. Scaled by the pre-cutover ratio, that put the loss at **45 to 50 million spans, as an upper bound**. The billing path told the same story at smaller scale: 391,000 billing spans exported against roughly a million on both comparison days.
One detail about this method is a standing landmine. The comparison windows have to be explicit half-open ranges, `[from, to)`, with the same boundaries on every day. A sloppy query that matches "hour 10" ends up including two different hours on two different days and quietly reports a difference that is really a window mismatch. I have been bitten by that exact thing before, and it bit again here before I pinned the ranges down.
## The bottleneck was not the one I grabbed first
My first explanation was that the 100-record queue was the throughput cap. On a persisted queue the number of requests in flight is bounded by the queue depth, so raising it to 1000 and quadrupling the consumer count was the obvious live patch, and it did help: the per-replica rate went from about 1,000 spans a second to roughly 4,000. But raising the queue past the point where it stopped overflowing bought nothing more, which meant the queue depth was not the real ceiling.
The real ceiling was in how the exporter talks to the broker. The downstream broker is S3-backed and batches writes on a roughly one-second window, and the exporter keeps only **one produce request in flight per broker** with no knob to change it in the version we run. So each replica could complete about one produce per second, and a span arriving mid-produce simply waited for the next one. The lever was never the queue depth or the consumer count. It was how many spans ride in each produce.
Each record carried a batch of 20 spans, a number inherited from the old path, where records were megabytes each and 20 was already large. But live spans off the SDK are about 1.2 KB, not megabytes, so a 20-span record was tiny and the per-second produce limit translated into a laughably low span rate. Raising the batch to **100 spans per record** took the per-replica ceiling from about 4,000 spans a second to roughly 50,000. I stopped at 100 rather than going higher because the sizing has to hold against the worst case, not the average: the largest one-minute-average record over the previous week was 2.8 MiB, and 100 spans keeps a 9x margin under the broker's 128 MiB record limit, while 200 spans cut that margin to 4.5x and was not worth it.
The satisfying part was the cost check. Bigger batches mean fewer, larger records, and I expected to pay for that somewhere. At the same span rate before and after, the compressed byte throughput, the pod egress, the broker's object storage request rates and the backend's ingest were all flat. The broker writes one object per batch window regardless of how many records arrive inside it, so packing more spans into each record is close to free. The fix that mattered cost nothing.
## The twist: dropping is not the worst outcome
There is a sharper edge to this than "we lost data," and it showed up as an anomaly I almost dismissed. After the pipeline recovered, span volume did not just return to normal; it ran well above normal for a while, which made no sense for an event that was supposed to have lost spans.
The cause was one upstream integration whose reader did not drop under backpressure. It blocked. Its own throughput collapsed, its processing lag climbed, and when the collector finally freed up it replayed its entire backlog at its maximum rate, briefly about 2.3x normal volume. For that one data source, the span backpressure had been converted into real business-processing lag, data arriving late rather than not at all.
That is the uncomfortable design question the incident surfaced. "Never lose a production span" and "never delay production data" are not the same goal, and under a backed-up collector they pull in opposite directions. An SDK configured to drop protects the application's latency and sacrifices telemetry. An SDK configured to block protects telemetry and injects latency into whatever is producing it. Which one is correct is an application-team decision about what that specific service can tolerate, and it is not a decision an observability default should be making silently on everyone's behalf.
## What actually prevents the repeat
The queue resize and the batch change fixed the throughput. Neither of them would stop this from happening again, because the failure was not that a queue was too small; it was that a queue filling up was not something anyone was told about until it had been full for two hours.
So the durable fix was a new critical alert that watches the live exporter queue directly and fires when it stays above 95 percent full for five minutes, per replica, before the SDKs upstream start refusing handoffs. The generic saturation warning that misfired at the start now explicitly excludes this exporter, so the two alerts do not talk over each other.
I also tried to add a day-over-day intake alert, "today's spans are far below yesterday's," and could not. The production metrics store keeps only 48 hours, and traffic has strong weekly seasonality: a Saturday morning legitimately runs at a third of a Friday's. There is no honest threshold for a rule that cannot see last week. That comparison lives on a dashboard backed by longer-term storage instead, with intake plotted against the same window a week earlier so a human can see a cutover-shaped hole at a glance.
## What to keep
- **In an OTLP pipeline, instrument the senders, not just the collector.** `block_on_overflow` moves the loss into the application SDKs, where the collector's clean loss counters will never see it. Alert on the queue filling, upstream of the drop.
- **A queue depth is rarely the throughput ceiling.** When raising a queue past the overflow point buys nothing, the limit is somewhere else; here it was one produce in flight per broker, and the real lever was spans per record.
- **Dropping and blocking are different failures.** One loses telemetry, the other delays business data. Choose deliberately per service; don't let a default choose for you.
- **Size batches against the worst case, not the average.** The record limit is a hard ceiling, and the largest record in a week is what has to fit under it.
---
# The Snapshots Added Up to 21 TiB. Deleting Them Freed 687 GiB.
> EBS snapshots bill on changed blocks, not on the size of the volume. A merge-heavy database volume can cost more to snapshot than everything else in the account, while a large idle disk costs nothing. Here is how I measured it, why a cleanup that looked like 21 TiB freed 687 GiB, and why a belief I had written down about deleted source volumes was wrong.
- URL: https://ashkmb.com/blog/ebs-snapshot-cost-write-churn/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-10-01
- Language: en
When I got back from a week off, I opened Cost Explorer to finish a job I had started before I left: the EBS snapshot bill in our production account. The September monthly view still showed snapshots as one of the bigger storage lines, so I went looking for what was left to cut.
The daily view told a different story. The snapshot line had dropped from about **$33 a day to $4.90 a day on September 17**, twelve days earlier. The fix had already landed, and I was the one who landed it. The monthly bar mixed sixteen days before the change with twelve days after it and showed an average that described neither. If a cost changed partway through a period, read it at daily granularity before deciding what still needs doing.
The rest of this post covers why that fix worked, why the cleanup I had planned was worth about thirty times less than its numbers said, and a mistake about snapshots I had written down myself.
## Snapshots bill on changed blocks
EBS snapshots are incremental. The first snapshot of a volume stores every block that has ever been written. Each later snapshot stores only the blocks that changed since the one before it. You pay for stored blocks, at about $0.05 per GB-month on the standard tier. The volume's provisioned size never enters the formula.
That makes provisioned size a bad stand-in for snapshot cost, and in our account it was off by two orders of magnitude. These are measured changes between two consecutive daily snapshots:
| Volume | Provisioned | Changed in 24h |
|---|---|---|
| Analytics column-store (×3) | 1280 GB | 97.7 GiB each |
| Time-series database (×3) | 300 GB | 6.9 GiB |
| CI server data | 200 GB | 0.18 GiB |
| Data disk on a stopped instance | 150 GB | 0.00 GiB |
A column-store database rewrites its data files constantly. Background merges combine small parts into larger ones, and a merged part is a new set of blocks on disk even when the rows inside it are the same. So every daily snapshot of those volumes was close to a full copy. With a lifecycle policy keeping 14 dailies, 13 weeklies and 12 monthlies, those three volumes dominated the whole snapshot bill. The 150 GB disk on a stopped instance cost nothing, which is fair, since it was also the least worth protecting.
On September 17 the column-store and time-series volumes came off the snapshot policy. Before that I checked that each one had another way back. The time-series database ships its WAL to object storage every day, and I confirmed those runs were completing, not just scheduled. The column-store holds observability data that can be rebuilt. Rebuildable data with heavy compaction is about the worst thing you can snapshot daily: you pay for nearly a full copy every day to protect something you would rather regenerate anyway.
The lesson is to judge a volume by its write pattern, not its size. Ask what the volume does all day before you ask how big it is.
## Measuring the delta
The EBS direct APIs let you compare two snapshots of the same volume block by block. `list-changed-blocks` returns the blocks that differ, and `list-snapshot-blocks` returns every block a single snapshot references. Multiply the block count by `BlockSize` (512 KiB) and you have bytes.
One trap cost me a wrong answer first. The API returns far fewer blocks per page than `--max-results` suggests, and the AWS CLI does not paginate this call for you. My first script capped the number of pages, so it reported a floor and labeled it as the total. The loop has to follow `NextToken` until it runs out:
```sh
count=0; token=""
while :; do
page=$(aws ebs list-changed-blocks \
--first-snapshot-id "$older" --second-snapshot-id "$newer" \
${token:+--next-token "$token"} --output json)
count=$(( count + $(jq '.ChangedBlocks | length' <<<"$page") ))
token=$(jq -r '.NextToken // empty' <<<"$page")
[ -z "$token" ] && break
done
echo "$(( count / 2 )) MiB changed" # 512 KiB blocks
```
This is slow on a busy volume, because a 97 GiB delta is close to 200,000 blocks. It is still the only number that tells you what a snapshot actually costs.
## Twelve days later: the sediment
On September 29 the account held 1,177 snapshots. Grouping them by description showed that four generations of snapshot jobs had produced them:
- the current lifecycle policy, the only one with retention;
- a retired weekly scheme;
- three lifecycle policies that had been replaced over the years;
- a nightly job on an old CI server, still snapshotting an instance that had been stopped for months.
There were also leftovers from a message-broker cluster that no longer exists, and backup history from before a volume restore. Only the current policy ever pruned anything. Everything else had accumulated, and a snapshot count that suggests one policy's settings is really the sum of several jobs that nobody turned off.
I deleted 655 of them, keeping the newest snapshot of each retired volume where its history might still matter, and went from 1,177 to 522. The account has no Recycle Bin retention rule, so those deletions were final. That is worth checking before you start, not after.
## Why 21 TiB was really 687 GiB
Before deleting, I had added up the snapshots' sizes. 529 of the snapshots on the list reported about **21.7 TiB** between them. If that were the storage being freed, the cleanup would have been worth more than $1,000 a month.
It freed about **687 GiB**, roughly $34 a month.
The reported size of a snapshot is the full volume image it can restore, not the storage it uniquely owns. Fourteen dailies of the same volume each claim the whole disk, but they share almost all of their blocks with each other. Adding them up counts the same blocks fourteen times.
What a deletion frees has to be worked out per source volume, as a chain:
```
U(chain) = full size of the oldest snapshot
+ Σ changed blocks between each consecutive pair
freed ≈ U(all snapshots of the volume) − U(the snapshots you keep)
```
`list-changed-blocks` works between any two snapshots of the same lineage, not just neighbors, so `U(kept)` can be computed even when the snapshots you keep are months apart. Do this before you put a number in a ticket. The big saving had already come on September 17, from changing what the policy covered. The sediment cleanup was an order of magnitude smaller, and the summed sizes would have made it look like the headline.
## A belief I had to retract
On September 17 I wrote down, with some confidence, that once a source volume is deleted, its snapshots stop being cheap increments and become full standalone copies forever. I used it to explain why retired schemes seemed to cost the most.
It is wrong. Snapshots of a volume keep sharing blocks with each other whether or not the volume still exists. When you delete a snapshot, EBS removes only the blocks no other snapshot references. Deleting the volume changes nothing about snapshot storage.
Old backup schemes keep costing money for a much duller reason: nothing ever deletes their snapshots. The wrong version was worse than useless here, because it pointed the same way as the summed sizes. Both said the sediment was the expensive part, and both were wrong.
## Where I stopped
The live policy now holds about 1,080 GiB, roughly $54 a month. Cutting retention to 7 dailies, 4 weeklies and 6 monthlies would save about $12 of that. I left the retention as it was. At this scale, the recovery window is worth more than the money.
One oddity is still open. A small restored data volume has snapshots that hold more than twice its own size, so something on it rewrites a lot of blocks every day. It is the next thing to look at, but at these numbers it is a curiosity, not a cost problem.
## What to keep
- **Snapshot cost follows write churn.** Measure the daily delta with `list-changed-blocks` before deciding what to protect, and expect merge-heavy databases to be the outliers.
- **Summed snapshot sizes are not storage.** Estimate what a deletion frees per volume chain, or the number in your ticket will be wrong by an order of magnitude.
- **Read cost at the granularity of the change.** A monthly bar that straddles a fix shows an average that no day actually had.
---
# The Registry Answered in 45 Milliseconds. The Build Took Two Minutes Longer.
> After a server migration, builds against a self-hosted package registry got two minutes slower and every report pointed at the move. Every failing request was a 500 in 45 milliseconds; the entire regression was npm's retry backoff. The root cause was one row out of 63,000 still pointing at an object store that no longer existed, and the check written to catch exactly that iterated a hand-written list of tables and missed it.
- URL: https://ashkmb.com/blog/npm-registry-retry-backoff-one-row/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-27
- Language: en
A few weeks after we relocated our self-hosted GitLab instance to a new account and a new host, the solutions team reported that npm installs against the group package registry had got slow. Builds that took 1:40 to 2:00 now took about 3:30. A clean-cache `npm install --verbose` showed the shape of it: repeated 500s, each followed by eventual success. The timing lined up with the migration, and the regression was consistent, so the report came in as "slow since the relocation." It was a reasonable report. It was also wrong in a specific and instructive way.
## A constant added interval is a client retry, not a resource problem
The first thing I timed was the failing request itself: **500, in 45 milliseconds. Every single one.**
That is the whole diagnosis in one number. A resource problem, a slow disk, a starved CPU, an undersized instance, produces latency that varies under load and degrades gradually. A constant added interval is something else: a fixed pause inserted by the client between attempts. npm's fetch retry policy walks a backoff schedule, roughly T, T+10 seconds, T+70 seconds, before giving up on an endpoint. Add those pauses to the requests that had to be retried and you get almost exactly the reported extra 110 seconds. The server was never slow. The builds were slow because the client was waiting politely between failures.
I could have spent an hour on gp3 IOPS and instance sizing and found nothing, because the disk and the CPU were fine. The lesson generalizes past npm: when "slower since X" resolves to a constant interval rather than a distribution shift, stop measuring the server and start reading the client's retry configuration. Status codes first, then timings, then dashboards.
## One row in 63,000
Every 500 carried the same exception:
```
RuntimeError: Object Storage is not enabled for Packages::Npm::MetadataCacheUploader
```
GitLab caches each package's npm metadata, the packument, in a table called `packages_npm_metadata_caches`. Like everything GitLab stores through CarrierWave, each row carries a store column: `1` means local disk, `2` means object storage. This instance had object storage globally disabled. One row in that table said `file_store = 2`, so any request for that package's metadata asked CarrierWave to fetch from a backend that did not exist, and the request died with a 500.
We had attempted object storage once, in July, and rolled it back. The rollback was thorough in one specific way and blind in another, which is the next section. What matters here is the audit: I queried `information_schema` for every table carrying a store column, checked all of them, 62 tables and roughly 63,000 rows, and found exactly **one** row pointing at the remote store. That single row was the entire incident. The 554 actual package files were all local, which is why tarball downloads returned 200 in 60 milliseconds throughout: the registry genuinely was healthy. Only the metadata cache read path was broken, and only for the packages whose cached row had been flipped.
## The check existed; the list did not
The uncomfortable part is that this failure was already documented. The rollback procedure for the object storage attempt, written in July, ends with the correct assertion: verify object storage is disabled and query for zero rows at `file_store = 2`. The check existed. It was even the right check.
It failed because the step above it iterated a hand-written list of model names. Whoever wrote the runbook enumerated the tables they remembered storing files: uploads, artifacts, package files, and so on. `Packages::PackageFile` was on the list. `Packages::Npm::MetadataCache` was not, because in July nobody thought of the metadata cache as a file store, so it was never asserted, so its one flipped row survived the rollback pointing into a bucket that was about to be deleted.
A check that exists but does not cover the thing that breaks is worse than no check, because it buys confidence it has not earned. The fix is mechanical: assertions about coverage must enumerate from the schema, not from memory. One `information_schema` query finds every candidate table regardless of what anyone recalled while writing the runbook. If your verification step contains a literal list of table names, that list is a guess, and it should be treated as one.
## Dating the landmine
Attributing the outage took three passes, and the first two were wrong in opposite directions.
The row predated the September cutover by seven weeks, and no object storage bucket existed in either account, so my first answer was "probably broken before the move." Then the background job returned the full row, showing `last_downloaded_at` three minutes after `updated_at`. That timestamp is written only on the success path, so the cache had demonstrably been served at some point, and I corrected to "the move is the likely trigger."
The journal settled it. The object storage experiment and its revert are dated July 24. The row's last successful read was July 22, two days earlier, while it was still local. So the sequence was: the July migration flipped the row to remote, the rollback missed it, the bucket was deleted, and the row sat inert for seven weeks because a `file_store = 2` row only detonates when something reads that specific object. Nobody pulled that package until this week. The September relocation was innocent; it merely carried a database that already contained the landmine. The team's correlation was honest and wrong, and I reinforced it before checking.
One detail deserves its own sentence: the store flip was done with `update_column`, which skips timestamps, so `updated_at` on the row points at unrelated activity and will actively mislead anyone dating the change from the row alone. When a timestamp matters, check how the column was written before trusting it.
## The dangerous part was deleting it
The fix was one row, so the fix was one delete. That delete had its own trap: CarrierWave models fire a removal callback on `destroy`, and that callback tries to delete the file from its configured backend, which is the operation that raises the error we were trying to clear. The row had to be removed with `delete_all`, which skips callbacks entirely.
Three layers of backup went first: an RDS snapshot, which is what actually holds the row, snapshots of both EBS volumes, and a dump of the row itself with a ready `INSERT` statement. All verified before touching anything. The API reads the cache with `metadata_cache&.file`, so a missing row short-circuits to the regeneration path: the packument is rebuilt from the package files and stored fresh.
The verification was the satisfying part. The regenerated cache landed at `file_store = 1` on local disk, at exactly **6,786 bytes, identical in size to the July cache**, which is good evidence the content round-tripped rather than merely stopped erroring. Instance-wide afterwards: zero 5xx, zero rows at the remote store, builds back under two minutes.
## What to keep
Two rules survived this one. When a regression shows up as a constant added interval, read the client's retry behavior before touching the server's resources; a 500 in 45 milliseconds followed by a two-minute delay is the client walking its backoff, not the server struggling. And when a verification step enumerates coverage from memory, replace the list with a schema query; the table nobody remembered is where the next incident is already sitting.
---
# Opus 5.5 beats Fable 5.1 at 40% of the price. Read the benchmark table twice.
> Anthropic shipped Opus 5.5 today at $4/$20 per million tokens, and its own table puts it ahead of Fable 5.1 and GPT-6 Astra on agentic coding. The independent numbers are smaller, the code-quality numbers are mixed, and thinking can no longer be turned off. Sonnet 5.5 is not out yet.
- URL: https://ashkmb.com/blog/opus-5-5-benchmarks/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-22
- Language: en
Anthropic released Opus 5.5 today, September 22, 2026. Two months ago I wrote that [Opus 5's real story was the API changes](https://ashkmb.com/blog/opus-5-what-actually-changed/), not the benchmarks. This time the benchmarks deserve a closer look, partly because they are big and partly because the first independent run already disagrees with one of them.
One thing first, since I went looking for it: **there is no Sonnet 5.5 yet.** The announcement says Sonnet 5.5 and Haiku 5.5 will follow "in the following weeks" with similar improvements. So this post is about Opus 5.5 alone, and Sonnet 5 is still the current Sonnet.
## Quick picks
| If you are... | Pick | Why |
|---|---|---|
| Running long agentic coding sessions | Opus 5.5 | Leads Terminal-Bench 4.0 and FrontierCode in Anthropic's table, and ties GPT-6 Astra on Terminal-Bench in the independent run, at a lower price |
| Paying Fable 5.1 prices for coding work | Opus 5.5 | Higher scores at $4/$20 against Fable's $10/$50 |
| Doing agentic science or SaaS workflow automation | Test GPT-6 Astra too | Astra leads Terminal-Bench-Science and AutomationBench |
| Relying on `thinking: disabled` or forced tool use | Stay on Opus 5 until you migrate | Both now return a 400 |
| Waiting for a cheaper mid-tier upgrade | Sonnet 5 for now | Sonnet 5.5 is announced, not released |
## Anthropic's table
Here is the full comparison from the [launch page](https://www.anthropic.com/claude-opus-5-5):
| Benchmark | Opus 5.5 | Fable 5.1 | Opus 5 | GPT-6 Astra | GPT-5.6 Sol |
|---|---|---|---|---|---|
| Terminal-Bench 4.0 | **66.4%** | 55.8% | 52.3% | 57.9% | 37.3% |
| FrontierCode v1.1 (Main) | **54.4%** | 50.3% | 48.0% | 53.3% | 47.5% |
| CursorBench 4.0 | **57.8%** | 51.8% | 46.6% | n/a | 41.7% |
| GDPval-AA v2.1 (Elo) | **1846** | 1735 | 1708 | 1542 | 1588 |
| AutomationBench | 40.0% | 31.4% | 26.9% | **41.4%** | 28.8% |
| Humanity's Last Exam (tools) | **67.7%** | 65.6% | 63.6% | 57.2% | n/a |
| Terminal-Bench-Science 0.1 | 58.7% | 52.6% | 29.0% | **64.6%** | 22.4% |
| OSWorld 2.0 (partial) | **81.8%** | 80.7% | 74.0% | n/a | n/a |
| Chartography (tools) | **89.0%** | 88.4% | 83.4% | n/a | n/a |
The headline is the first row. [Terminal-Bench](https://www.tbench.ai/) measures an agent working in a real shell on multi-step tasks, which is the closest public benchmark to what I actually do with these models all day. A jump from 52.3% to 66.4% in two months, and a 10-point lead over Fable 5.1, would be the largest single-release gain on that benchmark I have seen.
GDPval-AA is the other big one. It scores professional deliverables (reports, spreadsheets, analyses) head to head and reports an Elo rating. A 300-point gap over GPT-6 Astra means Opus 5.5 wins most direct comparisons, not just a few.
Two rows go the other way, and Anthropic printed them anyway, which I appreciate. Astra leads **AutomationBench** (business workflows across SaaS tools) by 1.4 points, a gap too small to matter. It leads **Terminal-Bench-Science** by about 6 points, which does matter if your agents do scientific computing.
## The independent run is smaller
[Artificial Analysis](https://artificialanalysis.ai/articles/claude-opus-5-5) ran its own evaluations the same day. Their summary: Opus 5.5 at max effort scores 58 on their Intelligence Index, the highest they have measured "by several points," and it leads six of their ten component evaluations.
But their **Terminal-Bench 4.0 score is 59.6%, not 66.4%.** Artificial Analysis puts that 11 points above their own Opus 5 run, and level with GPT-6 Astra at xhigh effort. What it does not show is a 10-point lead. Their Humanity's Last Exam number is 61.4% against Anthropic's 67.7%, although that gap is at least partly because the two runs use different tool setups.
This is normal. Vendors tune the harness, the effort level, and the timeout budget, and independent evaluators use one standard harness for every model. Neither number is wrong. They measure different things: Anthropic's shows what the model can do in a setup built for it, and Artificial Analysis shows how it compares with everything else under the same conditions. If you are choosing between Opus 5.5 and Astra for terminal agents, "tied, at a lower price" is the honest summary. That is still a good result.
## Less code, not always better code
Sonar ran its [code-quality evaluation](https://www.sonarsource.com/blog/claude-opus-5-5-an-evaluation/) across 4,444 Java tasks from HumanEval, MBPP, and ComplexCodeEval and compared Opus 5.5 against Opus 5. This is the most interesting data from launch day, because it measures what the code looks like, not just whether it passes:
- **Pass rate went down slightly:** 87.7% against 88.6% on Opus 5.
- **27.5% fewer lines of code** for the same tasks, and **40% fewer output tokens.**
- **Blocker-severity bugs dropped 41%** per million lines, and blocker vulnerabilities dropped 53%.
- **Overall bug density rose 12%**, and **concurrency issues rose 44%** per million lines.
- **Comment density fell from 10.5% to 3.1%.**
My reading: Opus 5.5 writes tighter code with fewer catastrophic mistakes, but it spends fewer lines on each problem, so the bugs that remain are packed closer together. The concurrency number is the one I would watch. If your agents write Go with goroutines or anything with shared state, review those diffs more carefully than usual. The drop in comments will please some people and annoy others; if you want comments, you now have to ask for them.
## The price, and the catch in the price
Opus 5.5 costs **$4 per million input tokens and $20 per million output**, down from Opus 5's $5/$25. Cache reads dropped from $0.50 to $0.20, batch is half price at $2/$10, and fast mode runs at $8/$40 on the Claude API only. The 1M context window and 128k max output are unchanged.
Fable 5.1 and GPT-6 Astra both list at $10/$50, which is where the "60% cheaper" headlines come from. Anthropic's own claim is more careful: about **40% less than Opus 5 on typical workloads**, because the model also uses fewer tokens per task. The Sonar data supports that.
The catch is effort. Opus 5.5 thinks more per turn than Opus 5 at the same effort level, most of all at `xhigh` and `max`. [Kingy AI's comparison](https://kingy.ai/blog/claude-opus-5-5-specs-benchmarks-pricing-comparison/) estimates about 119,000 output tokens per task at max effort, against about 27,000 for Astra. I have not verified that figure, but if it is even roughly correct, a lower per-token price does not guarantee a lower bill at max effort. The default effort also dropped from `high` to `medium`, so a request that never set `effort` now does less thinking, not more. Set it explicitly and measure the cost per task, not the cost per token.
## What breaks when you swap the model string
Opus 5 changed defaults. Opus 5.5 removes options. The [migration guide](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide) lists four breaking changes, and each one returns a 400 instead of failing silently, which is at least easy to spot:
1. **Thinking can't be disabled.** Both `thinking: {type: "disabled"}` and manual `budget_tokens` are rejected. Effort is the only control now; use `low` where you used to turn thinking off.
2. **Forced tool use is gone.** `tool_choice` of `any` or `tool` is rejected. Use `auto` with `strict: true` or structured outputs, and name the tool in the prompt.
3. **Thinking blocks are tied to the model and the conversation.** On accounts created on or after August 31, 2026, replaying a thinking block after you edit the system prompt, the tools, or an earlier message returns a 400. Keep conversations append-only.
4. **The old `computer_20251124` tool is rejected** on the Claude API and Google Cloud. Move to `computer_toolset_20260801`. Bedrock still accepts the old tool.
A fifth change doesn't error at all, which makes it the easiest to miss. **The short text the model writes between tool calls now arrives in `thinking` blocks**, and at the default display setting those blocks are empty. If your UI shows "now reading the config file..." style progress updates, it will go quiet with no error. Set `thinking.display` to `"updates"` (beta) to get them back.
Point 3 also matters for fallback, which The New Stack headlined as ["your agent calls might secretly get routed to an older model"](https://thenewstack.io/claude-opus-5-5-release/). The documented mechanism is this: Opus 5.5 now runs biology classifiers in addition to cyber ones, and with server-side fallback enabled, a declined request is retried on another model. Only Fable 5.1 and Mythos 5.1 can read Opus 5.5's thinking blocks, so a fallback to anything else continues the conversation without the earlier reasoning. It is documented, and it is opt-in, but if you enabled `fallbacks: "default"` on Opus 5 and never thought about it again, check your logs for which model actually answered.
## What I am doing
1. Swap to `claude-opus-5-5` in a dev branch and grep for `"disabled"`, `budget_tokens`, and `tool_choice`. Those are the 400s.
2. Set `effort` explicitly everywhere. The default moved down, and the thinking per level moved up, so no carried-over setting means the same thing it did last week.
3. Compare cost per completed task against Opus 5 on a real workload before switching production traffic, not cost per token.
4. Add a review step for concurrency code, based on the Sonar numbers.
5. Wait for Sonnet 5.5 before touching anything that runs on Sonnet 5. If it follows the same pattern, it will come with the same breaking changes.
The model is a real step forward, and even the independent numbers put it at or near the top of every agentic benchmark at a lower price than its competitors. Anthropic's table just makes the lead look larger than a neutral harness does. Plan for "tied with Astra, cheaper, and better at knowledge work," and treat anything beyond that as a bonus.
---
**Sources**: [Introducing Claude Opus 5.5](https://www.anthropic.com/claude-opus-5-5) (Anthropic, September 22, 2026); [What's new in Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5) and the [migration guide](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide) (Claude Platform Docs); [Artificial Analysis](https://artificialanalysis.ai/articles/claude-opus-5-5); [Sonar](https://www.sonarsource.com/blog/claude-opus-5-5-an-evaluation/); [VentureBeat](https://venturebeat.com/technology/anthropic-releases-claude-opus-5-5-beating-fable-5-1-on-key-agentic-benchmarks-at-60-cheaper-api-price); [Kingy AI](https://kingy.ai/blog/claude-opus-5-5-specs-benchmarks-pricing-comparison/). Figures were reported on launch day and have not been independently reproduced.
---
# 84 Repositories Vanished. The Fix Was mkdir.
> S3 has no empty directories, and in a fully packed git repository the refs directories are exactly that: empty. A file-by-file sync carried every object intact and dropped the two directories git requires to call something a repository, so 84 of 517 came back unreadable while the database still said they had commits. The migration's health checks stayed green the whole time, because none of them ever open a repository.
- URL: https://ashkmb.com/blog/s3-sync-drops-empty-directories/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-18
- Language: en
Three days after we migrated a self-hosted GitLab instance, a colleague asked whether two projects had disappeared. The web UI showed the project pages, the issue lists, the members. The database still recorded 125 commits and 584 KB for one of them. Asking git for anything returned "A repository for this project does not exist yet."
It was not two projects. It was 84 of 517 across the instance, 34 of them active, including production services. Nobody had noticed for three days, because the affected repositories were, almost by definition, the ones nobody had touched recently.
## The signature that says nobody deleted anything
The first instinct on hearing "repositories vanished" is to look for a deletion. The data said otherwise, and the split was clean enough to be a rule.
Every project record was intact: issues, merge requests, members, events, a correct commit count, a correct size in the database. The git layer underneath was absent. When metadata survives and data does not, deletion is the wrong hypothesis; something in the storage layer moved wrong. Metadata gone too would mean a deletion. Metadata alive with data missing means a transfer or a mount, and points you at the path the bytes took rather than at anyone's actions.
That split kept the investigation from wasting its first hour on who did what, and pointed it at the migration instead.
## What git actually requires
A git repository is not "the files". It is a graph of objects, plus a set of references pointing into that graph. The references live under `refs/`, with branch tips in `refs/heads` and tags in `refs/tags`, traditionally as one small file per reference.
As repositories grow, housekeeping packs those references into a single `packed-refs` file, the same way loose objects get packed. It is a routine performance optimisation, invisible to every user of the repository. But once packing is complete, `refs/heads` and `refs/tags` contain no files. They are empty directories.
Git still requires `refs/` to exist before it will call a directory a repository. So the repositories that had been maintained most thoroughly, the packed ones, were exactly the ones where the directory git demands was empty.
## S3 has no empty directories
The migration had staged the Gitaly storage tree through S3 and restored it with `aws s3 sync`. That path had been chosen for good reasons: no routing changes, no security-group changes, nothing mutated on the network path, and a sync that is incremental in both directions so the pre-seed-then-delta shape survives a short freeze window.
But S3 keys are flat. There are no directories in the object model at all; a directory is an inference a client draws from key prefixes, and a directory with no files under it has nothing to infer it from. It does not arrive.
Nothing about this is visible in a byte count. We had compared sizes on both sides, and both sides agreed, because empty directories hold no bytes. Every object transferred intact. The two empty directories that git requires simply did not exist at the destination, and git refused to recognise the tree as a repository, with every object of every commit sitting right there.
This is the part worth internalising. The copy was faithful. It carried exactly what its contract says it carries: objects. The contract is not the filesystem, and the filesystem carried the meaning.
## The arithmetic that turned a guess into a root cause
For a while the selection looked random, which is the shape that makes you doubt the hypothesis. Why these 84? Some were years idle, but one had been pushed to six weeks ago. Randomness is what a wrong theory looks like from inside.
Then we counted. 517 repositories with content. 433 of them had loose reference files, so their `refs/` directories contained files and therefore survived the sync. 84 did not. 517 equals 433 plus 84, with no remainder.
The damage was perfectly determined by whether housekeeping had packed the repository. That is why it skewed old and idle, and still caught something recent: packing is a function of history, not of current activity. A correlation that survives being counted exactly is a root cause; the remainder is the proof.
## The checks that stayed green
Here is the uncomfortable part. The migration's exit criteria had been signed off, and the checks named in them had passed. Every health signal was green for all three days.
| Check | What it actually does |
|---|---|
| `gitlab:gitaly:check` | One line: probes the service, never opens a repository |
| `gitlab:check` | ~560 lines of configuration, connectivity, namespaces |
The misleading entry is `gitlab:check`. It prints one line per project, which looks for all the world like a per-repository check. It is filed under "Projects have namespace". It never touches a repository. Both checks returned clean with 16 percent of the instance's repositories unreadable, and both would return clean again tomorrow under the same fault.
The tasks that do check are `git:fsck`, which verifies integrity across every repository, and `git:checksum_projects`, which checksums every project's references. Neither is part of `gitlab:check`, which is exactly why neither ran. The exit criteria named the two tasks that provably could not detect the failure they were meant to gate.
`checksum_projects` is the right tool around any migration, and it needs no knowledge of what went wrong to catch it: run it on the source before the move, on the target after, and diff. A dropped `refs/` shows up immediately. Verification only proves what it actually tests, and the cheapest time to learn what a check tests is before you depend on it.
## Where this generalises, and the blind spot
Recovery was four `mkdir` calls per repository. No restore, no restarts, no data loss at any point. They came back the instant the directories existed.
The rules, in order of how much they cost us:
Empty directories are data. Any tree whose structure carries meaning, a git storage root, a mail spool, an application directory with a lock directory, has to be moved with a tool whose contract includes the filesystem. `tar` the tree into S3 rather than syncing file by file and the entire problem disappears, because tar carries the directories as entries rather than inferring them from keys.
A green check is only evidence about the question that check asks. A migration's exit criteria are a list of questions, and if nobody checked what the checks actually test, the list may be a list of the wrong questions.
And the honest one. Months before the move, the sync path had been studied and an enumeration of what it silently drops was written down: hard links, symlinks, ownership. Each item measured carefully at the time. Empty directories were not on the list. The note was written early in the same migration that later used this exact path, and the one item missing from an otherwise careful enumeration is the one that broke 84 repositories.
An enumeration of what a tool drops is only as good as its blind spots, and the edges are invisible from inside, before and after in exactly the same way. The check that would have caught it is one command, and it belongs in front of any object-storage move: `find -type d -empty | wc -l`. If that number is zero, sync can carry the tree. If it is not, the count is the list of things about to go missing, written down before they go rather than after.
---
# The Constraint Was Satisfied. The Zone Was Empty Anyway.
> A topology spread constraint is only ever a statement about the population its selector matches, and an operator-set label can quietly pool sibling Deployments into one shared count. Three collectors each satisfied their hard zone spread while the union of them left a zone empty, and the standard repair converged on the same wrong answer every time.
- URL: https://ashkmb.com/blog/topology-spread-satisfied-but-wrong/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-18
- Language: en
I was restarting a collector pod by pod to converge some zone-aware routing, one at a time so nothing lost capacity. Three safe deletions later, two pods of the same Deployment sat on a single node and its own zone was empty.
The namespace has a hard spread constraint on every one of these Deployments. Its entire job is to prevent the state I had just produced. And it was satisfied the whole time.
## What the constraint actually promises
A `topologySpreadConstraint` is evaluated once, when a pod is scheduled, and never again. Kubernetes does not rebalance. When a pod comes up, the scheduler counts, per value of the topology key, the pods that match the constraint's `labelSelector`, computes the skew against `maxSkew`, and places accordingly. After that moment nothing re-evaluates; a pod stays where it landed until something deletes it.
That makes "satisfied" a claim about two things at once: a count, and the population it was counted over. The count was right in my case. The population was not.
It is tempting to reach for `whenUnsatisfiable: DoNotSchedule` and call the constraint stricter. That is not the issue, and it was not mine. The strictness was never the input. The population was.
## Defect one: the rollout stacks
The first way the population lies goes through time.
During a rolling update there are briefly two ReplicaSets: the outgoing one being drained and the incoming one being filled. A bare `labelSelector` matches both. The scheduler is therefore placing new pods against a population that includes pods about to disappear, sees a skew it cannot satisfy, and packs two replicas onto one node. They then stay there indefinitely, because nothing re-evaluates, and the next rollout does it again.
The fix is one line:
```yaml
matchLabelKeys:
- pod-template-hash
```
The scheduler appends the pod's own `pod-template-hash` to the selector before counting, which scopes the population to the pod's own ReplicaSet. The dying siblings stop being counted and the rollout spreads normally. GA since Kubernetes 1.30, and cheap enough that it belongs on every spread constraint that has a selector with no per-workload identity in it.
## Defect two: the shared label pools three Deployments
The second way the population lies goes sideways, and it is the severe one.
An operator manages three collector Deployments in this namespace, three, two and two replicas. It sets `app.kubernetes.io/component: opentelemetry-collector` on all of them, because that is what the label means: what a thing is, not which thing it is.
Every one of the three Deployments carries a spread constraint selecting on that component label. So every one of them computes its skew over the union of all seven pods. Three constraints, one shared population, none of them counting its own replicas.
During my pod-by-pod restart, the combined distribution across the seven pods was 3/1/2 by zone. From the union's point of view, the one-pod zone was the minimum, so the skew filter kept admitting pods there. From the three-replica Deployment's point of view, that zone already had a pod, and the pod I had just deleted belonged to it, so its replacements were being steered away from its own empty zone. Two of its replicas ended up stacked on one node.
Here is the part worth sitting with. The constraint was satisfied throughout, and the scheduler was correct throughout. It was told to count pods it should not have counted, it counted them, and it honoured the skew it computed. The defect was never in the mechanism. It was in the population declaration.
The fix is per-workload identity in the selector. The operator sets an instance label per Deployment, so the constraint becomes:
```yaml
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: # scoped
matchLabelKeys:
- pod-template-hash # added
```
Read the instance label off a live pod rather than assuming the key. Operators label by kind, and a label that identifies a kind is exactly the wrong key to spread on.
## The repair that converges on the wrong answer
The standard repair for a stacked Deployment is to delete the doubled pods one at a time. The skew filter only admits a node whose count equals the current global minimum, so each replacement is forced onto the emptiest legal node. Deterministic, not luck, and I had used it the day before on a differently-shaped version of the same problem.
With an entangled selector, that repair is a trap. Every deletion recomputes the same wrong minimum, over the same wrong population, and lands the replacement in the same wrong place. I watched the same pod come back to the same node twice before accepting that the repair itself assumed something the constraint had quietly broken: that the filter counts what you think it counts.
The way out is to make the wrong choice illegal for one scheduling cycle. Cordon the node it keeps picking, delete the pod, so the only legal placements left are the right ones, and uncordon afterwards. That is not a fix; it is an escape. The fix is the selector.
One more trap in the same family, because it bites during exactly this kind of investigation: a Helm apply returns before the rollout it triggered finishes, because `maxUnavailable: 1` makes two-of-three count as available. The apply said done while a pod was still Pending. Check rollouts yourself; do not inherit the apply's optimism.
## The fix, verified by the case that failed
Both lines went in: the per-instance label in `matchLabels`, the `pod-template-hash` in `matchLabelKeys`. I did not repair the stacked Deployment by hand afterwards, and that was deliberate.
The rolling update that applied the fix re-ran the exact case that had failed. Same constraint semantics, same namespace, same starting skew, the one situation that had produced two pods on a node. The Deployment came back one pod per zone, unaided. When the fix's deployment is the failure's reproduction, you get verification and regression test in the same event.
The same rollout incidentally took the same-zone share of the estate's connections to 99 percent, because every replaced pod resolved into its own zone. That is the stake: with a zonal load balancer, cross-zone off, `externalTrafficPolicy: Local`, a zone with no pod is a load balancer node with no healthy target, and zone-affine routing pays nothing for the clients in that zone. A scheduling bug that looks cosmetic is a routing bug is a cost bug. An ordinary deploy fixed all three at once.
## Where this generalises
A selector is a population declaration, not a name. Whenever you write one, the question is not "does it match my workload" but "what is the full set of things it matches", and the two answers diverge in ways that never show up in the object you are editing.
The mild version of the lie is the sidecar: a chart's single-replica metrics pod usually carries the same `name` label as the thing you meant, so the count includes it, and a lopsided spread satisfies `maxSkew: 1` while leaving a zone genuinely empty. If the pods you want carry no distinguishing label of their own, the exclusion has to be expressed, not implied:
```yaml
labelSelector:
matchLabels:
app.kubernetes.io/name:
matchExpressions:
- key: app.kubernetes.io/component
operator: DoesNotExist
```
The severe version is sibling Deployments pooled by a kind label, and no amount of strictness fixes it, because the strictness applies to a count over the wrong set.
The diagnostic habit that catches both: before trusting a spread constraint, enumerate what the scheduler actually counts, and enumerate it from live pods, `kubectl get pods --show-labels`, not from the spec you wrote. The spec tells you what you meant. The pods tell you what you got, and those are the only two facts in the system, and they only agree when the selector is right.
A satisfied constraint proves a count. Only intent decides whether the count was over the thing you meant.
---
# 136 Million PUTs for 17 GiB of Data
> Object storage bills per operation, and a ClickHouse part on an S3 disk is not one object but one per column. So the cost of a cold tier is a function of how many parts exist, not how many bytes they hold, and every setting that starves merges becomes a line on the bill. Two chart defaults did exactly that, and the fix that stopped it had never been committed.
- URL: https://ashkmb.com/blog/clickhouse-s3-tier-billed-by-parts/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-16
- Language: en
The S3 line in one of our AWS accounts had been under a euro a month all year. Then it was $733 in nine days. This is the account we run our observability stack in, and the ClickHouse cluster sitting on top of that bucket referenced 17 GiB of data on it.
| Line | Cost | Quantity |
|---|---|---|
| PUT, COPY, POST, LIST requests | $662 | 136 million |
| Storage | $58 | 2.6 TB-months |
| GET requests | $15 | 38 million |
Storage was eight percent of the bill. This was not a storage problem, and the estimate that said the tier would cost $66 a month had priced the wrong unit.
## What a part costs on S3
A ClickHouse MergeTree table stores its data as parts, and a part is a directory. Inside it there is one data file and one mark file per column, plus a handful of metadata files. On a local disk that is a directory listing and nobody thinks about it. On an S3 disk every one of those files is an object, and every time ClickHouse writes a part, each file is a PUT.
Our traces table has 79 columns. One part is about 160 objects. Write a day's worth of spans as a few hundred whole parts and the request count is a rounding error. Write the same bytes as 90 million fragments and it is the whole bill. The data is identical either way; the number of times you asked S3 to accept it is not.
This is the thing the pricing page does not help with. It quotes cents per GB-month, and a tier holding 2.6 TB at that rate is $66. What it charges you for is operations, and the operation count is a property of how the engine writes, not how much it writes. We had two settings making it write badly, and neither was visible in the values file.
## Defect one: the batch that never filled
The OpenTelemetry collectors that feed ClickHouse use a batch processor, and the chart sets it to flush at 50,000 rows or after one second, whichever comes first. At our volume the row ceiling never came first. The timeout did, every second, on every collector, so each collector issued one INSERT per second and each INSERT became a part.
Measured on one shard: 854,554 parts created in a day, at an average of 9 KiB each. Raising the timeout to 30 seconds took the average part to 14.5 MiB. Same data, about 1,600 times fewer objects. A side effect worth naming: the small parts had also been tripping the parts-per-partition insert limit, so ingest had been rejecting batches on and off for the same reason the bill was high. It was an availability defect that happened to also be a cost defect.
Two things made this hard to see. The first is that a chart default is indistinguishable from "unset" in a values diff. Nobody had written `timeout: 1s` anywhere, so no diff ever showed it, and it survived every chart bump. The second is worse. Our own config notes recorded the one-second setting as a deliberate choice, matched to a lower environment, and dismissed the tighter value on the production instance as legacy cruft. A wrong decision that has been written down is harder to see than one that has not, because the note answers the question before anyone asks it.
## Defect two: the flag that also switched off retention
The chart sets `prefer_not_to_merge = 1` on the S3 volume of the storage policy. The intent is reasonable. Merging cold data means reading and rewriting it, and on S3 every rewrite is more requests, so the default says leave cold parts alone.
On the ClickHouse version range we run, that flag does a second thing. Deletion by TTL is implemented as a merge, and the merge selector filters out parts on volumes marked with the flag, so DELETE TTL never runs there. Parts moved to S3, were never compacted, and were never expired. Retention was unreachable by construction.
The object count told the story once we looked at it: 6 million, 13 million, 44 million, 90 million, and it never once went down. The query that settled it was a one-liner against `system.parts`, grouped by disk name: ClickHouse referenced 17 GiB on the S3 disk. The bucket held 48 TB. Three orders of magnitude of objects that the database had already forgotten about and that nothing was going to delete.
One more thing the same query surfaced. The traces table had 185 MiB of stale remnant on the cold tier, while logs and metrics had tiered correctly. So one signal had lost its cold data entirely and the tier as a whole looked healthy. A cold tier can be silently broken for one table and fine for the rest.
## 690x
There was a discussion in the middle of this about whether S3 is actually cheaper than EBS for cold data, and the number that ended it came from Cost Explorer. On the worst day the bucket grew by 33 TB. Real ingest that day was under 50 GiB. That is roughly 690 times write amplification, and it is not a pricing problem. S3 is cheaper than EBS per byte, by a lot. It is a merge-loop problem, and no per-byte price survives being multiplied by 690.
The general version is this. Merges are what turn many small parts into few large ones. So every cause of starved merges converts directly into request spend the moment tiering is on: a hot disk with no headroom left to merge into, a merge-suppressing flag on the cold volume, a batch rate that outruns consolidation. We normally file those as ingest-health concerns. Under a tiered storage policy they are cost concerns with the same root cause.
The corollary is one I would have argued against a month earlier. Do not trim hot-disk headroom to buy a longer retention window. Reclaiming gp3 at a few cents per GB-month while risking request charges two orders of magnitude higher is a trade you lose every time.
## The fix, and the one nobody committed
Two settings closed it. The batch timeout, from one second to thirty. And the merge flag, from one to zero on the S3 volume, so DELETE TTL runs at all. The cost of allowing merges on cold data turned out to be about $3 a month, which is not the argument. The argument is asymmetry: with merges suppressed, one producer drifting past the hot window costs hundreds of thousands of PUTs a day, permanently; with merges allowed, those parts compact within hours.
The third piece is the one now carrying the whole defence: a hot window long enough that parts finish merging on local disk before they move. Fully merged, a day partition on one shard settles to a couple of parts, so the cluster moves about 15 parts a day, around 2,500 PUTs. Unmerged, the same day's churn across the cluster was 75,000 parts, which at 160 objects each is 12 million PUTs from one table. The difference between those two numbers is entirely whether merging finished before the move.
Then the part I want to be honest about. The 30-second batch timeout that produced the 1,600x reduction had been applied by hand to the live Helm release during the incident and never committed. It sat there with four other hand-applied values. When we ran the infrastructure diff before touching the tier again, the tool reported the release changing from "failed" to "deployed" and nothing else, with a line saying dozens of attributes were unchanged. It compares against its own state, not the cluster. A routine apply would have reverted the fix without a word of warning and re-run the incident on top of whatever else that apply was for.
A fix applied live under pressure is not done until the source reproduces it. The check is mechanical: render the values from source, pull the values the cluster actually holds, and diff them structurally. If those two disagree, the thing that saved you exists only in memory.
## Where this generalises, and the trap
Every tiered store built on object storage has this shape. Loki chunks, Thanos and Cortex blocks, Iceberg and Delta small files before compaction, Druid segments in deep storage. Object storage prices operations, so the cost is a function of how many things you write and rewrite. Engines built on immutable parts exist to rewrite things; that is what a merge is. Put the two together and any setting that changes how often the engine writes is a cost setting, whether or not it is labeled as one.
Before enabling a cold tier, measure parts per day on the hot tier. Multiply by files per part. Price the requests. Then, once it is running, check that the tier actually deletes, because a retention setting that cannot execute is indistinguishable from one that is working until the bucket is 60 TB.
The trap is estimating a cold tier by GB-months. That number is always small, it is always the one on the pricing page, and it is the one thing this bill was not about.
---
# The Error Was 25 Hours Old. The Client Was Healthy the Whole Time.
> A Kafka client wrapper that recovers by counting errors and panicking past a threshold is recovery proportional to traffic: stream processors trip it in seconds, quiet request-driven producers never do, and so they latch the last error and serve it indefinitely while every health signal stays green. The tell is in the error's own digits: an elapsed-time value that is byte-identical across occurrences is one cached event, not a recurring failure.
- URL: https://ashkmb.com/blog/kafka-recovery-needs-traffic/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-09-08
- Language: en
A production producer rejected every request for most of a day. Every health signal stayed green the entire time: restart count 0, TCP sessions to the Kafka brokers ESTABLISHED, liveness and readiness probes passing. The error it returned was byte-identical to one its underlying client had emitted 25 hours earlier, elapsed-time value included. The client had recovered within minutes of the incident. The wrapper never noticed.
## The pattern that works
Like a lot of platforms, we run Kafka clients behind a shared wrapper library, and the wrapper's answer to broker loss is deliberately crude: count errors, and once a threshold is crossed, panic. The orchestrator restarts the process, and the service comes back cold and clean.
It is easy to sneer at crash-to-recover until you have debugged a client in a half-broken state, wedged in some corner of its reconnect state machine that no test covers and no runbook names. The panic converts an unbounded space of those states into exactly one state: a fresh process. And it composes with machinery the platform already has. The wrapper does not reimplement recovery; it delegates to the restart, which is the one recovery path everyone has already invested in.
During the incident at the center of this post, the platform rolled its brokers, and the busy services using this wrapper behaved exactly as designed. A stream processor touches Kafka constantly, so a broker roll generates failures several times per second; the threshold crosses within seconds, the process panics, the orchestrator replaces it, and the service is clean within a minute. Over a dozen services on the same library version did precisely that, at the exact second their broker shut down. Crash-to-recover earned its keep that night.
## Why idle breaks it
The threshold counts errors, and errors only happen when the service does work. That is the whole flaw.
A stream processor produces errors fast enough to trip any threshold you care to set. A request-driven producer, a service that only touches Kafka when something calls it, and which something calls roughly once a day, produces about one error per day. The counter never crosses anything. And the wrapper's behavior for a threshold that never trips is not "keep trying". It is to latch the last error and return it for every subsequent attempt, indefinitely. We watched one do it for 22 hours, and it only ended because a human restarted the pod.
Recovery proportional to traffic is not recovery. The services that need it least get it; the ones that need it most never do. The quiet service is exactly the service whose failure goes unnoticed, and the mechanism built to save it is rate-limited by the one thing it lacks: traffic.
## Wrong twice
The route to the right answer ran through two wrong ones, both worth keeping.
The first was correlation wearing the costume of cause. The broker logs showed one user failing authentication, thousands of times a day, flat, for weeks. The audit trail pinned it: an automated cleanup job had deleted that user's credential. Exactly one credential had been deleted, and exactly one user was failing. I restored the credential, watched the failures stop, and reported the outage root-caused.
It was not the outage. The failing service authenticated as an entirely different user, which one read of its deployment config would have shown before anyone touched anything. The restore was harmless, and it did fix a genuinely broken client, but it was a different client. "Only one thing failed and only one thing changed" is a property of your search, not of the system. Uniqueness is a prompt to verify, not proof.
One detail actively misled that first pass: the service whose logs everyone was reading was not the service producing to Kafka. It had received the producer's error in the body of an HTTP 500 response and logged it as its own, so a Java stack trace was carrying a C library's error string. The reporter and the actor were different services, and the log everyone was grepping answered a different question than the one being asked.
The second wrong answer was the version. The healthy service ran a newer client library than the stuck one, so a version bump looked like the fix, and a ticket got cut. Then came a fleet inventory: grep the embedded Go build info out of `/proc/1/exe` on every pod, and you know exactly which library version each service runs. Dozens of services on the wrapper, most on the same version as the stuck one, and over a dozen of those same-version services had panicked and self-healed during the roll. The version splits nothing.
Neither direction of the usual argument survives that. "Another service on this version was fine" exonerates nothing, and "the healthy one runs a newer version" convicts nothing. Split the fleet by traffic profile before reaching for a version diff. Getting this wrong sends someone off to do an upgrade that cannot fix the problem, and a colleague pushing back, with a crash window from the client's own logs that my story could not accommodate, is what surfaced it.
## The evidence in the digits
The decisive evidence was sitting in the error string the whole time.
The stuck producer's error was byte-identical to one the underlying client had emitted during the broker roll, and I mean identical down to the elapsed-time value, the "after N milliseconds" fragment. The underlying client had logged nothing since, because it had reconnected normally within minutes. The wrapper had cached the error object and re-served it for a day.
Identical elapsed-time digits cannot be two independent events. An elapsed time is a measurement, and two measurements do not agree to the digit. Once that lands, the question stops being "why does it keep failing" and becomes "why is the error never cleared", and that question has an answer. When an error message carries a duration or a counter, diff those digits across occurrences. Same digits means one cached error being re-served. It costs nothing, and it flips the investigation.
## What a latched process looks like
Nothing on the standard dashboard distinguishes stuck from idle.
Restart count is 0, because the process never needed saving by its own logic. Sockets to the brokers are ESTABLISHED, because the transport genuinely recovered; socket state is evidence from a layer below the claim, and I had called the thing recovered on that evidence once already, which was premature. Liveness and readiness pass, because neither probe exercises a produce. The logs show nothing, because a quiet service logs nothing whether it is broken or merely quiet. And app-level retries get the same cached error a few seconds later, which is why "add retries" is the wrong reflex. You cannot retry your way out of a cache.
## What closes it
Three fixes, in descending order of value.
Clear the error state on success. A successful produce, or a successful reconnect, should retire the cached error. The failure to do this is the entire bug; everything else is mitigation.
Make the health probe exercise the produce path. A producer's readiness claim is "I can produce", so that is what the probe should test. A producer that reports healthy while rejecting every produce is lying on the one axis anyone is polling.
Make the threshold time-based as well as count-based. A quiet service then eventually recovers the same way a busy one does, by the clock instead of by the counter.
And accept the recurring trigger, because it will not go away. A managed Kafka platform rolls its brokers on a maintenance schedule, monthly in our case, and every roll re-runs this experiment against every client. After any provider-side roll, the request-driven producers are the ones to check, and the only reliable check is pushing a request through them or restarting them. There is a small set of silent low-traffic producers that cannot be distinguished from stuck without pushing a request through; they go on the list for the next roll.
## Where this generalises, and the trap
Every recovery mechanism with a rate-based trigger has this failure mode. Circuit breakers need failures to trip. Watchdogs count events. Connection pools validate on checkout, so a pool nobody checks out never validates anything. Health checks that only exercise the happy path pass forever next to a broken one. Low traffic turns each of these into a no-op, and it does so silently: nothing is disabled, nothing is misconfigured, the mechanism is simply waiting for evidence that is not coming.
Two rules leave this page. When a recovery mechanism is rate-based, ask what happens when traffic does not meet the rate. And when an error carries a counter, the counter is evidence.
The trap is to treat recovery as a property of the failure. It is a property of the traffic. A client that only recovers while failing recovers exactly when it fails often enough, and the service too quiet to fail often enough never gets the chance. It will sit there, healthy on every dashboard, serving yesterday's error.
---
# LakeBase Didn't Reinvent Postgres. It Moved the fsync.
> Databricks LakeBase Postgres is real, wire-compatible Postgres: standard drivers, pgvector, PostGIS, unmodified query engine. The marketing headline is database branching, Git for your database. That is the side effect. The mechanism is that the commit path moved off the machine: a transaction acks when a quorum of safekeepers accepts the WAL record, not when a local SSD flushes. Branching, scale-to-zero, and point-in-time recovery all fall out of that one sentence, and so do the costs.
- URL: https://ashkmb.com/blog/databricks-lakebase-postgres/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-30
- Language: en
Databricks shipped [LakeBase Postgres](https://www.databricks.com/blog/databricks-lakebase-generally-available): real Postgres, wire compatible, standard drivers, ORMs, psql, pgvector and PostGIS included. Generally available on AWS since January 22, 2026, Azure GA in March, adoption reportedly growing at twice the rate of their warehousing product. It is not a reimplementation; the query engine is unmodified Postgres. The thing that changed is the thing underneath the commit. A transaction no longer becomes durable when a local SSD flushes. It becomes durable when a quorum of storage nodes agrees it happened. The marketing headline is database branching, "Git for your database." The headline is the side effect.
## What LakeBase is
The product facts, kept short. Databricks acquired [Neon](https://neon.com/docs/introduction/architecture-overview) in May 2025; LakeBase is the productized result. Serverless Postgres with scale-to-zero, Postgres 18 with pgvector today, an SLA since July 2026, SOC 2 Type 2, PCI-DSS and HITRUST landed this month, storage quota default of 32 TB, [Lakehouse Sync](https://docs.databricks.com/aws/en/release-notes/lakebase/) pushing operational data into Delta tables without pipelines. PostGIS, extensions, the tooling you already use. None of that is the interesting part.
## The mechanism
[The architecture](https://docs.databricks.com/aws/en/oltp/projects/architecture) splits Postgres into two layers connected by a WAL stream.
Compute is stateless Postgres. It parses, plans, executes, and holds only transient state: shared buffers in RAM plus a local NVMe cache. It owns no durable data. That is why it can restart, autoscale, or scale to zero without a recovery story; there is nothing on it to recover.
The WAL is pulled out of the machine into a group of safekeepers. A transaction commits when a quorum acknowledges the log record via Paxos consensus, not when a local fsync returns. This is the sentence everything else falls out of: *the commit is a distributed-systems event*.
Pageservers hold the data files, rebuilt from the WAL. They materialize page versions on demand at any requested LSN, acting as a write-through cache above object storage. Object storage (S3 on AWS) holds the immutable page history and sits off the hot read path; only pageservers read from it. The read path is buffer pool, local NVMe, pageserver, object storage, stopping at the first cache hit.
You traded the fsync latency of a local SSD for the consensus latency of a replicated log. Databricks argues this is a wash for anyone already running synchronous replication: one network round trip replacing another rather than adding one. Fair, but note what changed. The durability of your commit now depends on the health of a distributed quorum, and during a partition the system must choose between blocking writes and risking a durability gap. A monolith never had to make that choice.
## Why branching and scale-to-zero are consequences, not features
Here is the part worth internalising. Four bullet points on the LakeBase landing page are one architectural choice wearing four hats.
A [branch](https://www.databricks.com/blog/database-branching-postgres-git-style-workflows-databricks-lakebase) is a metadata operation pointing at an LSN. No data is copied. A 10 GB database and a 2 TB database branch in the same number of seconds, and you pay only for the pages the branch modifies; touch 1 GB in a 100 GB database and the branch costs about 1 GB extra.
Scale-to-zero is the same sentence read from the other side. Compute owns nothing durable, so it can evaporate. Point-in-time recovery is compute attaching to a past LSN, not restoring data. A read replica is a second compute attaching to existing storage, no data movement. Four features, one cause.
## The tradeoff ledger
Externalized durability is a trade, and the ledger has two columns.
| Property | Monolithic Postgres | LakeBase |
|---|---|---|
| Commit ack | local fsync | quorum consensus over the network |
| Cold page read | base image on disk | replay WAL deltas forward to the LSN |
| Database branch | pg_dump, minutes to hours | metadata operation, seconds |
| Idle compute | billed around the clock | $0 |
| Superuser, tablespaces, logical replication | available | not available |
The cold-page row deserves respect. Resolving a page's current version can mean replaying a long chain of WAL deltas over a base image, and if compaction and image generation are mistuned, you get tail latency that does not show up in a demo and does show up at 2 a.m. Databricks's own engineering confirms this was real: they [disabled Full Page Writes and pushed image generation into the pageserver](https://www.databricks.com/blog/how-lakebase-architecture-delivers-5x-faster-postgres-writes), reporting 94% WAL traffic reduction and up to 5× write throughput. You do not spend that engineering effort on a problem that does not exist.
The rest of the ledger, from third-party analyses. Branching has no merge semantics: a branch is a snapshot at an LSN and never resyncs with its parent, so the Git mental model breaks exactly where Git is most useful, at merge time. Long-lived branches pin page history and quietly inflate storage; immutable storage is cheap to write and expensive to forget. Connections are ephemeral in ways that surprise session state: a 24-hour idle timeout, a 3-day maximum lifetime, a roughly 500 ms cold resume, and advisory locks, temp tables, and prepared statements dying with the connection. High-availability configurations cannot scale to zero, so production compute bills around the clock. And governance is aligned, not merged: Unity Catalog governs the lakehouse query surfaces while Postgres roles govern direct connections, two authorization paths to keep consistent.
None of these are fatal. All of them are the price.
## Where this generalises
The transferable test: when a database vendor lists features, group them by the architectural choice that implies them, then price the choice, not the list.
LakeBase's list, branching, scale-to-zero, PITR, instant replicas, sync tables into Delta, one storage foundation serving OLTP and analytics, all falls out of "durability lives in a distributed log over object storage." The costs, consensus in the commit path, cold-page tail management, GC discipline, session ephemerality, fall out of the same sentence. You cannot take the features and decline the costs; they are the same decision.
This applies to every externalized-durability system you will evaluate from here on: Aurora's separated storage layer, Neon itself, every disaggregated OLTP engine on the roadmap. Each one puts the same trade on the table in a different wrapper, and the evaluation is always the same two questions. Which features are consequences of the storage decision? What does the storage decision cost at 2 a.m. rather than in the demo?
## The trap
The trap is to read the feature list as the product. Branching is not the product. A quorum-committed WAL in object storage is the product, and branching is one of the things that architecture can do that a monolith cannot.
The second trap is the demo-versus-production gap. The vendor-reported pgbench numbers, around 1,731 TPS for LakeBase against roughly 1,508 for Aurora PostgreSQL on the same 4M-row workload, are steady-state numbers. Steady state is where disaggregated architectures look best; the tails are where the ledger lives. Cold-page replay latency, quorum behavior under partition, GC pressure from a forgotten branch: none of it appears in a 90-second demo, all of it appears in a page.
The closing rule. When durability becomes a distributed-systems event, every consequence of that decision, on both sides of the ledger, looks like a feature until you know which sentence it fell out of. LakeBase's sentence is "the commit lives in a quorum over object storage." Read the sentence, and the bullets stop being marketing and become arithmetic.
---
# Opinionated Linux Stops Being a Contradiction When the Opinions Are Coherent.
> Omarchy launched this summer and 37signals is moving the whole company to it on a three-year horizon. The interesting part is not the Linux part; it is that the distribution is the first one I have seen where the personality is the lead feature. The portable rule: the same opinionated default is a feature when its reasoning is visible and a bug when its reasoning is hidden.
- URL: https://ashkmb.com/blog/opinionated-linux-omarchy/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-23
- Language: en
Omarchy launched this summer and 37signals is moving the whole company to it on a three-year horizon. The obvious read is that DHH has gone full Linux partisan, and the company is following. The real read is more interesting. Omarchy ships with visible opinions in a market that has historically won on hidden ones, and the visible/opinionated pair is what this post is about.
## The contradiction
Linux is supposed to be a neutral toolkit. The Linux distributions that have won on share have done so by *not* taking positions. Ubuntu's "just works," Fedora's "always current," Silverblue's "immutable by default" each betray a personality, but a quiet one. Each one is willing to ship a default that disagrees with the user's preference on the theory that the user does not have time to learn the alternative. Omarchy is the first distribution I have seen where the personality is the lead feature: aesthetic-first, opinionated, and opinionated out loud. The marketing page leads with the word "opinionated." The README leads with the word "opinionated." DHH's blog posts about it lead with the word "opinionated." The word is doing real work.
The contradiction is the part that makes the launch interesting. Linux distributions are *supposed* to be the flexible layer; they are the substrate. The substrate taking positions feels wrong, in the same way a package manager taking positions would feel wrong. The instinct is that the lower you go in the stack, the more neutral you should be. Omarchy breaks that instinct, and the post is about why breaking it works.
## What Omarchy actually does
Arch Linux plus Hyprland plus a curated toolchain. That is the stack. The interesting piece is Hyprland, a tiling window manager that ships with no login screen, no menu bar, no notifications, no file manager. None of those things. DHH's reframing is the part that does the work. The gap is not a defect; it is the precondition for genuine personalization, because there is nothing preconfigured to fight. The cost is roughly ten hours of setup up front. The reward is that every behaviour the user touches later is one they chose, and there is no default to undo.
This is the line that converted me, by the way. "There is nothing preconfigured to fight." That sentence captures the whole argument. A preconfigured default is not just a default; it is a direction the user has to consciously contradict to do the thing they actually want. Hyprland has no directions. It has only the user's choices. The trade is ten hours for ownership, and ownership is the thing the user values because they will spend years inside the system.
## Why the visible-opinion framing matters
A hidden opinion looks like an accident to anyone who did not author it. Hyprland ships with nothing, and you can see that the moment you boot it. There is no clever chrome to decode, no menu bar to discover, no notification daemon to learn. The opinion is on the screen the moment the screen turns on. That visibility is what converts the opinion into a contract. The user signs up for the ten hours. The user gets the flexibility after. Both halves are visible.
Compare that to Ubuntu. Ubuntu's "just works" looks the same from the outside as Fedora's "always current," but they arrive at the same place by different reasoning. Ubuntu ships GNOME with a handful of opinionated extensions (the dock, the snap store, the systemd network defaults) and never tells the user those are choices. Fedora ships GNOME clean and lets the user discover the same choices by hitting a wall. Silverblue ships immutable and lets the user discover the immutability by hitting a different wall. Each of these distributions has opinions. Each of those opinions is hidden behind a default that reads as a fact. The user has to take the opinion on faith.
Visible opinions survive contact with non-believers because the non-believer can see what they signed up for. A user who boots Hyprland and does not want to spend ten hours setting it up has an immediate exit ramp; the install is reversible in minutes and the user knew it would be. A user who boots Ubuntu and does not want snap cannot tell whether snap is an opinion or a bug until they have spent twenty hours fighting it. Hidden opinions are indistinguishable from accidents. Visible opinions are contracts.
## Where this generalises
The same rule applies to any product whose defaults carry its personality. An opinionated CI pipeline beats a flexible one when the opinions are visible in the templates. An opinionated homebrew formula beats a neutral one when the opinions are documented in the formula file. An opinionated deployment tool beats a neutral one when the opinions are visible in the deploy logs. The visible/hidden distinction is what survives. The *kind* of opinion is irrelevant; the visibility is the whole game.
The reader should leave with one transferable test. When you see a default, can you tell why it is the default? If yes, the product is opinionated in the visible sense, and the opinion is a contract. If no, the product is opinionated in the hidden sense, and the hidden sense is the one that breaks under load. Every product is opinionated somewhere; the question is whether the user can audit the opinions without leaving the product.
## The trap
The trap is to read Omarchy as a *Linux* story. It is not. It is a *product* story, and the Linux angle is the dating layer. The same argument could be made about Rails in 2004 (a web framework that took positions on conventions and made the positions visible in the directory layout), about Postgres extensions in 2025 (a database ecosystem where the extension authors document their assumptions next to the install), about the iPhone's refusal of a stylus in 2007 (a hardware opinion that was visible the moment the device shipped, no drivers, no settings), about the Framework laptop's modularity today (a hardware opinion that is visible the first time the user opens the bottom panel). Each of these is a product that took positions. Each of those positions is on the surface. None of them is hiding.
The Linux ecosystem has been quietly losing the argument about whether to ship visible opinions for fifteen years. The argument was that users want neutrality, that the platform should not editorialize, that the substrate should be invisible. The argument was wrong, but it has been a respectable wrong for a long time, because the alternatives were mostly also hidden. Omarchy is interesting because it makes the alternatives visible. It does not argue that the substrate should editorialize. It *editorializes*, and lets the user see the editorializing. That is a different argument, and a stronger one.
## The rule and the test
The same opinionated default is a feature when its reasoning is visible and a bug when its reasoning is hidden. The next time you reach for a tool whose defaults carry a personality, ask one question: is the personality visible? If yes, the tool is durable. If no, the tool will eventually break, because the next user is going to fight the hidden opinion and lose. Hidden opinions are accidents waiting for a non-believer. Visible opinions are contracts waiting for a sign-up.
Omarchy is interesting because it makes that question easy to answer, in a market where the answer has historically been "no, you just trust us." Whether Omarchy itself wins the long share war is a different question, and one I will not pretend to know. The argument is not that Omarchy is right for you. The argument is that visible opinions are durable in a way hidden opinions are not, and the Linux ecosystem has spent a decade and a half shipping hidden ones. The argument is that the substrate is allowed to take positions. The argument is that the positions are stronger when the user can see them.
---
# Speculative Decoding Shipped Because It Doesn't Change the Output.
> Liquid AI shipped LFM2.5-DSpark on August 20: three draft models under the lfm1.0 license, with a 2.67× mean speedup on H100 and a 57% function-calling latency reduction on Apple Silicon. The headline number is the least interesting thing about the release. The interesting thing is why this kind of release can ship at all. Speculative decoding is exact under greedy decoding, which means it does not change the output. That property is the whole game.
- URL: https://ashkmb.com/blog/lfm25-dspark/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-20
- Language: en
Liquid AI shipped [LFM2.5-DSpark](https://huggingface.co/LiquidAI) on August 20, 2026: three draft models targeting LFM2.5 1.2B-Instruct, LFM2.5 2.6B, and LFM2.5 8B-A1B (an MoE), under the lfm1.0 license. The headline numbers are 2.67× mean speedup on H100 and 2.27× mean on M4 Max, against the 2.6B target, with a 3.06× peak on MATH500. The headline is the *least* interesting thing about the release. The interesting thing is why this kind of release can ship at all, in production, on day one, without an eval-suite expansion or a rollback story.
## What speculative decoding is
The pattern is straightforward. A small draft model proposes a short sequence of tokens; the target model verifies them in parallel, accepts what matches, rejects the rest, and continues from the first rejected position. Three numbers characterise a cycle: draft length (how many tokens the drafter proposes per step), acceptance rate (how many the verifier accepts), and effective tokens-per-step (the realised throughput gain).
The crucial property is exactness under greedy decoding. When the verifier uses argmax and accepts a draft token, that token is byte-identical to what the target model would have produced alone. The output stream is byte-identical to non-speculative greedy decoding. The whole family of EAGLE, Medusa, DFlash, DSpark trades on this property. Without it, speculative decoding would be a quantisation problem with worse tooling, not a free lunch.
## What DSpark actually does
The interesting design choice is what is *not* there. The paper ([arXiv:2607.05147](https://arxiv.org/abs/2607.05147), Cheng et al., DeepSeek-AI + PKU) describes a confidence-scheduled Markov-head draft, layered on the DFlash / EAGLE-3 lineage. A confidence scheduler was built to dynamically trim low-confidence drafts at inference time. It was left dormant. Dynamic trimming hurt more than helped. DSpark ships the simpler, static version because the simpler version wins on real benchmarks.
This is a posture statement. The speculative-decoding family has been chasing dynamic adaptation for three generations. [EAGLE-2](https://arxiv.org/abs/2406.16858) introduced the tree-of-tokens idea, where the drafter proposes multiple candidates at branching positions and the verifier picks the longest accepted prefix. [EAGLE-3](https://openreview.net/forum?id=4exx1hUffq) refined the head; [DFlash](https://arxiv.org/abs/2602.06036) (arXiv:2602.06036) generalised the Markov head to a confidence-scheduled mechanism. DSpark ships static. The dynamic machinery is built and dormant. The static version won. Posture matters when the family has been climbing for three generations and the release ships the floor.
## The numbers
The table is the spine.
| Draft target | Acceptance length | H100 mean | M4 Max mean | MATH500 peak |
|--------------------------|-------------------|-----------|-------------|--------------|
| LFM2.5-1.2B-Instruct | — | — | — | — |
| LFM2.5-2.6B | 4.81 | 2.67× | 2.27× | 3.06× |
| LFM2.5-8B-A1B (MoE) | — | — | 1.18× | — |
Two extras worth naming. BFCL function-calling latency: 57% reduction on M4 Max against the 2.6B target (BFCL is in [PMLR v267](https://proceedings.mlr.press/v267/)). Confidence-scheduled verification: built but not used; the released checkpoint uses static drafting.
The honest weakness is the 8B-A1B on M4 Max row: 1.18×. MoE routing plus draft-model memory bandwidth saturates the unified-memory bus before the draft path helps. The release shipped the 8B-A1B draft anyway, which is the right call: an honest number on a real workload is more useful than a cherry-picked one. The 8B-A1B draft is not unusable; it is just not the headline.
## Why exactness under greedy is the whole game
The portable rule. Any inference optimisation that does not change outputs is a free lunch: A/B parity, no eval-suite re-runs, no golden regression traces, no rollback plan. Optimisations that *do* change outputs (post-training quantisation, distillation, pruning, kernel fusion with numerical drift) need eval suites, golden traces, and a rollback story. Speculative decoding under greedy needs none of that.
The cost calculus is asymmetric. Exactness ships. Non-exactness budgets. That is why every production serving stack I have shipped or audited has speculative decoding on the hot path, and almost none of them have post-training quantisation on the hot path without an eval gate. The decision was not made on speedup numbers; it was made on whether the change needed a quality gate. Speculative decoding does not. The 2.67× is the bonus.
This is the inverse of [the byte-identical config that still crash-looped](https://ashkmb.com/blog/byte-identical-still-broken/). There, a re-derived config matched the running one byte for byte and still failed on startup, because byte-identity proved fidelity to the source, not validity for the target. Here, byte-identity is the load-bearing property, and it is exact under the specific decoder configuration the family targets (greedy). Both posts are about the difference between a property the system *claims* to have and the property the system *has*. DSpark lives on the side where the claim matches the property. That is the reason it can ship under lfm1.0 with SGLang integration in flight ([PR #31041](https://github.com/sgl-project/sglang/pull/31041)) and Metal kernels in llama.cpp.
## Where this generalises
The reader should leave with one transferable test. When you evaluate an inference optimisation, ask one question: does it change outputs under greedy decoding?
If no, ship it without an eval suite. If yes, budget for one.
The question applies to every serving decision for the next two years: KV-cache compression, paged attention, continuous batching, prefix caching, quantisation kernels, draft models, MoE expert pruning. Each one either changes outputs or does not, and that single property determines whether the rollout needs a quality gate. Speedup is irrelevant until the question is answered. Most of the time, the answer is "no" (the optimisation is exact under greedy), and the answer is the green light. Some of the time, the answer is "yes," and the question is whether the speedup is worth the eval-suite tax. Both questions live downstream of the first one.
## The trap
The trap is to read the speedup numbers as the result. They are the side effect. The result is that Liquid AI shipped three draft models under a permissive license, targeting three different target sizes, on day one, with SGLang integration in flight and Metal kernels in llama.cpp. The result is that the bottleneck for serving LFM2.5 on Apple Silicon is no longer compute; it is memory bandwidth on the draft path. The result is that a confidence scheduler was built, evaluated, and left dormant because the static version was the right call.
Visible properties (exactness under greedy) shipped. Hidden properties (dynamic adaptation) were shelved. The whole release is a single argument: the technique is shippable because the property it claims is the property it has, and the property it claims is exactness under a specific decoder. Speculative decoding has always claimed that property. DSpark is the release where the claim matches the benchmark, the benchmark matches the workload, and the workload matches the production stack. The 2.67× is the headline. The byte-identity is the result.
---
# The New Pipeline Seemed to Lose Spans. The Old One Had ~47k Duplicates.
> During a parallel-run validation, a side-by-side per-service span count showed the new pipeline losing ~0.2% of spans per service across a 60-minute window. Read as regression in the new pipeline, it would have triggered a rollback. Read correctly, it was the old pipeline ingesting tens of thousands of duplicate rows in a few-second window. The storage layer has no unique constraint on the thing being counted; the unit it exposes as 'count' is not the unit the operator thinks it is.
- URL: https://ashkmb.com/blog/signoz-span-count-discrepancy/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-20
- Language: en
A side-by-side per-service span count during a parallel-run validation showed the new pipeline losing roughly 0.2% of spans per service across a 60-minute window. Read as a regression in the new pipeline, it would have triggered a rollback. Read correctly, it was the old pipeline ingesting tens of thousands of duplicate rows in a few-second window, with the new pipeline matching it span-for-span once the duplicates were excluded. The lesson is not that the new pipeline was fine. It is that the unit a storage layer exposes as "count" is not the unit the operator thinks it is, when the storage has no unique constraint on the thing being counted.
## The first exhibit: the alarming per-service delta
The Traces Explorer's `count()` panel reports row count. Per service, the new pipeline was short by roughly 0.2% across the window. The shape of the shortfall was uniform across services, which is the part that read as a real signal. A uniform per-service shortfall is the signature of a systemic issue rather than a single misbehaving component, and the natural reflex was "the new pipeline is dropping spans." That reflex is what the post is about, because the reflex was wrong in direction. The new pipeline was not dropping. The old pipeline was duplicating, and a duplication in the old pipeline reads, from the new pipeline's vantage point, exactly like a loss.
The instinct to read a uniform shortfall as a regression is not stupid; it is the right reflex in most failure modes. The reflex is what you should have when one of two pipelines is wrong. The problem with the reflex is that it assumes one of the two pipelines is the source of the discrepancy and treats the other as ground truth. The parallel-run setup made the old pipeline the reference by virtue of being there first, and a uniform shortfall against a reference looks like the test pipeline being off, not the reference being off. That asymmetry is what gets read as a regression.
## The second exhibit: the drill-down that inverted the picture
Per-hour counts were computed and compared side by side, against both pipelines' databases directly. Twenty straight hours matched span-for-span. One hour did not.
For the narrow slice the drill-down isolated inside that hour, the old pipeline's `count()` read roughly 620k while its `uniqExact(spanID)` read roughly 580k. The new pipeline's two counts both read roughly 580k. The shortfall was not in the new pipeline. The shortfall was the old pipeline having tens of thousands of duplicate rows inside the hour, and the duplication was concentrated in a few seconds inside that slice. Spread across the whole hour and every service, those same duplicates were what surfaced as the roughly 0.2% per-service gap; inside the slice, they were the difference between 620k and 580k. Per service, the new pipeline's `count()` equalled the old pipeline's `uniqExact(spanID)` exactly, which is the relationship that inverts the diagnosis. The new pipeline was not smaller than the old pipeline. The old pipeline was larger by exactly the count of rows it had inserted twice.
The drill-down mattered because the hour-level discrepancy was the level at which the wrong reflex would have stuck. The window-level drill-down is what showed the duplication; the per-service match is what showed the direction. Both pieces were needed; either one alone would have left the diagnosis ambiguous. The shape of the disagreement (old `count()` over-reports; old `uniqExact` agrees with new) is the fingerprint of a duplicate-insert path, not the fingerprint of a dropped-span path.
## The third exhibit: the log sweep that found the smoking gun
The old collector's logs were swept for errors inside the window. A `MEMORY_LIMIT_EXCEEDED` on the error-table insert surfaced, occurring after the index-table insert for the same batch had already landed. The exporter retried the whole batch. The non-transactional multi-table write plus the retry is the duplication mechanism: the index table commits, the error table fails on its memory ceiling, the retry re-commits the index table a second time. The column-oriented store has no unique constraint on `spanID` and no dedup-on-insert, so the second commit lands as two identical rows. The old database's own error counters show well over a hundred previous `MEMORY_LIMIT_EXCEEDED` occurrences, which means the duplication is recurring, not anomalous.
The memory ceiling itself is the trigger, and it is workload-dependent. The error-table insert fails when the error batch is large enough to exceed the memory budget, which is more likely under traffic spikes, which is more likely to be the same window where someone is paying attention to per-service span counts. The duplication is not noise; it is correlated with the work pattern that surfaces the discrepancy, which is what makes the symptom so convincing as a regression in the new pipeline.
## Why a count disagreed with a uniqueness-aware count
The Traces Explorer's `count()` panel reports row count. The store's `spanID` column is not a primary key; nothing rejects a duplicate insert. The two numbers, `count()` and `uniqExact(spanID)`, agree when the pipeline is healthy and diverge when it is not. The divergence is the *direction* of the bug: `count()` over-reports because it counts duplicates. The new pipeline's two counts agreed exactly because nothing on the new side failed mid-batch in that window, so nothing was retried. The disagreement between the two pipelines was not a regression in the new pipeline. It was the old pipeline's duplication-driven over-counting being misread as the new pipeline's under-counting.
This is the part of the post that generalises. A row count and a unique-keyed count are two different measurements of the same storage, and they are only equivalent when the storage rejects duplicates. The instant the storage accepts duplicates, the two measurements diverge, and the divergence is the signal. The direction of the divergence tells you which side is duplicating, not which side is dropping. A short panel against a reference can be caused by the short side dropping, the reference duplicating, or both; the disagreement between `count()` and `uniqExact` on the reference side is the diagnostic that tells you which.
## The recurring-fault trap
The hundred-plus previous `MEMORY_LIMIT_EXCEEDED` occurrences are what turn a one-off debugging session into a transferable rule. A single batch that retries after a mid-batch failure is a transient; the same batch path failing every time a workload peaks is a *property* of the old pipeline. The parallel-run will keep showing the "new pipeline losing spans" pattern every time the old pipeline's error path triggers, and the divergence will accumulate over the validation window.
The reflex to fix is "compare with `uniqExact`." That is the symptom treatment. The rule is broader: pick the comparison metric that does not depend on the old pipeline's retry behaviour. A unique-keyed count is one such metric; a per-row-counts-of-error-events metric would also tell you the duplication happened; a per-row-counts-of-distinct-trace-ids metric would tell you the duplication did not affect the trace graph. Any metric whose definition is invariant under duplicate insertion is robust to this class of bug. The row count is not, and using it as the parallel-run comparison metric guarantees that any window overlapping a duplication event will read as a regression in the test pipeline.
## The rule and the trap
When a count and a uniqueness-aware count disagree, the storage layer is telling you which one to use, and the disagreement is the signal. A non-transactional multi-table write plus a retry is a duplication path whether or not it fires; it fires when one of the tables hits its ceiling mid-batch, and once it has fired, the duplication lands permanently in the storage because nothing rejects it on insert.
The next time a side-by-side panel shows one pipeline short by a small, uniform percentage, the question is not "which pipeline is dropping." The question is "which pipeline is double-counting," and the answer is the one whose row count exceeds its unique-keyed count for the same window. The two pipelines are not symmetric in a parallel-run: the reference side, the one that was there first, has had more time to accumulate whatever failures its insert path is susceptible to. The short side's deficit, in the common case, is the reference side's surplus expressed from the wrong direction.
---
# The Note Said the Image Was Wrong. The Image Was Right. Three Checks Agreed.
> A note in the project's knowledge bundle said the image was amd64-only and might not run on Graviton. Three independent checks agreed. The image was not amd64-only, and a native arm64 build succeeded with zero source changes. A claim that has been verified three times is the most dangerous kind of wrong claim.
- URL: https://ashkmb.com/blog/canvas-image-runtime-contract/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-17
- Language: en
A note in the project's knowledge bundle said the production image was amd64-only and might not run on Graviton nodes. Three independent checks agreed. The image was not amd64-only. A native arm64 build succeeded with zero source changes, faster than the wrong-architecture path it supposedly couldn't take. The post is not a meditation on a wrong claim. It is an exploration of how a claim that has been verified three times is the most dangerous kind of wrong claim, because verification has become evidence-by-volume.
## The first exhibit: the original note
The note was written with the confidence of an observation. It recorded what the upstream image *publishes*. That distribution shape is genuinely amd64-only; the chart's image stream only advertises x86_64. The note then generalised from that observation to what the project's `Dockerfile.production` *builds*. Two different properties, recorded as one. The error was not in what the note observed. It was in what the note generalised from the observation.
What the note did not record is the distinction, because the distinction was not the thing being checked. The reader who quotes it later, six sessions from now, inherits the observation and the generalisation as a single confident sentence. Knowledge bundles do not preserve uncertainty. They preserve conclusions.
## The second exhibit: the local boot that hid the gap
Before the chart was written, the image was booted locally. That was the highest-leverage step in the whole exercise, and the local boot succeeded. The boot command used `-p 8080:80`, which mapped the wrong port on the host. The application inside the container listens on port 80. The nginx ERB reads `CG_HTTPS_PORT` and `CG_HTTP_PORT`; the chart was about to inject `APP_PORT` and `REDIRECT_PORT`. Those four numbers were different. The container, port-mapped to 8080 on the host, sat there perfectly healthy on port 80 internally, and every probe that touched the running container looked healthy.
The local boot was not the problem. The local boot was the right thing to do. The flag that made it look healthy was the problem, because the flag converted a real difference into a hidden one. A verification that produces the right answer for the wrong question is the most expensive kind of green because it does not look like failure. It looks like work getting done.
## The third exhibit: the claim meets its opposite
A native arm64 build was attempted on the same machine, in one pass, with zero source changes. The same Dockerfile. The same base image. The same `docker build` invocation. It succeeded. The previous claim, the one that had been verified three times, met an experiment that falsified it directly, and the falsification took a few seconds.
The interesting moment was not the build succeeding. It was the brief instant *before* it succeeded where every prior verification was about to be revealed as evidence for the wrong hypothesis. The cost of that brief instant is the post, because the cost of the brief instant was paid in advance by every future reader who trusted the note.
## Why three checks did not catch it
The three checks answered three different questions. The first confirmed the upstream distribution shape. The second confirmed the local boot, on a port-mapped container that was healthy on the wrong port. The third confirmed that the chart rendered. Each answer was correct. Each answer was for a different question, and none of them was the cross-architecture question.
The shape of the failure is that the chain of green checks was *not* a chain of evidence for the same hypothesis. It was a chain of independent verifications, each answering its own question, none of which happened to be the question the original claim was about. The volume of green was the surface. The alignment of questions was the substance, and the questions were not aligned.
This is the part of the post that generalises. A claim that has been verified three times feels stronger than a claim that has been verified once, but the number three is not a multiplier on truth. Three answers to three different questions are not stronger than one answer to the right question. They are weaker, because each additional green check on a side question makes the original wrong claim feel more like a settled fact and harder to challenge.
## The portable-frame trap
The note's original claim was portable. It travelled between sessions, between reviewers, between the chart author and the boot author. The local terminal output was not portable. It lived in one shell window, scrolled out of view, and was never quoted again.
Portable artifacts accumulate evidence by being repeatedly cited. Local observations accumulate evidence by being repeated, and repetition requires a reader. The note survived because it could be quoted; the boot output did not survive because it had to be observed. The asymmetry is structural, not intentional, and knowledge bundles inherit the asymmetry without choosing it.
The dated-callout discipline matters here. The wrong version of the note is what a future session trusts. Quiet edits remove the wrong version but leave no record that the wrong version was ever the right one to question. A dated callout in the note, naming the question the original check answered and the question the next check is going to ask, is what closes the trap. It does not stop portable claims from drifting. It stops the next reader from inheriting the drift without seeing it.
## The rule and the trap
A claim that has been verified three times is the most dangerous kind of wrong claim, because verification has become evidence-by-volume. Count of checks is not evidence of correctness; the question each check answered is.
The next time a knowledge-bundle note carries forward a claim that the next exercise is going to falsify, the question is not "is this claim true." The question is "what question did the original check answer, and is that the question this check is going to ask." The two rarely coincide without saying so.
---
# I Inferred Three Things About a Live System. Two of Them Weren't True.
> Three times in one week I made a claim about a live migration by reading a config file, a name prefix, or a template, and twice the claim was wrong. The artefact and the live system are two views of the same thing, and they can agree for reasons the artefact can't tell you. Only one of the views is the truth.
- URL: https://ashkmb.com/blog/live-system-inferred-vs-verified/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-14
- Language: en
Three times in one week, working on the same migration, I made a claim about a live system by reading a file. Two of the three claims were wrong. The third started from a true fact and drew the wrong conclusion from it, and a one-line check caught it at low cost. The unifying mechanism is that the artefact and the live system are two views of the same thing, and they can agree for reasons the artefact can't tell you. Only the live view is ground truth.
## The seventh consumer
A canary migration had three signals green. The new collector had logged its first traffic. The span processors were writing to the new broker. The six services that turn those metrics into database rows were getting fed. The fix was shipped. Only afterwards did a broader sweep find a *seventh* service, a billing consumer, that had been disconnected the same way the whole week, on the same mechanism, and missed by the service-name scan that drove the cleanup.
The two truths held at once. Every signal in the room was genuine, and the system under change had a hole the cleanup had papered over. That gap is the post.
## Why the scan missed it
The fix was scoped by a consumer-name prefix. Six services matched. The seventh didn't carry that prefix, so the sweep didn't see it. The mechanism is worth naming out loud: **the topics are the contract**, **the names are a convention**, and a convention can be wrong. Matching consumer subscriptions by service-name prefix treats the namespace as the contract. The namespace lied.
The cost hides in plain sight, because the match succeeds on the cases it sees, and the case it doesn't see is exactly the one that won't show up in the report. A green sweep is not the same as a complete sweep. It is the proof that the cases your naming convention covers were covered. It is silent about the cases the convention skipped, which is a smaller set that has no obligation to be empty.
## A retraction that wasn't a swap
Same week, different artefact, same failure mode. The collector's Kafka consumer groups had been read off *configuration templates* to conclude they carried no stage prefix and would therefore be denied once broker-side [ACLs](https://en.wikipedia.org/wiki/Access-control_list) were enforced. Enumerated on the live cluster, every one carried a prefix and was covered.
The general principle still held. One billing-side consumer is genuinely unprefixed and genuinely would have broken once the rules tightened. The error wasn't speculative; it was sourced from a *specific* claim about *these N groups* that the live data did not back. Templates look like truth because they're the artefact the platform hands you, but they're somebody's rendering of intent, not a contract with the broker. The reason the retraction caught itself was that the broader picture had already broken somewhere else in the same migration, and reading the live cluster was already the reflex.
The interesting shape of the mistake is that it would have been cheap to make and easy to ship: a confident paragraph in a runbook, a checkmark on a review, a fixed-naming-convention change applied to a fleet. The cost of being wrong was zero until the moment a different consumer query landed on the unprefixed group and the rule that hadn't actually been enforced closed it silent. The cost of being right was a paragraph no one would have read twice.
## The cheap third
I argued against inlining a Kafka SASL username in a values file because [SSM](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) stores secrets encrypted. It was a sensible-looking objection, and I retracted it after a one-line check: the codebase already carried exactly such a literal in another values file. The convention existed; a policy had been inferred from a default. This one was cheap to catch and almost cheaper to miss, because it was the third time in three days pattern-matching had been the move, and the *third* miss of a week is the one a tired operator stops flagging to themselves, because the brain is already triaging them.
The shape of every one of these is the same: a confident claim about the live system, sourced from the artefact, that the artefact cannot actually answer. The same shape wears three different clothes over a week.
## Why "I reasoned from the file" doesn't feel like a finished sentence
The artefact and the live system are two views of the same thing, and two views can agree for very different reasons. They can agree because they are derived from each other, which is the canonical case and the only one where "I read the file" is a complete answer. They can agree because one of them was edited and the other wasn't, which is the three-way-merge shape and which a `terraform plan` flattens into a single diff that looks like normal drift. Or they can agree because one of them was edited in a way the other couldn't see, which is the byte-identical cousin of this post: a config faithful to a source that has since been read by a different binary.
Reading the artefact gives you *what it was supposed to be*. Only the live system gives you *what it is*. Both feel like ground truth. One of them is right far less often than either feels.
## What the checks actually look like
The principle in the last section has to land in something you can type. Three small reads, one per layer of the Kafka system, none of which depend on a template, a prefix, or a config file. Each is paired below with what it is buying you, which matters more than the flag set.
**Enumerate consumer groups against the cluster.** The shape that finds the seventh consumer:
```bash
kafka-consumer-groups.sh \
--bootstrap-server "$BROKER" \
--describe --all-groups
```
The `--all-groups` flag is the part that catches the missed consumer, because it does not pattern-match on a name prefix; it lists every group the cluster knows about, including any whose names do not fit the convention. Because no `--group` filter narrows it, the output also shows every topic and partition each group actually reads, rather than the ones your consumer config happens to declare.
This is the read that replaces the service-name prefix sweep. Both passes look like inventory. Only one of them takes the cluster as ground truth.
**Pull the topic list as the contract.** When the artefact said the consumers were misaligned, the first thing to check is what topics actually exist on the cluster and what their partition counts are:
```bash
kafka-topics.sh \
--bootstrap-server "$BROKER" \
--list --exclude-internal
```
Followed by `--describe` for the topic or topics of interest when the count matters:
```bash
kafka-topics.sh \
--bootstrap-server "$BROKER" \
--describe --topic "spans.${STAGE}"
```
These read the contract from the broker, where it lives. Config templates tell you what *should* exist, which is what gets you into the byte-identical cousin of this post; the topic-list commands tell you what does. The two will frequently diverge, and when they do, the broker is right.
**Read the ACLs from the live cluster.** When the second miss said "the consumer groups will be denied once ACLs tighten," the read that would have settled it in one command:
```bash
kafka-acls.sh \
--bootstrap-server "$BROKER" \
--list --topic "spans.${STAGE}"
```
This is the read the template-based inference was trying to substitute for, and it does not need a stage prefix or a config block to answer the question. Whatever the cluster says this principal is allowed to do, that is what the rule actually does. Pair it with `--resource-pattern-type prefixed` if your environment uses prefix-style ACLs rather than literal resource names, since `--list` defaults to literal patterns and silently hides the prefixed grants.
Three reads. None of them asks for permission beyond what an operator with read-only cluster access already has. None of them takes more than a few seconds. None of them is hard to remember. The hard part is remembering to reach for them before reaching for the file.
## The rule and the check
Infer from the artefact, verify against the live system. Treat the first as a hypothesis, not as evidence.
The seventh consumer is what the rule buys you, and the check is the one above that caught it: enumerate consumer groups across the cluster, every group and every topic it reads, no permission ask, five seconds of wall-clock. The fragment reads almost like the prefix-sweep it replaces; it just does not take the convention's word for which subscriptions exist. The prefix was a guess about a contract; the topic was the contract.
The check is what survives into the next week. The example is what makes it memorable. Naming both together is the part that earns the next three "wait, is this one of those" moments when the artefact and the live system first stop agreeing, before the brain has had time to fall back on the reflex.
---
# A Plan Is Green When Two of Three Views Agree. The Third One Is the Truth.
> A terraform plan for a managed observability stack showed an incident fix as a pending change, though the fix had been live since the incident and only state was behind. In the days before the file caught up, the same plan would have been green, and the next apply would have reverted the fix. A plan is a diff between two views, but the system has three. Reading all three before you plan is what turns the diff from a guess into a decision.
- URL: https://ashkmb.com/blog/three-way-merge-plan-truth/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-14
- Language: en
A `terraform plan` for a managed observability stack came back with one change: an incident fix, shown as if it were about to be introduced. The on-call had applied that fix by hand during an incident two weeks earlier. The fix was live. The fix was in the file. State alone was behind, so the apply was a harmless catch-up. The dangerous moment had already passed. In the days between the hand fix and the file update, state and file agreed with each other and not with live, and a plan in that window would have said "no changes," indistinguishable from "no drift." The next apply in that window would have reverted every incident-mitigating line in a single shot. This is a story about a green plan that would have hidden a real problem, and a non-empty plan that changed nothing running.
## A plan is a diff. The system has three views
A typical plan is a diff between two things: state and file. "State" is the last successful apply; "file" is what you would write if you were starting now. The plan renders *unchanged* whenever state and file agree, which is the green every operator learns to want.
The system has three sources of truth, and only two of them are in the diff. **Live** is the running thing, the cluster or the workload or the storage bucket. **State** is what Terraform or Helm recorded last. **File** is what the repo currently says. Each is authored separately. Each can drift. A plan ignores the first one.
The three sources line up in four shapes, and the plan compares only two of them. All three agree because all three came from the same file: the canonical case, which a green plan correctly reports. State is behind while file and live have already caught up: the plan shows a change that is already true at the API, and the apply is a catch-up that changes nothing running. File is behind while live and state agree (the "I applied it from my branch and never merged it" case): the plan shows a change toward the file, which on apply is a revert. Live is the odd one out while state and file agree (a hand fix not yet in the repo, or the "the platform reverted my change because it crashed" case): the plan renders green, identical to no drift, and that is the case that hides the most dangerous drift.
Two views agreeing with each other while disagreeing with the third is the case a plan cannot classify for you. When the two that agree are state and file, it renders green and papers over live entirely. A plan is a diff over a comparison between two things, and the third thing does not get a vote.
## The first exhibit: the managed observability stack
It was the middle of an incident. The on-call ran hand `helm upgrade`s against the live release; the values landed in-cluster, but the file in the repo was not updated. The incident closed, the team caught up later that week and updated the file to match, and on the surface everything reconciled. Then the planning phase of the next change came around, and `terraform plan` was not empty. It showed the incident fix itself, the old values on the `-` side and the fix on the `+` side, as if the fix were about to be introduced.
Read against the three views, that diff was nothing to fear. The `-` side was state, written by the last apply before the incident. The `+` side was the file, which now carried the fix. Live is not part of that diff, and live already held the fix, because the hand upgrade had put it there. Live and file agreed; state alone was behind. The apply would write into the cluster what was already running and bring state up to date. None of that was the plan's job to know. The plan's job is to compute the diff between state and file, and it did: this file wants to apply this fix. Only the third read says the fix is already there.
The danger was earlier, in a window that had already closed. Between the hand upgrade and the file update, state and file agreed with each other: both held the pre-incident values. Live alone held the fix. A plan in that window renders "no changes," which is exactly what no drift looks like. And the next change applied in that window, any change, re-renders the release from the file, so its plan shows only the new edit while its apply rolls back every line of the incident fix in one shot.
That window is the bug. It is easy to miss because the plan in it is the dream: green, or showing just the change you meant to make. The postmortem would have read "apply reverted the production fix during the next change," and would have been right, and would have been the most expensive possible framing of a misunderstanding the plan itself could not have caught.
## The second exhibit: the managed Kubernetes cluster, a day later
Same mechanism, different surface. The repo directory for a managed Kubernetes cluster carried one real edit: a node group resize, `general_arm` from 6 to 4, a real drain of two nodes, deliberately requested. That was the change everyone was talking about. It was not the only thing in the plan.
Three other node groups on the same cluster were *state-behind*. A code sync had landed a week earlier and no apply had run since. Live already matched the file; only state still carried the old numbers. So the plan showed three more `update in place` changes to the groups' scaling config, each one already true at the API. Applied, they would change nothing on the cluster and bring state up to date.
The risk was not a revert; it was in the reading. The `general_arm` drain drew all the attention, which is exactly the point. Operators tend to read the diff the change is about, check that one for safety, and wave the rest through. Here the rest happened to be harmless, but nothing in the plan said so; that came from reading live. And the apply writes four node groups, not the one the change description names. Read the other way round, three reconciles that look just like the drain invite you to file the whole plan under catch-up, and the one line that removes two nodes hides among them. Had one of the three quiet groups not matched live, the postmortem would have read "the apply dragged along unintended changes," and would have blamed the loud diff instead of the three quiet ones.
Both exhibits walk the same mechanism. At the moment each plan ran, live and file agreed and state was behind, and the plan rendered that lag as a change that was already true at the API. That shape is safe to apply, and from the plan alone it is indistinguishable from a real change, which is how a real drain can hide among catch-ups. The dangerous shape is its mirror, the one the first exhibit had passed through days before: state and file agreeing while live has moved, which renders green and lets the next apply revert live. The plan never tells you which shape you are in; only the third read does.
## Why a plan can't see it
`terraform plan` consults state and file. It does not consult live at apply time. `helm template` does not consult live at plan time. Neither tool was designed to verify the live system; both were designed to verify *what would change given the last known state*. The three-way merge the platform does not do is the one you have to do yourself, before the plan, not as part of it.
The shape of the limitation is consistent across tools. Whatever is recorded somewhere outside the platform's model is the thing the plan cannot see. For Terraform, that is the live API. For Helm, that is the live release that `helm template` does not query. For `kubectl diff` against a server-side apply, that is whichever admission controller last modified what, which the local dry-run never sees. The plan tool and the platform are paying attention to two different sources; the third source is whichever one the user forgets to mention.
A plan that comes back clean is not a statement that live matches file. It is a statement that state matches file, which is information the operator needs to convert into a different question, the question of what live is doing that neither knows about.
## The way to actually read it
Three cheap reads against the three sources, in order: state from the backend, file from disk, live from the API. Lay them out side by side. The case where any two agree and one differs is the case a plan cannot classify for you: if state is the odd one out, the plan shows a change that is already live; if live is, the plan renders green. The case where all three agree is the case a green plan correctly reports. Distinguishing them costs a state pull and a read, no apply, no review latency.
For Terraform:
```bash
# Read 1: state
terraform state pull
# Read 2: file
terraform plan -no-color
# Read 3: live
# Whatever the platform surfaces (e.g., aws eks describe-cluster ...)
```
The point is not the commands. The point is the three reads together answer "which view is behind," which is the question a single green plan cannot.
For Helm:
```bash
# Read 1: state
helm get values -n
# Read 2: file
helm template -f values.yaml
# Read 3: live (after dry-run)
helm diff upgrade -f values.yaml
```
Each pair of reads can be cross-checked by eye. Whenever the three reads do not all match, pause: the one that disagrees with the other two is the view that is behind, and if all three differ, someone made a change nobody wrote down. The reads take longer to set up the first time than to run; after the first time they are a script, and the script is a check that runs before every plan, and the check is what turns the green diff from a guess into a decision.
The most valuable moment to run this is the moment you are about to call a plan "nothing to do" after recent hand-fixes to the same system. That is the only moment a green diff is more likely to be wrong than right, and it is the only moment where reading the third view is cheap. Cost is fixed; timing is everything.
## The rule and the twin
Read all three sources before you plan; the plan is a diff over the gap, not a statement of truth.
The first exhibit's contribution is that the dangerous plan was the green one, in the window before the file caught up: "nothing to do" would have been the wrong read, and the cost of being wrong was reverting the fix that kept the stack standing. The second exhibit's contribution is that one real diff among three already-true ones gets either all the attention or none, and operators tend to read the diff the change is about. They are the same shape because the mechanism is the same; what differs is the surface, and which pair agreed at the moment you looked.
The next time a plan comes back unremarkable after a hand-fix or an out-of-band edit on the same system, the question is not "is this right." The question is *which of the three views is the one that's behind*. The answer is whatever the third source says, and reading it takes less time than writing this post did.
---
# The Config Was Byte-Identical. That Proved the Wrong Thing.
> We re-derived a collector config, confirmed it was byte-for-byte identical to the one running in production, and shipped it with a stack of green checks behind it. It crash-looped on startup. Byte-identical is a real property; it just answers a question nobody was asking.
- URL: https://ashkmb.com/blog/byte-identical-still-broken/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-13
- Language: en
We were codifying an OpenTelemetry Collector that had been installed by hand and never captured in any repo. The safe way to do that is not to invent a new config, it's to reproduce the one that is already running. So we re-derived it, and then we checked our work the strictest way we knew: we compared the result byte-for-byte against the live production config. It matched, exactly. YAML parsed. `terraform validate` was clean, lint was clean, and several independent reviews came back with nothing.
Then it started up and crash-looped.
Everything that was supposed to catch a bad config had run and passed, and the config was bad anyway. The gap between those two facts is the whole point of this post, and it is not specific to collectors or Kafka. It is about what "byte-identical" actually proves, which turns out to be a different thing from what everyone in the room assumed it proved.
## What "byte-identical" verified
The comparison was real, and it was useful. It proved that the transformation from the running config to the codified one was faithful. Nothing was dropped, nothing was reworded, no key drifted in translation. If your worry is "did we accurately reproduce the source," a byte-for-byte diff is a complete and honest answer.
But that is a statement about the *copy*. It relates the new config to the old one and says they are the same. It says nothing at all about a second, entirely separate property: whether that config is *valid for the thing it now has to run against*. Those are two different questions. Fidelity of the copy, and validity for the target. They happen to produce the same shade of green, so it is easy to check the first and believe you have answered the second.
Here they had diverged, badly.
## The gap the copy could not see
The config had been written for one version of the collector. The image the unit pinned was roughly two dozen minor releases newer. A config-driven binary and its config are a contract, and that contract had moved underneath a config that stayed frozen. Three things had broken across those releases:
- A telemetry field the config still referenced had been removed. To the newer binary it is simply an unknown key, and an unknown key at startup is fatal, not ignored.
- The Kafka receiver's `topic` had gone from a single string to a list, while the Kafka *exporter* kept the singular form. That asymmetry is the nastiest kind: a naive find-and-replace across the file "fixes" both receiver call sites and breaks all eight exporter ones, or the reverse, and looks tidy either way.
- A producer message-size setting now exceeded a newer broker-side write ceiling, so even a clean start would have failed the first time it tried to send.
None of this was drift in our copy. Every one of these was faithfully, correctly reproduced from a source that was itself no longer valid for the target. The diff was doing exactly its job and telling us nothing we needed to hear.
## Why every green check was green
This is the part worth internalizing, because the checks were not negligent. They were answering their own questions correctly.
`terraform validate` checks that your configuration and plan are well-formed. It does not instantiate the component the config describes, it does not download the pinned image, and it has no idea what fields that image's binary will accept. YAML validation checks structure: is this a map, is that a list, are the quotes balanced. It cannot know that `topic` needs to be a list in this version when it was a string in the last one, because "which version" is not in the YAML. The reviews checked that the codified config matched production, which it did, flawlessly.
And the deepest reason sits one layer down. This config is read by the collector *binary, at startup*, not by an admission webhook and not by any control-plane check. So a config that is invalid for that binary still applies cleanly. The resource is created, the object is accepted, everything reports success, and then the process reads its own config a second later and dies. The failure lives past every gate that had a chance to stop it, because none of those gates ever start the actual pinned component.
Byte-identical, valid YAML, clean plan, approved review. Four true statements, none of which is "this will start."
## The only check that means anything
The fix was not a better linter. It was to run the real thing: obtain the actual pinned binary, the correct distribution (a different build of the same collector ships a different set of components, so the wrong one gives you a confident false pass), point it at the real config with the real environment, and let it start. That is the first check in the whole chain that instantiates the components the config names and enforces the contract the pinned version actually defines. It catches the removed field, the receiver-list change, and the config-language errors that `validate` structurally cannot, because `validate` never builds a component.
So "start the pinned binary with this config" became a required pre-apply step, and it applies to more than first-time codification. Any time you bump the image, you have moved the contract and frozen the config. Any time you copy a spec file from one place to another, you have carried a config across a version boundary you may not have noticed. Both are the same setup as the original bug.
There is a smaller version of this that shows up as a warning rather than a crash. When the newer binary logs that some field or component name is deprecated in favour of its current form, that is not noise to scroll past. It is the identical failure, one release early, announcing itself while it is still free to fix. Rename it while the thing is idle and a restart costs nothing; leave it, and the release that finally removes the alias turns a config nobody edited into a config that no longer starts.
## What to actually take from this
Pin a version and copy a config, and you have quietly created two things that must agree and were verified separately: a copy that is faithful to its source, and a source that may no longer be valid for its target. A byte-for-byte diff, a passing `validate`, a green lint, and a clean review can all confirm the first while every one of them stays blind to the second.
Verify against the thing you pinned, not the thing you copied from. The most convincing green light in the pipeline was an honest answer to a question nobody in the room was actually asking.
---
# Two DNS Layers That Look Identical When They're Both Green
> A VPC in one account couldn't resolve names in a private zone owned by another. Peering was healthy, routes were right, the DNS-resolution flag was checked. Every signal was green, and the answer was still NXDOMAIN, because two different DNS layers were wearing the same green light.
- URL: https://ashkmb.com/blog/route53-private-zone-membership-vs-peering/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-08
- Language: en
Pods in one account's VPC kept getting NXDOMAIN for names in a private hosted zone owned by another account. The failure had a very specific shape: it only happened from that one foreign VPC. Query the same names from the zone's home VPC and they resolved instantly. So this was not a broken zone, not a bad record, not a propagation delay. It was scoped to exactly one VPC, which is the kind of detail that should have told me what was wrong and instead told me nothing, because I was reading it through the wrong layer.
The peering connection between the two VPCs was healthy. Routes were in place on both sides. Security groups allowed the traffic. And the peering connection's `allow_remote_vpc_dns_resolution` option was checked, which is the setting whose name most sounds like "let this VPC resolve DNS across the peering." Every signal I knew to look at was green. The names still would not resolve.
## The two layers
The reason none of those green signals helped is that DNS across a peered, cross-account setup runs on two independent mechanisms, and they look the same from the outside.
The first is the peering connection's DNS resolution. That `allow_remote_vpc_dns_resolution` flag does one narrow thing: it lets instances on one side of the peering resolve the *provider-assigned* private DNS names of instances on the other side, the `ip-10-x-x-x.region.compute.internal` hostnames AWS hands out automatically. That is the entire scope of the flag. It is about the default internal DNS that every VPC gets for free.
The second is private hosted zone membership. A private hosted zone answers queries **only from the VPCs that are associated with it**. Association is a distinct, explicit act: you attach a specific VPC to a specific zone, and only then does that zone appear in that VPC's resolver. A zone that is not associated with your VPC does not exist as far as your VPC's resolver is concerned, and the honest, correct answer to a query for one of its names is NXDOMAIN.
These two layers have nothing to do with each other. Peering DNS resolution is about the automatic `compute.internal` names; zone membership is about your custom zone. Checking the peering box changes the first and does absolutely nothing to the second. My foreign VPC could resolve the other side's `compute.internal` hostnames perfectly, which is exactly what the flag promises, and that success told me nothing about whether my custom zone would answer, because that was never the flag's job.
## Why it fools you
Every diagnostic reflex I had pointed at the peering layer. Is the peering active? Are the routes there? Do the security groups allow it? Is DNS resolution enabled on the connection? Those are the questions you ask about cross-VPC connectivity, and every single answer came back correct, because the peering layer genuinely was correct. The problem was that a correct peering layer is not evidence about zone membership. I kept collecting green checks from one mechanism and treating them as reassurance about a different one.
Nothing in that whole surface says "this VPC is not a member of the zone." There is no red light for it. The peering console is happy, the route tables are happy, the security groups are happy, and the missing association lives in a completely different resource that you only find if you already suspect it. The failure sits in the gap between two layers that both report green, and the shape of the bug is that the green from the layer you can see convinces you the layer you can't see is fine too.
## The fix, and why it is two steps
The fix is to make the foreign VPC an actual member of the zone. Because the zone and the VPC live in different accounts, that association is a two-step handshake, one call in each account:
```bash
# In the zone-owner account: authorize the foreign VPC.
aws route53 create-vpc-association-authorization \
--hosted-zone-id "$ZONE_ID" \
--vpc VPCRegion="$REGION",VPCId="$FOREIGN_VPC_ID" \
--profile zone-owner
# In the VPC-owner account: accept by associating.
aws route53 associate-vpc-with-hosted-zone \
--hosted-zone-id "$ZONE_ID" \
--vpc VPCRegion="$REGION",VPCId="$FOREIGN_VPC_ID" \
--profile vpc-owner
```
The split is not ceremony. The authorization is the zone owner's decision to make, so it runs under the zone owner's credentials; the association attaches the zone to a VPC that belongs to the other account, so it runs under that account's credentials. Each half runs where its resource lives. Run them in that order, and the foreign VPC's resolver starts answering for the zone immediately. The authorization record persists after the association completes, so both halves are durable and, later, both are importable into whatever manages your infrastructure as code.
## The audit trap
Once you know association is the thing that matters, there is a second surprise waiting: there is no single command that tells you whether a VPC can resolve a zone. There are two, and they answer different questions.
```bash
# What is actually associated (the resolver truth):
aws route53 get-hosted-zone --id "$ZONE_ID"
# What has merely been authorized (a standing invitation):
aws route53 list-vpc-association-authorizations --hosted-zone-id "$ZONE_ID"
```
`get-hosted-zone` lists the VPCs actually associated, which is the set that can resolve. `list-vpc-association-authorizations` lists the VPCs that have been authorized, which is only permission to associate, not the association itself. They routinely disagree. An audit of one zone turned up a VPC that had been authorized but never associated: from the infrastructure-as-code side it looked done, the authorization resource existed, and resolution from that VPC was still broken. The reverse also happens: the same zone carried an association to a VPC that no longer existed in any account, a leftover from a torn-down environment, harmless but easy to mistake for a live peer. Authorized is not associated, and associated is not necessarily still real.
## The lesson worth keeping
The durable lesson is not about Route53. It is that when two layers present the same green light, a healthy signal from one is not evidence about the other, no matter how confidently its name implies otherwise. `allow_remote_vpc_dns_resolution` sounds like it governs all DNS across the peering. It governs one narrow slice, and the slice I actually needed was in a different resource entirely.
So when a signal is green and the thing still does not work, the useful question is not "why is this green thing lying to me." The green thing is usually telling the truth about its own layer. The question is which layer the failure actually lives in, and whether the reassuring green you are staring at has any authority there at all. Most of the time it does not, and the real answer is one resource over, in a place you never looked because nothing pointed you there.
---
# The Bug I Blamed on the Provider
> For weeks a terraform plan showed drift I couldn't fix on an S3 bucket that was already configured correctly. I filed it under 'AWS provider quirk' and worked around it. The provider was innocent. My own code was lying to me before Terraform ever saw it.
- URL: https://ashkmb.com/blog/cdktf-nested-dict-silently-dropped/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-08-04
- Language: en
For weeks, one stack had a `terraform plan` I had learned to ignore. Every run, on every environment, it wanted to strip the server-side-encryption rule off an S3 bucket and replace it with an empty one. The live bucket was encrypted correctly. Nothing was broken in AWS. The plan just would not converge, and no matter what values I declared, the next plan asked for the same change again.
I filed it mentally under "AWS provider quirk, not worth fixing" and moved on. That was the mistake. The provider was doing exactly what it was told. The lie was upstream of Terraform entirely, in my own code, and it had been sitting in plain sight in a file I had never bothered to open.
## The reflex, and why it's wrong
The stack is [CDKTF](https://developer.hashicorp.com/terraform/cdktf) in Python. You write resources as typed classes or plain dicts, `cdktf synth` renders them to a `cdk.tf.json` file, and Terraform plans against that. When a plan misbehaves, the reflex is to blame the layer you can't see into: the provider's diff logic, a known-flaky resource, a state quirk. S3 encryption resources have a reputation for drift noise, so this fit the story I wanted to believe.
The reflex is wrong because CDKTF has an artifact you can read. `cdk.tf.json` is the exact JSON Terraform plans against. It is not a black box; it is the compiled output, sitting on disk after every synth. I had spent weeks reasoning about the provider's behavior and zero seconds looking at what I was actually handing it.
When I finally opened the file, the rule was there. It was just empty:
```json
"rule": [
{}
]
```
Terraform was not drifting. It was faithfully trying to reconcile a bucket that had a real encryption rule against a declared config that said the rule should have no contents. An empty block is a positive instruction, not an absence. The provider was innocent.
## The root cause
Here is the code that produced that empty block. It looks completely ordinary:
```python
S3BucketServerSideEncryptionConfiguration(
self, "encryption",
bucket=bucket.id,
rule=[{
"apply_server_side_encryption_by_default": {
"sse_algorithm": "aws:kms",
"kms_master_key_id": key.arn,
},
"bucket_key_enabled": True,
}],
)
```
The `rule` argument takes a list. Each item is a nested dict: a block containing another block. That nesting is the whole problem.
CDKTF's Python bindings sit on top of [jsii](https://github.com/aws/jsii), which auto-converts Python dicts into the typed structs the underlying TypeScript expects. That conversion does not recurse into list items that are themselves nested dicts. When jsii walks a `Sequence[Union[SomeTypedClass, Dict]]` and finds a dict whose values are more dicts, it fails to map the inner structure and quietly emits an empty object. No exception. No warning. Synth exits zero.
What makes this genuinely nasty is that the same pattern works everywhere else. A list of dicts with flat scalar values converts fine:
```python
# This renders correctly. The list items are flat.
taint=[{
"key": "dedicated",
"value": "gpu",
"effect": "NO_SCHEDULE",
}]
```
So the failing case and the working case are visually identical: a list of dicts passed to a resource argument. The only difference is whether the dict's values are scalars or more dicts, and nothing in the code, the synth output, or your assertions distinguishes them. You cannot spot it by reading the Python. You can only spot it by reading the JSON.
## The trap inside the trap
The empty block is worse than a no-op. It is a positive declaration of "this rule has no configuration," which means the plan can never converge. Terraform sees a live rule, sees a declared-empty rule, and proposes the delta. You edit the Python to add more values, and jsii drops them the same way, so the JSON is still `[{}]` and the next plan is identical. The config edit that should fix it cannot fix it, because your values never survive synth to reach Terraform in the first place. That is why it read as unfixable drift. In a sense it was, as long as I kept trying to fix it in the wrong layer.
## The fix
Stop handing jsii a nested dict to guess at. Construct the typed class explicitly, and the conversion has nothing to infer:
```python
S3BucketServerSideEncryptionConfiguration(
self, "encryption",
bucket=bucket.id,
rule=[S3BucketServerSideEncryptionConfigurationRuleA(
apply_server_side_encryption_by_default=(
S3BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultA(
sse_algorithm="aws:kms",
kms_master_key_id=key.arn,
)
),
bucket_key_enabled=True,
)],
)
```
The class names are verbose and the trailing `A` is an artifact of how the bindings are generated, but the point is that jsii now receives a fully-typed object instead of a dict it has to introspect. The nested structure survives, the JSON renders every key, and the plan converges on the first try. The rule of thumb: any resource whose list items themselves contain a nested block wants the typed class, not a raw dict.
## The lesson worth keeping
I had actually seen this bug before and not connected it. On the Kubernetes provider, building resources from dicts had silently dropped `volumeMounts`, left a StatefulSet with a blank password env, and stripped readiness probes, all with no synth error. I had treated that as a Kubernetes-provider oddity. It is not. It is a property of the CDKTF Python bindings, and it will surface on any provider the moment your resource has a nested block inside a list.
The durable lesson is not about S3 or Kubernetes or any specific resource. It is this: **a successful synth means your code ran, not that it rendered what you meant.** The two are not the same, and the gap between them is exactly where this bug lives. Grep-based assertions pass, because the fields that get dropped are the deeply-nested ones nobody writes a grep for. Synth passing tells you nothing, because dropping the fields is what synth does.
So when a plan will not converge and the resource looks correct in the console, resist the urge to blame the provider. Open the compiled artifact. Read the `cdk.tf.json` Terraform is actually planning against, not the Python you wish it were. The tool is almost always doing exactly what you told it. The interesting question is what you actually told it, and that answer is written down, one synth away, in a file most people never open.
---
# The EKS 401 That Wasn't About Credentials
> Our CI pipeline was minting a valid EKS token, presenting it cleanly, and getting rejected. The problem was not AWS creds. It was EKS access control, and the failure was hiding in plain sight: the cluster had no access entry for the role that was asking.
- URL: https://ashkmb.com/blog/eks-401-not-credentials/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-30
- Language: en
The first prod rollout of our new deploy pipeline went green through every step except the last. Identity check, chart pull, `update-kubeconfig`; all of it succeeded. Then `helm upgrade` failed with a single line:
```
Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials
```
The first thing everyone reaches for is "rotate the AWS access key." That instinct is wrong. The error is not from AWS. The token was issued, signed, and presented to the kube-apiserver; the apiserver rejected it. The cluster had no access entry for the principal that was asking, so it could not map the token to any identity it knows.
This is what the failure actually looks like, end-to-end, on a healthy pipeline where nothing was rotated, nothing expired, and nothing was misconfigured at the credential layer.
## Why the instinct is wrong
The word "credentials" in that error is misleading. The message comes from `client-go`, the Kubernetes client library, not from AWS STS. AWS credential failures surface much earlier with a different message, typically something like `exec: ... could not get token`, and they fail at the `aws eks get-token` step, not at `helm upgrade`.
In our trace, everything upstream of the helm step worked:
- The runner's IRSA role assumed the cross-account deploy role via `AssumeRoleWithWebIdentity`.
- The deploy role pulled the chart from the operations ECR.
- `update-kubeconfig` wrote a valid kubeconfig pointed at the prod cluster.
- `aws eks get-token` returned a token.
The token was mintable. The token was presentable. The token was then *rejected* by the cluster. That is a 401, and a 401 is an authentication failure at the cluster, not at AWS: the token is valid, but the cluster cannot tie it to an identity it knows. An authorization failure, where RBAC says no, would be a 403.
## The three-layer mental model
"Credentials" in an EKS deploy pipeline can fail at three different layers, and only one of them produces the wording above. A quick way to split them:
| Layer | What it does | Failure message | First check |
|---|---|---|---|
| AWS STS | Issues the session for the runner or deploy role | `could not get token`, `ExpiredToken`, `AccessDenied` | `aws sts get-caller-identity --profile ` |
| EKS access control | Maps the IAM principal to a Kubernetes identity | `server has asked for the client to provide credentials` (with valid token) | `aws eks list-access-entries --cluster-name ` |
| Kubernetes RBAC | Allows the mapped identity to do something | `Forbidden`, `cannot ...` | `kubectl auth can-i --list` |
A 401 from the apiserver sits in the middle. A 403 sits at the bottom. A connection refused or a timeout is a network or kubeconfig problem, not in this table at all. Once you know which layer you're on, the rest of the diagnostic is mechanical.
## Two confirmations that take thirty seconds
Before chasing any fix, confirm the AWS side is healthy so you don't end up rotating a key that was never the problem:
```bash
# Side A: the AWS identity your deploy role assumes
aws sts get-caller-identity --profile
# Side B: the cluster itself can issue a token for that identity
aws eks get-token --cluster-name --region --profile
```
If both of those succeed, you are not looking at a credential problem. You are looking at an access entry problem. The token in Side B is exactly the token the apiserver will see; if Side B returns a token, the kube-apiserver will see one too. The token is not the issue.
Then check which principals the cluster actually knows about:
```bash
aws eks list-access-entries \
--cluster-name \
--region \
--profile
```
If the deploy role's `principalArn` is not in that list, the cluster has no record of it. Every request that role makes will be rejected at the access-control layer, regardless of how valid the token is.
## What EKS access entries actually are
EKS access entries are the API-level replacement for the `aws-auth` ConfigMap. They were introduced as AWS deprecated the `aws-auth` pattern of mapping IAM roles to Kubernetes users by hand-editing a YAML file in `kube-system`. The migration has been underway for years; many clusters still run with `authenticationMode: CONFIG_MAP` and rely on `aws-auth`, some run with `API_AND_CONFIG_MAP` during the transition, and newer ones are `API` only.
Under any mode that includes the API, the chain is:
1. The IAM principal (your role) presents a presigned EKS token.
2. The apiserver validates the token against STS.
3. The apiserver looks up the principal in the access entry table.
4. If the principal is found, the associated access policies are mapped to Kubernetes groups or users.
5. Those groups and users are then subject to normal Kubernetes RBAC.
A 401 at step 3 means the lookup returned nothing. The principal is valid AWS-side and the token is valid STS-side; the cluster simply has no row for it. The token is presented, the lookup fails, the apiserver asks for credentials (because it has none to map to), and `client-go` reports that to the user as "server has asked for the client to provide credentials."
The exact same wording shows up when a human role tries to use a freshly recreated cluster. The cluster creator identity gets implicit admin and works; everyone else needs an entry.
## Where the gap came from in our case
Our EKS module takes an `access_entries` map. Each entry is `{ principal_arn = "..." }`, and the module creates the `aws_eks_access_entry` plus a defaulting `AmazonEKSClusterAdminPolicy` association at cluster scope. Adding a key to that map is the only thing one needs to do in code to grant a deploy role full access to a cluster.
The CI deploy role's entry was added to the map during the prod EKS rollout. The sibling `dashboard-admin` entry in the same block was already on the cluster, proving the block had been applied at least once. The deploy entry was added after that last apply. Edit-without-apply is one of the easier mistakes to make with Terragrunt, because the plan output for a single new entry is small and clean and the cost of skipping the apply "just this once" is invisible until the first deploy needs it.
Sandbox and pre both worked because their entries had been applied long before this gap. Prod was the first deploy through the new pipeline, so the gap only surfaced there. The earlier envs were unaffected.
## The fix
```bash
terragrunt apply --all --target /eks
```
The apply is only strictly additive if none of the other declared principals were already created by hand in the console. In our case the sibling dashboard-admin and viewer-role entries were already live on the cluster, so the apply would have failed with `ResourceInUseException` if we had run it cold. The first thing to do is verify the live cluster state:
```bash
aws eks list-access-entries \
--cluster-name \
--region \
--profile
```
If the entries the module wants to manage are already on the cluster, import them before applying:
```bash
terragrunt import 'aws_eks_access_entry.this["dashboard-admin"]' \
':'
```
Once the import is done, an `apply` against the same module is a clean create for the new entry and a no-op for the existing ones. End-to-end proof is the next deploy run. If the apply succeeded and the deploy still fails, the entry is not actually mapped to a usable policy association, and `list-associated-access-policies` is the next stop.
## A diagram of the path
The whole pipeline, with the failure point highlighted:
```
┌───────────────┐ ┌────────────────────┐ ┌───────────────┐
│ runner IRSA │ ──▶ │ cross-account │ ──▶ │ aws eks │
│ role │ │ deploy role │ │ get-token │
└───────────────┘ └────────────────────┘ └───────────────┘
│
▼
┌───────────────┐ ┌────────────────────┐ ┌───────────────┐
│ Kubernetes │ ◀── │ access entry │ ◀── │ kube- │
│ RBAC │ │ lookup ❌ no row │ │ apiserver │
└───────────────┘ └────────────────────┘ └───────────────┘
```
The runner IRSA role assumes the cross-account role, the cross-account role issues a token, the apiserver receives the token, the apiserver looks up the principal in the access entry table, and the lookup returns nothing. Everything before the lookup is fine. Everything after it is unreachable.
## The broader pattern
"Credentials" is a word that covers three different layers in an EKS deploy pipeline: AWS credentials (do you have a valid principal?), EKS access control (does the cluster know about that principal?), and Kubernetes RBAC (is that principal allowed to do the thing it's asking for?). Only the second one produces the message above. Rotating AWS keys does not help with the second one. Updating kubeconfig does not help with the second one. The only thing that helps with the second one is an `aws_eks_access_entry` for the principal that is asking.
When the message says "credentials," check which credentials it is actually talking about before rotating any of them. The error message is the worst part of the diagnostic; it survives across all three layers and points at the wrong one in two of the three cases. The chain `aws sts get-caller-identity` → `aws eks get-token` → `aws eks list-access-entries` resolves the ambiguity in under a minute and tells you which layer to fix.
The same pattern shows up in adjacent failure modes. A human admin role that works on the original cluster and stops working after a destroy/recreate is the same gap, with a different trigger. A CI role that worked on the previous env and stops working on the new one is the same gap, with a different apply history. The token is fine. The cluster is fine. The entry is missing.
---
# How I use Hermes Agent to automate my digital life
> Hermes Agent runs on my mini-PC, drives my Mac, and handles the logistics around my blog, YouTube, and taxes, so I can spend my time on the parts that actually need me. Here is how it works.
- URL: https://ashkmb.com/blog/hermes-automation/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-28
- Language: en
The question that kicked this off was simple: how do I automate my digital life without losing control of it?
I had tried the obvious things. Scripts, cron jobs, outsourcing. Nothing stuck. The problem was never the tools, it was the process. Blogging, taxes, and YouTube were eating my time, and I was spending more hours on logistics than on the work itself.
So I set up [Hermes Agent](https://github.com/NousResearch/hermes-agent), the open-source agent from Nous Research, and wired it into those workflows.
## The manual workflows that were eating my week
Here is what the old routine looked like.
**Blogging (ashkmb.com).** Write a post in English. Translate it to German and Persian by hand, or pay a translator, which was slow and expensive. Proofread all three, fix inconsistencies, and make sure the voice matched. Commit, push, wait for Cloudflare Pages to deploy. Three to five hours per post.
**YouTube (AgenticTube).** Find a post worth turning into a video. Build the slides, record the narration, edit. Upload, write the description, add tags. Two to four hours per video.
**Taxes (expenseTracker).** Search Gmail for invoices. Pull out the vendor, date, and amount by hand. Save the PDFs, rename them, compile a spreadsheet. Ten hours or more per year.
I was drowning in logistics. I needed to automate the repetitive parts without giving up creative control.
## What Hermes Agent handles
Hermes Agent is a workflow engine. It runs on my mini-PC (Linux), drives my Mac, and takes over the parts I do not need to touch:
| Workflow | What Hermes Agent does | My role |
|----------|------------------------|---------|
| Blogging | Writes drafts, translates to DE/FA, manages Git worktrees, publishes to Cloudflare Pages. | Review drafts, approve the PR. |
| YouTube | Turns blog posts into Shorts and weekly digests, uploads to YouTube (private), pings me on Telegram. | Click "Approve" to publish. |
| Taxes | Scans Gmail for invoices, extracts the data, stores it in PostgreSQL, exports a tax-ready ZIP. | Run `just export-year 2025`. |
| Research | Summarizes technical deep dives (for example, "Sonnet 5 benchmarks explained"). | Read the summary. |
| Ops | Watches the mini-PC (disk, memory, GPU usage). | Get alerted when something breaks. |
## How it works
### The box, and why the agent runs natively
Everything runs on one always-on mini-PC, a Core i9 with 32GB that used to be my Proxmox host. I reinstalled it as plain Ubuntu and gave it a single job: being the agent's home. My Mac is just a remote client; I talk to Hermes through the desktop app and Telegram, but the actual work happens on the box, which runs 24/7 and does not tie up my laptop.
The whole machine is provisioned with Ansible, one idempotent playbook, so the box is disposable. If it dies I rebuild it from the repo: base system, the agent, the model runtime, my CLIs and dotfiles, all as roles.
The decision I actually care about is that Hermes runs **natively** under systemd, as my own user, not in a container. That sounds like a footnote and it is the whole design. A containerized agent cannot see `terraform`, `kubectl`, `aws`, `gh`, `psql`, or my `~/.kube` and `~/.aws` configs, so "run terraform plan" just fails with command not found. Running native, the agent inherits the exact tooling I have in my own shell. It does my ops work, not a sandboxed imitation of it.
That comes with an honest trade-off. Native means the agent runs as a user with passwordless sudo, with no container wall around it. So the security boundary lives somewhere else on purpose: a Telegram allowlist for who is even allowed to talk to it, and a password on the dashboard. I treat those two as the fence, because they are the only fence.
In front of that, a **Caddy** reverse proxy handles the dashboard, and the whole thing reaches me through a **Cloudflare Tunnel**, so I never open an inbound port on my home network. Model inference runs on a hosted backend, not on the box: a tool- and vision-capable model for the reasoning, and a smaller vision model pinned for OCR and browser screenshots so the big model is not billed for every image. Scheduled jobs fire from cron and RSS polling; the interactive approve-and-publish loop comes in over Telegram. The box is mine and the orchestration is mine, but the model calls do leave it, so I keep the genuinely sensitive extraction scoped and reviewed rather than pretending nothing ever hits a cloud.
### AgenticTube: blog to YouTube
Hermes Agent watches my blog's RSS feed and turns posts into two things: daily Shorts (9:16, 45 to 65 seconds, narrated slides) and a weekly digest (16:9, 10 to 30 minutes, one segment per post).
The pipeline is six steps. It ingests the RSS feeds hourly, has a model pull out the key points in a neutral voice, generates a script (three slides for a Short, six or seven for a digest segment), renders with **ffmpeg** plus **Pillow** for the slides and **Google TTS** for narration, uploads through the YouTube API as private by default, and notifies me on Telegram with an "Approve" button. This post could become a Short or a digest segment without me lifting a finger.
### expenseTracker: tax invoice automation
Hermes Agent scans my Gmail for German invoices, both PDF attachments and email bodies, and does three things: extracts the vendor, invoice number, date, and amount (net, VAT, gross); stores it in PostgreSQL under the `financial_agent` schema; and exports a ZIP my tax advisor can open directly.
```bash
cd ~/Documents/Projects/Personal/expenseTracker
just export-year 2025 # writes ./exports/export_2025-01-01_2025-12-31.zip
```
The ZIP holds `documents/` (the PDFs and email bodies as HTML or text), `manifest.csv` (the clean invoices: vendor, date, amount), and `manifest_needs_review.csv` (anything the extraction was not confident about). The split matters: I only ever eyeball the second file.
### ashkmb.com: multi-locale blog posts
Hermes Agent writes from what I actually do, not from a generic prompt. This post about Hermes Agent is drawn from the real workflows above. For each post it handles the translations (EN/DE/FA), isolates the work in a Git worktree so nothing lands on `main` early, keeps it in draft until I approve, and fills in the SEO metadata (OG tags, JSON-LD).
Publishing is a review, not a command. Hermes opens the PR; I read the diff and merge it:
```bash
gh pr diff # eyeball the EN/DE/FA changes
gh pr merge --merge # Cloudflare Pages deploys on merge to main
```
## What it actually buys me
Hermes Agent does not do the thinking, it does the logistics around the thinking. It cuts blogging from hours to minutes, catches inconsistencies before they reach production, and leaves me with the part I care about: ideas, not plumbing.
That is the whole point. Automation here is not about replacing me, it is about clearing the repetitive work off my desk so the hours I spend are spent writing, thinking, and building rather than renaming PDFs.
## What's next
I am still refining the workflows. Three things are on the list: automated thumbnail and OG-image generation, scheduled publishing via cron instead of a manual merge, and using Hermes to analyze reader feedback and fold it back into posts.
If you want the technical details, how the subagents are wired, what the verification scripts check, say so and I will go deeper.
---
# Opus 5 is here at half the price of Fable 5. The benchmarks are great, but the API changes are the real story.
> Opus 5 shipped on July 24 as Anthropic's new default model. The benchmark table is a rounding error away from Fable 5 at half the cost. But the thing that will actually change your day is quieter: thinking is on by default now, and that breaks a few assumptions you have been carrying since 4.8.
- URL: https://ashkmb.com/blog/opus-5-what-actually-changed/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-27
- Language: en
Opus 5 shipped on July 24, 2026. Opus 4.8, the model it replaces, is my daily driver, so I read the release with a specific question: not "is it smarter" (it is), but "what changes in the loop I already have." The answer turned out to be more interesting than the benchmark table, and most of it is not in the release blog post.
Here is the short version. Opus 5 costs the same as Opus 4.8, five dollars per million input tokens and twenty-five per million output. That is half the price of Fable 5, Anthropic's top-tier model, and Opus 5 gets within spitting distance of Fable on most of the numbers that matter. It is now the default on Claude Max and the strongest model on Claude Pro. If you were on 4.8, this is a model-name swap that makes you meaningfully smarter for the same money.
But "swap the string and go" hides three changes that will quietly bite you. Let me get the benchmarks out of the way first, because they are the least surprising part.
## The benchmarks, honestly
The headline Anthropic is selling is "frontier intelligence of Fable 5 at half the price," and the numbers mostly back it up. On [Frontier-Bench](https://www.anthropic.com/news/claude-opus-5) v0.1 at max effort, Opus 5 scores 43.3%. Opus 4.8 scored 18.7% on the same test. Fable 5, the model that costs twice as much, scores 33.7%. Opus 5 does not just close the gap to Fable; on this particular benchmark it clears it.
The rest of the table is the same shape:
- **SWE-bench Verified: 96.0%.** Real GitHub bugs, graded by the projects' own hidden tests. A year ago the frontier here was in the mid-sixties.
- **SWE-bench Pro: 79.2%**, against Fable 5's 80.0%. Within a point, half the cost. That single comparison is the entire pitch.
- **OSWorld 2.0: 70.57%**, up from 55.7% on 4.8. This is the computer-use benchmark, a real Ubuntu desktop driven by mouse and keyboard.
- **ARC-AGI-3 at high effort: 30.16%.** Opus 4.8 scored 1.52% here. This is the novel-problem-solving benchmark, the one designed so you cannot pattern-match your way through, and the jump is not a typo.
- **IMO 2026: 42 out of 42**, gold-medal level on this year's International Mathematical Olympiad problems.
I am quoting these from the release and from the first wave of coverage, not from a system card I have read cover to cover, so treat two-decimal figures like 70.57% with the usual caution. The pattern is what matters, and the pattern is clear: the agentic and reasoning numbers are where Opus 5 pulled ahead, and it did so while staying at Opus pricing. If you spend your day inside a coding agent, that is the number that shows up in your work.
That is the part everyone will screenshot. Now the part that will actually change how you use it.
## Thinking is on by default now, and your max_tokens is a trap
On Opus 4.8 and 4.7, a request that left the `thinking` field unset ran without thinking. That was the default, and a lot of code was written around it, including mine. On Opus 5 the same request thinks. Omitting the field now gives you adaptive thinking; the old "no thinking" behavior is `thinking: {type: "disabled"}`, which you now have to ask for.
This is not just a behavior change, it is a billing and truncation change, and that is the part that catches people. `max_tokens` is a hard cap on thinking plus response text, together. A workload that never set `thinking`, ran clean on 4.8, and sized `max_tokens` tightly around the answer will now spend a chunk of that budget on reasoning and can truncate mid-response. Nothing errors. You just get a shorter answer than you asked for, and if you are parsing structured output downstream, that shows up as a broken parse rather than an obvious cause.
So the first thing to do on migration is not to swap the model string. It is to walk every call site that never touched `thinking` and either raise `max_tokens` to leave room, or explicitly pass `thinking: {type: "disabled"}` if you genuinely want the old behavior.
And there is a second edge on that same lever. Disabling thinking is only allowed at effort `high` or below. Pair `thinking: {type: "disabled"}` with `xhigh` or `max` effort and you get a 400. The check runs per request, so a route that raises effort to `xhigh` for a hard turn while thinking is still disabled will fail on that turn even though every earlier turn in the same conversation went through fine. If you were reflexively running `xhigh` with thinking off on 4.8, that combination is now invalid, and honestly you are probably better served by a lower effort with thinking on. Opus 5 is unusually strong at `low` and `medium`; the effort defaults you carried over from a previous model are almost never the right setting.
## Delete your verification scaffolding
This is the one that surprised me, because it inverts advice I give constantly.
"Ask the model to double-check its work" is a standard, sound prompting technique. On Opus 5 it is wrong. The model self-verifies without being asked, so an instruction that tells it to verify, or a harness step that spins up a verifier pass, now causes over-verification: it does the work, then does it again, burning tokens and latency for no gain. Anthropic's own guidance is blunt about it. Delete the verification prompts. This is a delete, not a rewrite, and removing the scaffolding reduces the over-verification with no measurable capability loss.
The same instinct shows up with subagents. Opus 4.8 under-reached for delegation and needed a nudge to fan out. Opus 5 reaches for subagents readily, sometimes too readily, because each one re-establishes context, re-explores, reports back, and then the coordinator re-reads the report. If your harness supports subagents, any "delegate more" guidance you added for 4.8 should come out, and you probably want an explicit cap on spawn count. The direction reversed between the two models, which is a genuinely unusual thing to have to account for in a point-release migration.
It also just talks more. Default response text is longer, and files it writes to disk are longer. Lowering `effort` does not reliably shorten the visible output, so the lever here is a plain conciseness instruction in the prompt, not a knob. A short "keep responses focused and brief" line cut visible length by about a fifth in Anthropic's testing.
## The smaller changes that still matter
A few things that are easy to miss:
**The prompt-cache minimum dropped to 512 tokens**, down from 1024 on 4.8. Prompts you had written off as too short to cache will now create cache entries with no code change. Worth re-checking anything you assumed was uncacheable.
**Fast mode runs at roughly 2.5x throughput for 2x the price**, and it is Claude API only. If you have Bedrock, Vertex, or Foundry in the mix, that lever is not available there, so drop it on those routes.
**Automatic fallbacks got easier.** Opus 5's safety classifiers can decline a request outright: you get a normal HTTP 200 with `stop_reason: "refusal"`, not an exception. If your code reads `content[0]` without checking `stop_reason` first, it breaks on a refusal. The new `fallbacks: "default"` mode re-runs a declined request on a fallback model server-side and routes by refusal category, so you do not maintain a model list yourself. For a security-adjacent workload where benign requests occasionally trip a classifier, opting into that by default is the right move.
**Rate limits are a separate bucket.** Opus 5 does not draw from the combined Opus 4.x pool, so moving traffic over neither frees headroom on the old bucket nor inherits it. Check your tier's Opus 5 limits before you shift volume.
## The safety story is a real shift for anyone doing security work
This one is relevant to me specifically, and probably to a chunk of the people reading this. Anthropic tightened alignment and, at the same time, loosened the cybersecurity classifiers by a lot. Opus 5's cyber classifiers are described as roughly 85% less restrictive than Fable 5's. On Frontier-Bench, the safety classifiers flagged about 5% of API calls, against 42% for Fable 5.
Concretely, source-code vulnerability finding is now unblocked, while binary scanning, penetration testing, and exploit generation stay restricted. If you do authorized defensive work, code review for vulnerabilities, CTF-style analysis, the false-positive rate that made Fable 5 frustrating for that work has come way down. It is not a free-for-all, and the exploit-generation guardrails are still there, but the day-to-day friction of getting a legitimate security question answered is much lower.
And it pairs with the alignment gains rather than trading against them. Prompt-injection resistance improved (2.0% attacker success on the Gray Swan benchmark, down from 5.5% on Opus 4.8), and Anthropic is calling this its most aligned model to date. Fewer refusals on legitimate security work and better injection resistance in the same release is a good combination to see.
## What I am actually doing about it
Nothing dramatic, which is the point. The migration is a model-name swap plus a short checklist:
1. Change the model string to `claude-opus-5`.
2. Walk every call site that never set `thinking`. Raise `max_tokens`, or pass `thinking: {type: "disabled"}` if I want the old no-thinking behavior. This is the one that would have silently truncated things otherwise.
3. Find any route that pairs disabled thinking with `xhigh` or `max` effort and fix it, because it now 400s.
4. Delete verification prompts and any verifier passes in the harness.
5. Re-sweep `effort`. The `xhigh`-by-reflex default I carried from 4.8 is probably too high; `low` and `medium` are stronger on Opus 5 than they have any right to be.
6. Add a conciseness line where output length matters, since the model runs longer by default.
The benchmarks are the headline and they are genuinely good. But the story for anyone who builds on top of this model is that a handful of defaults moved, and moved in ways that do not throw errors, they just quietly change your output or your bill. Those are the ones worth an afternoon before you roll it out.
---
**Sources**: [Introducing Claude Opus 5](https://www.anthropic.com/news/claude-opus-5) (Anthropic, July 24, 2026). Benchmark figures and API details cross-referenced against Anthropic's developer documentation and launch coverage; treat exact decimals as reported rather than independently verified.
---
# I deleted the same DNS record twice. The third time, I asked why.
> A public endpoint went down twice in three days, and the same five-minute fix worked both times: delete an orphaned AAAA record. The real bug was a DNS record that can never own itself, sitting at the apex of a delegated zone.
- URL: https://ashkmb.com/blog/external-dns-apex-aaaa-deadlock/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-24
- Language: en
A public endpoint went down. Not a 500, not a timeout; the name just stopped resolving. Deleting one orphaned DNS record fixed it in under five minutes, and I moved on. Three days later the same endpoint died the same way, and the same fix worked again. That recurrence is the only reason I didn't close the ticket a second time and call it luck: a fix that needs repeating on a schedule isn't a fix, it's a symptom, and the actual bug was a DNS ownership record that can never write itself into existence.
## The first outage looks like a leftover record
The symptom was a Go service failing every outbound call to the endpoint in about 4.5 milliseconds, too fast to be a real timeout, which is the tell for a DNS resolution failure rather than a backend error. `dig` on the name came back with a stray `AAAA` record pointing at the ingress load balancer, and nothing else. No `A` record at all.
The load balancer itself was fine. Before touching any DNS, I proved the target independently of what the zone claimed:
```
curl --resolve checkout.example.com:443: https://checkout.example.com/
```
A valid certificate and a real application response came back. So the backend was never in question; only the record type was wrong. The `AAAA` was dead weight, because the load balancer is IPv4-only and had never answered on that address.
external-dns runs with `--policy=sync` and `--registry=txt`, which means it owns a name by holding a matching TXT record next to it, and it refuses to touch anything it doesn't own. The logs explained the rest:
```
Skipping endpoint checkout.example.com ... AAAA ... because owner id does not
match for one or more items to create, found: "", required: "eks-prod-cluster"
```
external-dns wanted to publish the `A` record from the Ingress, but the stray `AAAA` had no ownership TXT it recognized, so the whole changeset for that name was refused, not just the `AAAA` but the `A` too. Under `sync`, an unowned record doesn't just sit there as an orphan; it blocks every other create at the same name until a human removes it. Deleting the `AAAA` let the next reconcile publish the `A`, and the endpoint came back.
## Three days later, the same fix, and a decision to actually look
Same endpoint, same fast failures, same missing `A` record. Deleting the orphaned `AAAA` fixed it again. This time I pulled CloudTrail on the hosted zone before closing anything, because a fix that recurs on its own schedule is a sign the automation is regenerating the problem, not that someone keeps breaking the record by hand.
CloudTrail showed external-dns UPSERTing the `A` record every ten minutes, right up until a single `DELETE` on the `AAAA`, followed by silence. Not a one-time mistake, but a loop that ran cleanly for a while and then locked itself out. The question stopped being "what deleted the A record" and became "why does external-dns keep creating a record it can never keep."
## The record that can never own itself
The endpoint sits at the apex of its own delegated hosted zone: its own zone, not just a name inside a bigger one, with the parent zone living in a different AWS account entirely, the same kind of account boundary that makes [peering cheaper than a shared transit hub](https://ashkmb.com/blog/vpc-peering-vs-transit-gateway-cost/) once you're pricing cross-account traffic instead of DNS writes. That distinction is what breaks the ownership model.
external-dns's AWS provider expands an Ingress into a dual-stack desired state: an `A` and an `AAAA`, even when only the `A` will ever resolve to anything. The TXT registry disambiguates ownership per record type with a type-prefixed TXT name: for the `AAAA` on `checkout.example.com`, that's a TXT literally named `aaaa-checkout.example.com`. At an ordinary subdomain that record lands in the same zone as everything else. At a zone apex, it's a sibling of the apex name itself, which places it one level up, in the parent zone, `example.com`, which lives in an account external-dns has no access to. The logs say so plainly:
```
Skipping record aaaa-checkout.example.com because no hosted zone matching record DNS Name was detected
```
external-dns can create the `AAAA` record, but it can never write the ownership TXT that would let it claim the record as its own. On the very next reconcile, it reads its own `AAAA` back with no matching owner, exactly the "unowned record blocks the create" situation from the first outage, except now the unowned record is one external-dns wrote for itself. That trips the same guard, which refuses the whole changeset, including the `A`. The record that keeps the endpoint alive gets held hostage by a record nobody can ever own, in a zone nobody can ever write to.
This isn't specific to one zone. It's a general property of the type-prefixed TXT registry: it cannot own a record at the apex of a zone whose parent it doesn't control. Only the older, bare-format TXT (the one written without an `a-`/`aaaa-`/`cname-` prefix) lands inside the zone itself, because it isn't a sibling of the apex; it's just the apex name with a different record type. A subdomain a few levels deep never hits this, because every ownership TXT it needs lives inside the same zone as the record.
## The fix that actually holds
The durable version doesn't touch the zone at all; it stops external-dns from wanting an `AAAA` in the first place:
```yaml
# external-dns chart values
managedRecordTypes:
- A
- CNAME
```
This renders as `--managed-record-types=A --managed-record-types=CNAME`, replacing the default `[A, AAAA, CNAME]`. With no `AAAA` in the desired state, there's no apex ownership TXT to fail to write, and nothing left to deadlock on. It's safe here specifically because every backend behind this zone is an IPv4-only load balancer, so AAAA was never serving traffic, only breaking the thing that was.
Two questions were worth answering before trusting that fix, not just guessing at:
**Does this break the TXT registry for everything else?** No. `managedRecordTypes` filters which record types get published from Kubernetes sources; it says nothing about the registry's own bookkeeping. TXT records were never in that list to begin with (the default doesn't include TXT either), and the registry keeps working exactly as before for the `A` and `CNAME` records that remain.
**Does external-dns even need TXT ownership?** Only under `--registry=txt`. The alternative that avoids this class of problem entirely is a DynamoDB-backed registry, which stores ownership out of band instead of as sibling records in the zone. That's a cluster-wide change with a bigger blast radius than one chart value, so it stayed as a noted option rather than something applied on the spot.
## What to take from this
The first fix was correct and still wrong. Deleting the orphaned record was the right move both times, and it was never going to be the last time, because it treated the effect and left the cause generating a fresh one every reconcile. The tell wasn't in the error message; it was in the fact that the same five-minute action was needed twice for the same reason. A bug that reappears on its own, without anyone touching the system in between, means something is producing it on a loop, and CloudTrail is what turns "it broke again" into "here's the loop." It's the same shape of trap as [a Helm release that reports success while the running config stays stale](https://ashkmb.com/blog/helm-configmap-reload-cross-release/): the tooling isn't lying, it's just reporting on a layer above the one that actually broke.
It's also a reminder that ownership systems built on convention, a TXT record that means something because of where it sits and how its name is prefixed, inherit every boundary of the naming hierarchy underneath them. Nothing about the delegated zone was misconfigured. The zone worked exactly as delegated zones are supposed to; it was the assumption that every record's owner can always live next to it that didn't survive contact with an apex. Kubernetes ships more of these convention-based defaults than most people notice, in the same way that [`enableServiceLinks`](https://ashkmb.com/blog/kubernetes-enableservicelinks-env-collision/) quietly injects environment variables nobody asked for until the day it collides with something real.
---
# The new cluster ran 110 pods per node. Production was stuck at 58.
> Same instance type, half the pod density. Raising max pods on a live EKS cluster means a launch template the node group can never gain, a CNI setting that has to land first, and a Terraform plan carrying changes nobody asked for.
- URL: https://ashkmb.com/blog/eks-max-pods-live-cluster/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-22
- Language: en
Two EKS clusters, same instance type. The one built this year schedules 110 pods per node. The production cluster, built earlier, tops out at 58 and was hitting that ceiling: plenty of CPU and memory left, no room for pods. The goal sounded like a one-line change: give production the same density. It turned into a new node group, a CNI prerequisite, and a Terraform plan that wanted to do far more than I asked.
## Where 58 comes from
By default, EKS derives max pods from networking, not from compute. The VPC CNI gives every pod a real VPC IP from the node's ENIs, so the ceiling is ENI arithmetic: an m6g.xlarge gets 4 ENIs with 15 addresses each. The first address on every ENI is the ENI's own primary IP and never goes to a pod, which leaves 4 × 14 = 56, and EKS adds 2 for pods on the host network: 4 × (15 − 1) + 2 = 58. The node has 4 vCPUs and 16 GB for 58 pods, which is fine for chunky workloads and terrible for a platform full of small ones.
[Prefix delegation](https://docs.aws.amazon.com/eks/latest/best-practices/prefix-mode-linux.html) changes the arithmetic. Instead of attaching individual IPs to each ENI slot, the CNI attaches /28 prefixes, 16 addresses per slot, and the practical limit stops being the ENI table. The kubelet still needs to be told its new ceiling, and AWS recommends capping it at 110 for anything under 30 vCPUs. That is where the greenfield cluster's density came from: its node groups were born with prefix delegation on and `max_pods = 110` in the launch template.
## The podsPerCore detour
My first instinct on a Karpenter-managed cluster had been `podsPerCore: 10`, which sounds adaptive: small nodes get less, big nodes get more. It is a trap in this setup, twice over. The kubelet applies `podsPerCore` as a cap on top of max pods, so a 4-core xlarge gets 40, which is *below* the 58 it already had. And Karpenter computes node capacity from ENI limits and is not aware of prefix delegation, so the scheduler's view and the kubelet's view drift apart. A flat `maxPods: 110` with prefix delegation enabled is boring and correct. The proof is satisfying to watch on a fresh node:
```
$ kubectl get node -o jsonpath='{.status.capacity.pods}'
8
$ kubectl get node -o jsonpath='{.status.capacity.pods}'
110
```
That was an m6g.medium going from 8 pods, an almost comical default for a 4 GB node, to 110.
## You cannot add a launch template to a live node group
Here is the part that makes production different from greenfield. Setting `max_pods` on a managed node group means the module renders a launch template for it, because the kubelet flag has to travel through user data. But a managed node group that was created *without* a launch template can never gain one. The EKS API rejects the update outright:
```
ValidationException: Cannot update launchTemplate
```
Terraform knows this, and models the change as ForceNew: destroy the node group, create a replacement. On a sandbox that is a shrug. On a production cluster that is every node in the group cycling on Terraform's schedule instead of yours.
So the move is to not fight it: create a new node group alongside the old one, born with the launch template it needs.
```hcl
general_arm_v2 = {
instance_types = ["m6g.xlarge"]
desired_size = 3
min_size = 2
max_size = 20
max_pods = 110
max_unavailable = 1
}
```
The old group keeps serving traffic untouched. Workloads drift over as the new group scales and the old one is cordoned and drained on a schedule you pick, with a rollback that is just "stop draining." Spreading the new group across availability zones costs nothing on the instance side, by the way; the only bill is inter-AZ data transfer, the same line item that dominates the [VPC peering versus Transit Gateway math](https://ashkmb.com/blog/vpc-peering-vs-transit-gateway-cost/).
## Enable prefix delegation before the nodes, not after
The launch template is only half the change. The `vpc-cni` addon has to have `ENABLE_PREFIX_DELEGATION=true` before the new nodes come up:
```hcl
vpc-cni = {
configuration_values = jsonencode({
env = { ENABLE_PREFIX_DELEGATION = "true" }
})
}
```
Get the order wrong and you build a liar: the kubelet advertises 110 slots, the scheduler happily fills them, and the CNI can only actually assign the old ENI-limit's worth of IPs. Every pod past that line sits in `ContainerCreating` waiting for an address that will never come. Nothing in the deploy pipeline catches it; it is the same class of failure as [a ConfigMap update that never reaches the running pod](https://ashkmb.com/blog/helm-configmap-reload-cross-release/), where everything is green except the runtime.
One more constraint hides in the instance list: prefix delegation is Nitro-only. Production's spot group still listed `m4.large`, a pre-Nitro type from another era, and any node launched on it would silently fall back to the old limits. Old instance types in a mixed-instances policy are exactly the kind of residue nobody audits until a feature quietly excludes them.
## The plan carried changes I never wrote
`terraform plan` came back with 6 to add, 1 to change, 2 to destroy. My change accounted for three: the node group, its launch template, the CNI setting. The rest was a module upgrade from weeks earlier that had been sitting unapplied, and it bundled a migration from the aws-auth ConfigMap to EKS access entries. Nobody had asked for that today, but applying my change would apply it too.
Reading it through was worth the hour. The two destroys looked scary and were safe: they were `null_resource` provisioners whose config blocks had been deleted from the module, and a destroy-time provisioner only runs if its block still exists, so Terraform would drop them from state without executing anything. The ConfigMap survives, and with the cluster in `API_AND_CONFIG_MAP` mode nobody loses access.
The creates were the actual landmine. The plan wanted to create an access entry for an SSO admin role, and a check against the live cluster showed that exact entry already existed, created by hand through the console months ago. EKS's `CreateAccessEntry` is not idempotent:
```
ResourceInUseException: The specified access entry resource is already in use on this cluster
```
The apply would have failed halfway through, with the node group possibly created and the auth migration half-applied. The resolution was to split the blast radius: apply the density change with `-target` on exactly the three resources that are mine, and turn the auth migration into its own change, one that starts by importing the hand-made entries instead of colliding with them.
## What to take from this
Pod density on EKS is a birth property. The launch template, the CNI mode, and the kubelet ceiling are all fixed when a node group is created, so the clean way to change them on a live cluster is to create the next generation next to the current one, not to mutate in place. Like [the enableServiceLinks default](https://ashkmb.com/blog/kubernetes-enableservicelinks-env-collision/), the ENI-based pod limit is something most people meet the day it blocks a rollout.
And treat every plan line you did not write as a question, not a formality. The unapplied module bump had been waiting in ambush for whoever ran plan next, and the live cluster held state, hand-made access entries, that no amount of reading HCL would reveal. The plan tells you what Terraform wants to do; only the cluster tells you whether it can.
---
# Sonnet 5 dropped. I asked what changed. Here's what I actually learned.
> I wanted to know what changed architecturally between Sonnet 5 and Sonnet 4.6. Anthropic won't say. So I read the 146-page system card, and ended up writing a plain-English guide to every benchmark in it.
- URL: https://ashkmb.com/blog/sonnet5-benchmarks-explained/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-15
- Language: en
Sonnet 5 shipped on June 30, 2026. I had the same question most people had: what actually changed under the hood? Is this a new model, a new post-training run, a different architecture? Anthropic, predictably, said almost nothing.
I went looking. What I found was a 146-page system card with no architectural details, a release blog post heavy on benchmark tables, and a moment where I realized I didn't actually know what any of those benchmarks meant.
This post is the result of that realization. It's a story about asking a question, hitting a wall, and pivoting into something more useful.
## The question I actually asked
It started simple. I wanted a comparison: Sonnet 5 vs Sonnet 4.x, what changed? Not marketing-friendly bullet points, the real technical delta.
The honest first answer was that I didn't know, and there was no way to find out from the outside: Anthropic doesn't publish architectural details for any Claude model. No parameter counts, no layer counts, no attention mechanism, no training compute. The 146-page system card is the most authoritative source, and the entirety of what it says about how the model was built is one paragraph in the introduction.
That paragraph is worth quoting in full:
> Claude Sonnet 5 was trained on a proprietary mix of publicly available information from the internet, public and private datasets, and synthetic data generated by other models. After the pretraining process, Sonnet 5 underwent rigorous post-training and fine-tuning...
That's it. Pretraining, then post-training, then fine-tuning. The same shape Anthropic has described for every Claude generation since the 3-series. If there is a more interesting architectural story behind Sonnet 5, it is not on the public record.
I had two options. I could have speculated. I could have made up parameter counts, invented layer structures, dressed up plausible-sounding guesses as facts. I won't do that, not for you and not for me. So instead of telling you what I can't know, I went and read what I can.
## What the system card actually contains
The Anthropic system cards have a consistent shape. The first 10 pages are executive summary and training process. The next 80 or so are safety evaluations: alignment, agentic misuse, prompt injection, behavioral audits, model welfare. The last 50 are capabilities, broken down by benchmark, with a summary table near the front.
For Sonnet 5 the summary table on page 115 is the thing most people screenshot. It has columns for Sonnet 5, Sonnet 4.6, GPT-5.5, and Gemini 3.5 Flash, with rows for SWE-bench Pro, Terminal-Bench, BrowseComp, HLE, OSWorld, GDPval, and a handful of others. The numbers tell a clear story: Sonnet 5 is a strict improvement over 4.6 on every capability, and it closes most of the gap to Opus 4.8 at a third of the price.
But here's the thing I noticed on the second pass: the column labels are mostly opaque to anyone who isn't a frontier-AI researcher. SWE-bench Pro, Terminal-Bench, BrowseComp, GDPval-AA, HLE, OSWorld, ProgramBench, FrontierCode, CursorBench, AutomationBench, HealthBench Professional, Legal Agent Benchmark. The names hint at the topic. They don't tell you what's being measured, why the score matters, or what kind of model you'd want to be when these benchmarks go up.
That's the gap this post is trying to fill. I am going to explain each one in plain English, in the order they appear in the system card, with the goal that by the end you can read any future model release and know exactly what the numbers are saying.
## The benchmarks, explained
A few useful framings first.
The word **agentic** matters. An agentic benchmark gives the model a real environment (a terminal, a browser, an IDE, a virtual machine) and expects the model to use tools, run commands, and finish a multi-step task on its own. The model is not just answering a question. It is doing work.
The word **reasoning** also matters, and it means something specific in this context. A reasoning benchmark is constructed so the answer cannot be memorized. The model has to plan, chain steps, or prove something from first principles.
Finally, how a benchmark is graded matters as much as the score. Some benchmarks use strict pass or fail against hidden unit tests. Some use a human judge or an LLM judge applying a rubric. Higher numbers mean very different things across these styles, and I'll flag which is which.
### SWE-bench family (Verified, Pro, Multilingual, Multimodal)
A collection of real GitHub issues from real open-source repositories. The model gets a code repository and an issue description, and has to produce a patch that closes the issue. Patches are scored by running the project's own hidden unit tests.
Think of it as: here is a real bug report a senior engineer filed. Fix it.
The four variants differ in difficulty and scope:
- **Verified**: 500 problems, each human-checked to be solvable. The easier version.
- **Pro**: drawn from actively maintained repos, with larger multi-file changes and less public ground-truth leakage. Much harder.
- **Multilingual**: 300 problems across nine programming languages, not just Python.
- **Multimodal**: the issue includes screenshots or design mockups alongside text.
Why it matters: this is the closest publicly available proxy for "can this model do my day job as a software engineer?" The score correlates with how useful a model is inside an IDE or a coding agent. Sonnet 5 at 85.2% on Verified means on real, human-vetted bugs from real repos, it produces a passing patch about five times out of six. For context, the best score this time last year was around 65%.
### Terminal-Bench 2.1
Eighty-nine tasks that require using a real Linux or Unix terminal to accomplish something. The model gets a shell, runs commands, and the final state of the machine is graded.
Examples of task shapes: set up a service, debug a misconfigured daemon, process a pile of files, recover from a broken install, debug a config file the user can barely describe. The harness is `mini-SWE-agent`, a real, time-aware agent loop, not a synthetic test environment.
Why it matters: real engineering work happens in the terminal. Deployments, debugging, scripting, system administration. Terminal-Bench specifically measures whether the model can operate a computer through a shell, including commands, pipes, error handling, and judgment calls about what to try next.
Sonnet 5 at 80.4% (at xhigh effort) means four out of five real shell tasks completed end to end.
### BrowseComp
An agentic web-search benchmark. The model is asked a question whose answer is findable on the public internet but not obvious. The point is not to know facts (an LLM might already have them). The point is to test whether the model can browse the web well, which means choosing good queries, ignoring SEO spam, following promising leads, and triangulating across sources.
Two configurations: single-agent (one model instance working alone) and multi-agent (several instances collaborating, e.g., one searches and one critiques). Sonnet 5 scored 84.7% single-agent and 86.6% multi-agent on a 10-million-token limit, with context compaction kicking in at 200K tokens.
Why it matters: modern AI agents are increasingly expected to do research, look up documentation, monitor news, and verify claims. BrowseComp measures that loop.
### Humanity's Last Exam (HLE)
A 2,500-question benchmark written by hundreds of subject-matter experts, designed to be at the frontier of human knowledge. It spans math, science, philosophy, law, and other fields, and the questions are constructed so you cannot Google them or pattern-match.
Two configurations: no tools (pure reasoning from training knowledge) and with tools (web search, code execution, programmatic tool calling). Sonnet 5 scored 43.2% no-tools and 57.4% with-tools.
Why it matters: HLE was designed precisely because older benchmarks like [MMLU](https://en.wikipedia.org/wiki/MMLU) have saturated. Frontier models now score too high on them for the scores to be discriminating. HLE is the current "are you still getting smarter?" benchmark. Sonnet 5's 43.2% on the no-tools variant is high. This is genuinely hard material.
### OSWorld-Verified
A simulated Ubuntu desktop in a virtual machine. The model is given tasks like "open this LibreOffice document, replace all instances of X with Y, save as PDF" or "configure this GNOME setting." It controls the real desktop via mouse and keyboard actions, with screenshots included.
Why it matters: this is the test for computer-use agents, the kind of thing that powers features like Anthropic's own computer use capability. Real productivity software (Google Docs, Photoshop, IDEs) is the long-term target. Sonnet 5 at 81.2% (first-attempt success rate, averaged over five runs) means the model can complete most everyday desktop workflows. Two years ago the best score was below 30%.
One detail worth flagging: Anthropic had to re-evaluate Sonnet 4.6 on OSWorld after fixing a bug in their zoom tool for batched actions and bumping the per-turn token limit from 16K to 128K. They found they had been under-reporting OSWorld performance on 4.6. A small reminder that benchmark numbers are a snapshot of a model and a harness, not a model alone.
### FrontierCode v1
150 agentic coding tasks created by Cognition (makers of Devin), drawn from real pull requests in open-source repositories. Each task gives the agent a checked-out repository and a single issue, and the agent has to produce a final patch autonomously in a containerized environment, with no human intervention and no timeout information.
Tasks are graded against blocking functional criteria (held-out unit tests) plus weighted rubric criteria, including model-graded checks for required test coverage and prohibited implementation patterns. The tasks were authored by maintainers of the underlying repositories and individually reviewed by Cognition researchers.
Why it matters: this is harder than SWE-bench Verified because the issues come from actively maintained, real-world projects, and there is no human in the loop. Sonnet 5 at 38.8% is much lower than its SWE-bench numbers, and that gap is the point. FrontierCode is a benchmark where there is still real headroom for improvement. Sonnet 4.6 at 15.1% shows the magnitude of the jump.
### CursorBench
An agentic coding benchmark created and run by Cursor (the AI code editor company) in their production harness, the same harness real users hit in Cursor's product. Tasks are drawn from real coding work and external traffic.
Why it matters: this is one of the few cases where a third party is willing to publish a cross-model comparison. The numbers are reported independently by Cursor: Sonnet 5 at 61.2%, Sonnet 4.6 at 49%, Opus 4.8 at 63.8%. It is not a synthetic benchmark. It is measuring how well the model does in a real IDE, against tasks real Cursor users actually hit.
### USAMO 2026
The USA Mathematical Olympiad. Six proof problems, two days, for top high-school students. Solutions are not numbers. They are written proofs. Grading uses the MathArena methodology: a neutral model rewrites each proof, then a panel of three frontier models grades it against rubrics. The final score is the minimum across judges, which is very strict.
Why it matters: most AI math benchmarks give the model a numerical answer to type in. USAMO forces the model to actually construct and write a mathematical argument, which is a much higher bar for reasoning. The jump from 55% (Sonnet 4.6) to 79.5% (Sonnet 5) is striking. Sonnet 5 is now solving proof-based olympiad problems more than three times out of four.
For reference, Opus 4.8 scored 96.7% and Mythos 5 scored 99.8% on the same evaluation. The Anthropic framing of "near-Opus at Sonnet pricing" is roughly accurate for most tasks, but the absolute top is still held by the more expensive models.
### ArxivMath
Research-level math problems pulled monthly from recent [arXiv](https://arxiv.org) paper abstracts, filtered to be self-contained, non-trivial, and verifiable. Closer to actual research mathematics than contests.
Two configurations: without tools (pure reasoning) and with tools (can run computations, search). Sonnet 5 scored 65.7% without tools and 72.2% with tools.
Why it matters: USAMO tests competition skill. ArxivMath tests whether the model can engage with real, current research mathematics. A 65 to 72% score is a sign the model can plausibly assist a working mathematician, not just an olympiad coach.
### ProgramBench
A long-context coding benchmark. The model is given only a binary (a compiled program) and the project's documentation, and has to rebuild the source code from scratch, without internet access or decompilation tools. Tasks range from small utilities (`jq`, `ripgrep`) to large systems (FFmpeg, SQLite, the PHP interpreter).
Submissions are graded by execution-based behavioral tests. There are 247,000+ tests across the benchmark, generated via agent-driven fuzzing.
Why it matters: this is one of the few benchmarks that specifically tests the 1-million-token context window claim. The model has to hold an entire large codebase in context and reason across it. Sonnet 5 scored 76 to 86% across episodes, compared to 52 to 74% for Sonnet 4.6. That is a real long-context story, not just a coding story.
### Multimodal benchmarks (GDP.pdf, ChartMuseum, CharXiv, BenchCAD)
A cluster of benchmarks that test whether the model can read, parse, and reason about non-text inputs.
- **GDP.pdf**: 100 prompts and PDFs drawn from real professional workflows across ten domains (finance, healthcare, legal, engineering, insurance). Tests whether the model can find, cross-reference, and synthesize information across long, complex documents. Sonnet 5 at 67.5% without tools, 81.6% with tools.
- **ChartMuseum** and **CharXiv Reasoning**: scientific chart understanding. Given a chart and a question, extract the right number. Important for any data-analysis workflow. Anthropic reports ChartMuseum +10.8 percentage points over Sonnet 4.6, the largest multimodal gain.
- **BenchCAD**: programmatic CAD generation. Given a spec, write code that generates a 3D part. Specialized but a real test of math plus code plus spatial reasoning.
### Real-world professional tasks (OfficeQA, Real-World Finance V2, Legal Agent Benchmark, GDPval-AA v2, Toolathlon, AutomationBench, AA-Briefcase)
A group of benchmarks that test the model on the kind of work a paid knowledge worker does. The standout is **GDPval-AA v2**, which scores models on real-world, economically valuable tasks drawn from actual occupations. Tasks come from domains like finance, law, healthcare, engineering. Graded by humans comparing model output to expert human output, reported as an **Elo score** (the same scoring system used in chess, where a difference of 100 Elo is roughly a 64% win probability).
Sonnet 5 at 1618 Elo, up from 1395 for Sonnet 4.6, is enormous in Elo terms. For context, the gap between two human chess grandmasters is often less than 100 Elo.
The others in this cluster test specific professional surfaces: contract review, legal citation, finance workflows, office document QA, tool orchestration, automation scripts. They are graded by humans, by LLM judges, or by execution against hidden tests, depending on the benchmark.
**AutomationBench** is the one to watch for anyone who has been hoping AI can take over the back-office. Sonnet 5 at 13.5% (up from 5.3% for 4.6) is a huge jump in absolute terms but the score is still low. Automation at this level is genuinely unsolved, and Sonnet 5 only barely cracked double digits.
### Healthcare (HealthBench, HealthBench Professional)
Medical benchmarks built from real clinical scenarios, graded by physicians. The "Professional" variant is harder, aimed at testing whether the model can support actual clinical reasoning, not just answer trivia.
Why it matters: medical AI has a much higher error-cost than most domains. The jump from 44.2% to 57.8% is meaningful. This is the benchmark that matters for any AI doctor assistant product.
### Multilingual (GMMLU, MILU, INCLUDE)
Language-specific reasoning benchmarks for global languages (Korean, Bengali, and others). The point is to check that gains are not English-only. Anthropic did not highlight these in the release, which is a small tell: they were either not differentiating or not flattering enough to lead with.
## How to read the table as a whole
Three patterns are worth holding in mind.
**First, the agentic numbers are where the action is.** SWE-bench Pro, Terminal-Bench, FrontierCode, OSWorld, ProgramBench. These measure the model doing things in real environments, not just answering questions. Sonnet 5's biggest gains are here, and so is most of what makes it feel different in practice.
**Second, where Sonnet 5 still trails Opus and Mythos, the gap is narrowing fast.** On USAMO 2026, Sonnet 5 scored 79.5%, against 96.7% for Opus 4.8 and 99.8% for Mythos 5. That still leaves Opus 4.8 about 17 points ahead, but with Sonnet 4.6 the gap was about 42.
**Third, the scores that did not move much are the ones that were already saturated.** GDP.pdf went from 66.9% to 67.5% because 4.6 was already near the ceiling of what that benchmark can discriminate. The benchmarks where Sonnet 5 made huge jumps (FrontierCode +23.7 percentage points, USAMO +24.5 percentage points) are the ones where there is still headroom for genuine improvement. This is a useful general principle: when a model's score barely changes, ask whether the test can still tell the difference.
## What the system card does not say
A few things are conspicuously missing from all of this, and the absences are themselves informative.
**No architecture details.** No parameter count, no layer count, no attention mechanism, no MoE versus dense statement, no training compute. Anthropic has held this line since the 3-series. If a third party (SemiAnalysis, The Information, an arXiv paper) has reverse-engineered specifics, I would want to see that paper before citing it. Inference is a model, not a fact.
**No training data composition beyond "publicly available information, public and private datasets, and synthetic data."** No token counts. No data mix percentages. No information about what was filtered out, why, or how.
**No comparison to 4.5.** Every public Sonnet 5 comparison is against Sonnet 4.6. The fact that Anthropic skipped a 4.5 reference suggests 4.6 is the version they consider the immediate predecessor, and 4.5 is being quietly retired from the conversation.
**The pricing story is the architectural story, in a sense.** Sonnet 5 launches at $3 per million input tokens and $15 per million output (with an introductory $2 / $10 rate through August 31, 2026). That is the same as Sonnet 4.6. The product surface is also the same: 200K context standard, 1M beta, 10M with context compaction, text-only output, multimodal input. The API contract is essentially identical to 4.6, so migration is a model-name swap for most users. The improvement is in the post-training and inference behavior, not in any of the levers developers pull.
## What I took away from this
I went in wanting to know what changed. I came out with two things.
The first is a more honest relationship with model-release announcements. Anthropic's blog post is correct in every claim, but it is not telling the full story. The interesting part is not in the prose. It is in the system card, and the system card is structured so the interesting part is in a 50-page section most readers will not get to. Knowing that means I know to read the system card next time, and to know what I am looking at when I do.
The second is a much better understanding of the benchmarks themselves. I have written about AI for years and I still had to look up what FrontierCode actually grades, or what the difference between ProgramBench and SWE-bench Multilingual really is. Naming things is not the same as knowing them. The benchmark names are almost designed to be opaque: short, technical, and packed with assumption. The Anthropic team and I use the same words to mean very different things.
If you read this far, you now have a working vocabulary for every benchmark in the Sonnet 5 system card. The next time a model release lands, you can skip the marketing and read the system card directly. You will know what the rows mean, how the grading works, and why a 10-point jump on one row is bigger news than a 10-point jump on another.
That is what I wanted to learn. That is what I am sharing.
---
**Sources**: [Introducing Claude Sonnet 5](https://www.anthropic.com/news/claude-sonnet-5) (Anthropic, June 30, 2026), [Claude Sonnet 5 System Card](https://www-cdn.anthropic.com/283ef97c476cf442c91d9a37d5b214242a55bb92/Claude%20Sonnet%205%20System%20Card.pdf) (Anthropic, June 30, 2026, 146 pages).
---
# The app read REDIS_PORT. Kubernetes had already overwritten it.
> Every view that touched the cache returned 500 while the health check stayed green. The cause was a Service named redis and enableServiceLinks, a Docker-era Kubernetes default that injects environment variables you never asked for.
- URL: https://ashkmb.com/blog/kubernetes-enableservicelinks-env-collision/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-07-08
- Language: en
I was deploying a Django app to [my homelab cluster](https://ashkmb.com/blog/vibe-coded-proxmox-dashboard/). Nothing exotic: the app, a Postgres, a Redis, each behind its own Service. Pods came up green, fixtures loaded, `/health` returned 200. Then I tried to log in and got a bare HTTP 500 with an empty body.
Not just login. The API schema endpoint 500'd too. The health endpoint kept working, static files kept working. It took a few requests to see the pattern: every view that touched the cache failed, and everything that didn't was fine.
## Getting a traceback out of a production-mode pod
The image had `DEBUG` hardcoded to `False`, so the response body was empty and the logs showed the 500 without the exception behind it. Instead of rebuilding the image with debug on, I ran Django's test client inside the pod:
```python
# kubectl exec -it -- python manage.py shell
from django.test import Client
c = Client(raise_request_exception=True)
c.post("/backend/token/", {"username": "admin", "password": "..."})
```
`raise_request_exception=True` is the useful part. Instead of rendering the 500 page, the test client re-raises the original exception straight into your shell. No code change, no redeploy, no debug mode in a running cluster. The traceback came back immediately:
```
ValueError: Port could not be cast to integer value as 'tcp:'
```
A port that starts with `tcp:`. The Redis connection string the app had assembled looked like this:
```
redis://redis:tcp://10.233.61.42:6379/1
```
The app builds that URL the way most twelve-factor apps do:
```python
REDIS_HOST = os.environ.get("REDIS_HOST", "redis")
REDIS_PORT = os.environ.get("REDIS_PORT", "6379")
CACHE_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/1"
```
`REDIS_PORT` was set in the pod's environment. Not by my manifests, not by the chart, not by any ConfigMap. Its value was `tcp://10.233.61.42:6379`, which is not a port. It is a URL.
## Who sets REDIS_PORT to a URL
The kubelet does. When a pod starts, Kubernetes injects a block of environment variables for every Service that exists in the namespace. For a Service named `redis` on port 6379, every pod in the namespace gets:
```
REDIS_SERVICE_HOST=10.233.61.42
REDIS_SERVICE_PORT=6379
REDIS_PORT=tcp://10.233.61.42:6379
REDIS_PORT_6379_TCP=tcp://10.233.61.42:6379
REDIS_PORT_6379_TCP_PROTO=tcp
REDIS_PORT_6379_TCP_PORT=6379
REDIS_PORT_6379_TCP_ADDR=10.233.61.42
```
This is a compatibility layer for Docker links, the pre-DNS mechanism Docker used to wire containers together. Kubernetes adopted the exact variable format in its first release so that containers written for Docker links would keep working. That was over a decade ago. DNS-based service discovery won, nobody writes apps against `*_PORT_6379_TCP_ADDR` anymore, and the injection is still on by default. The pod field that controls it is `enableServiceLinks`, and it defaults to `true`.
The collision is nasty for a specific reason: `_PORT` is exactly the variable name a twelve-factor app would choose on its own. Name your Service `redis` and read `REDIS_PORT` in your app, and you have a guaranteed conflict where Kubernetes wins, because the injected environment is there before your code runs. The value isn't even a number, since Docker links formatted it as a protocol-qualified URL.
My Postgres dodged the same bullet by accident. Kubernetes injected `POSTGRES_PORT=tcp://...` too, but the app reads `DB_HOST` and `DB_PORT`, so the injected variables sat there unused. That's the frustrating part of this failure mode: whether it bites depends on an invisible naming coincidence between your Services and your app's config convention.
## The fix
Three options, in the order I'd reach for them.
Turn the injection off on the pod spec:
```yaml
spec:
enableServiceLinks: false
```
This is the clean fix. Service discovery through DNS is untouched; `redis.namespace.svc` still resolves. The only thing that disappears is the legacy variable block, and if your app runs on any cluster built in the last decade, nothing was reading it.
If you can't touch the pod spec, set the colliding variable explicitly:
```yaml
env:
- name: REDIS_PORT
value: "6379"
```
Variables declared in the container spec take precedence over the service links, so an explicit value shadows the injected one. This works, but it fixes one collision at a time and leaves the mechanism armed for the next Service someone adds.
The third option is naming discipline: never name a Service so that `_PORT` matches something your app reads. I don't trust this one. It depends on every future teammate knowing about a Docker-era injection rule while naming a Service, which is exactly the kind of knowledge that evaporates.
One more property worth knowing: the variables are injected at pod start, for Services that exist at that moment. Start the pod before creating the Service and the variable isn't there; restart that same pod a week later and suddenly it is. A deploy that worked can break on the next reschedule with no change to any manifest. It's the same class of failure as [a ConfigMap update that never reaches the running pod](https://ashkmb.com/blog/helm-configmap-reload-cross-release/): the deploy pipeline is green, and the breakage only exists at runtime.
## What to take from this
Kubernetes still ships compatibility behavior older than most clusters running it, and it stays invisible until it lands in your environment variables. Like [finalizers](https://ashkmb.com/blog/kubernetes-finalizers-explained/), `enableServiceLinks` is a mechanism most people learn about the day it blocks them.
Two habits worth adopting. When an app misbehaves in a pod but works everywhere else, print the pod's actual environment (`kubectl exec -- env | sort`) before reading any more code; the answer to "who set this?" is sometimes the platform itself. And for charts you control, consider setting `enableServiceLinks: false` as the default for any workload that doesn't explicitly need Docker-links variables, which today is close to all of them.
---
# The Agent Control Plane: Omnigent on Kubernetes
> Databricks open-sourced Omnigent, a meta-harness that wraps any agent harness behind a unified API with policies, sessions, and shared state. If you have deployed stateful services to Kubernetes before, the path to self-hosting it is shorter than you think.
- URL: https://ashkmb.com/blog/omnigent-meta-harness-kubernetes/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-29
- Language: en
Infrastructure engineers have been orchestrating services for years. Load balancers in front of application servers. Sidecars for telemetry. Policy enforcement at the ingress. The pattern is so familiar it borders on boring.
Now the same question is arriving at the agent layer.
Databricks recently open-sourced [Omnigent](https://www.databricks.com/blog/introducing-omnigent-meta-harness-combine-control-and-share-your-agents), calling it a "meta-harness": a layer that wraps individual AI agent harnesses, including Claude Code, Codex, and custom implementations, behind a common API. Sessions, policies, and skills travel with you regardless of which model or harness is running underneath. It is an abstraction over the reality of juggling multiple agent tools simultaneously and manually copying context between them.
The concept is not novel if you have ever self-hosted an AI agent. When I set up a self-hosted research agent on EKS, the same questions surfaced: where does state live, who controls network boundaries, how do you expose the agent to callers without exposing the whole machine? Omnigent formalizes those questions into a coherent product.
## What the Meta-Harness Actually Is
There are three pieces worth understanding before thinking about deployment.
The **runner** wraps an underlying agent in a sandboxed session. It intercepts network requests, applies policy, and mediates the agent's access to the outside world. This is where the interesting security work happens.
The **server** manages sessions, policies, and sharing. It is what lets you define a rule like "require human approval before any git push that follows a package installation" without patching the agent itself. Policies here are stateful and contextual, not simple allow/deny lists.
The **database** is where session state, audit logs, and policy configurations persist. It needs to outlive individual runner processes or pods.
If you have deployed any stateful web service to Kubernetes before, you have already solved this problem in a different domain. The topology is the same.
## The Kubernetes Shape of the Problem
Running Omnigent on a cluster is not a novel infrastructure problem. It has the same shape as services you have probably deployed before: a server component that should be horizontally scalable, which means it has to be stateless; a runner component that wraps a subprocess and is inherently single-session by nature; and a shared database that both can reach.
The deployment manifests, the Service definitions, the Ingress rules, none of that is the interesting part. The question that deserves real thought is the network interception boundary. The runner needs to sit between the agent and outbound traffic to enforce policies. Where that lands in your existing cluster topology, and how it interacts with your network policies and egress controls, is the question worth sketching out before writing any YAML.
The database configuration is the first real fork in the road:
```env
# Single-instance local or demo
DATABASE_URL=sqlite:////data/artifacts/chat.db
# Production: any managed Postgres will do
DATABASE_URL=postgresql://user:pass@postgres-host:5432/omnigent
```
**SQLite** works for a single-instance local setup, but it stores data on the pod's local disk. On Kubernetes, that means data lives and dies with the pod unless you have mounted persistent storage explicitly. Start with SQLite only if you understand exactly what you are giving up.
**Postgres** is the right choice the moment you care about persistence or want more than one server replica. Any managed Postgres instance, whether in-cluster or external, works. The key constraint is network reachability from your pod CIDR. The initial migration on a fresh Postgres deployment takes around a minute; give your startup probe enough time or your first deploy will fail a healthcheck it should pass.
The rest of the Kubernetes questions are the same ones you answer for any stateful service: where do secrets live, how does the runner get credentials for the agents it wraps, and who can reach the server from outside the cluster.
## Quick Starts Without the Operations Cost
If you want to understand how Omnigent behaves before committing to an infrastructure decision, a **HuggingFace Docker Space** is the fastest path to the UI. You can have it running in a few minutes. The important thing to understand going in: HuggingFace Spaces use ephemeral disk storage by default. If you configure SQLite, your session history and policies will be gone on the next container restart. Treat it as an exploration environment, not a place to build anything you care about keeping.
For teams already on the Databricks platform, **managed Omnigent on Databricks** is the opposite end of the spectrum. You get the meta-harness without operating it yourself, with the Databricks security and governance model already in place. If your organization's agents and data already live in that ecosystem, this is the obvious starting point.
The interesting space is in between: self-hosted on infrastructure you control, with policies tailored to your team's actual risk model, not a vendor's defaults.
## The Part That Actually Matters
The deployment question has a tractable answer. The policy question is harder and more interesting.
Omnigent's policy system is stateful. A rule can say: after this agent downloads a package, require human approval before it can push to a remote repository. That is not a static allow/deny list; it is a state machine layered over the agent's actions. Your policies encode your organization's threat model for agent behavior.
What would yours look like? Cost limits that pause an agent before an expensive API call. Approval gates before any write touches a shared environment. Audit trails that span model switches so you know which model made which decision during an incident.
Kubernetes operators have been managing stateful systems declaratively for years. The instinct is the same here: define what correct agent behavior looks like, then let the system enforce it rather than supervising every session by hand.
The agent layer is getting the infrastructure treatment it has always needed. The only question is whether you define what that looks like for your team, or let someone else decide.
I have not had the chance to run Omnigent in a real cluster myself yet; other projects have had my attention. It is already on my list and I will post a follow-up once I have hands-on time with an actual deployment.
---
# StackGres and Strimzi: Day-Two Lessons From a Real Platform Rebuild
> Every operator promises a simpler setup. The real payoff shows up later, when a replica loses its control file or a certificate is three weeks from expiring. Here is what StackGres and Strimzi actually changed about running PostgreSQL and Kafka on Kubernetes.
- URL: https://ashkmb.com/blog/kubernetes-operators-stackgres-strimzi/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-25
- Language: en
We were rebuilding a pre-production environment from scratch. Two stateful systems had to move: a PostgreSQL cluster with TimescaleDB extensions handling time-series metrics, and a Kafka cluster processing event streams across multiple pipeline stages.
For both, the question was the same: vanilla StatefulSets managed with Helm charts, or purpose-built Kubernetes operators?
We went with operators. StackGres for PostgreSQL, Strimzi for Kafka. Neither decision was obvious at the start. Several weeks in, both earned their keep, though not in the ways I expected going in.
## What operators actually promise
The theory is that operators encode operational knowledge into a controller. You describe what you want, a PostgreSQL cluster with three replicas or a Kafka cluster with SCRAM (Salted Challenge Response Authentication Mechanism) authentication, and the operator reconciles toward that state continuously. Unlike a Helm chart that renders static YAML and walks away, an operator watches and reacts.
The marketing case is Day-1 setup. The real case is Day-2: backups, failover, certificate rotation, replica recovery. That is where the difference between "someone wrote YAML for your StatefulSet" and "someone who understands this system deeply wrote a controller for your cluster" actually shows up.
## StackGres: the backup moment
StackGres wraps a Patroni-managed PostgreSQL cluster behind a set of CRDs. You define an `SGCluster`, and the operator provisions and continuously manages the underlying StatefulSet, sidecars, replication configuration, and connection pooling. PgBouncer is built in. Patroni handles leader election. You declare intent; the operator handles the rest.
Backup configuration is declarative:
```yaml
spec:
configurations:
backups:
- sgObjectStorage: my-s3-storage
cronSchedule: "0 2 * * *"
retention: 7
```
The `SGObjectStorage` object defines where backups go. WAL-G handles the actual upload; the operator manages the lifecycle. You do not write backup scripts, cron Jobs, or separate backup Deployments. You describe the policy, and the operator enforces it continuously.
What took us a few hours to discover: the backup upload runs inside the primary database pod, not in a separate backup Job. This matters for cloud credential injection. If you are using pod-native IAM credentials (injecting a cloud identity via the pod's service account rather than a static key), that annotation has to land on the database pod's service account. The operator's `allResources` field is the correct place to set this annotation, because any annotation applied manually gets stripped on operator reconcile:
```yaml
spec:
metadata:
annotations:
allResources:
"eks.amazonaws.com/role-arn": "arn:aws:iam::123456789012:role/pg-backup-role"
```
After correcting this and rolling the pods, the backup that had been silently failing for days completed. That is the first Day-2 moment: not a setup task, but a failure that the operator's monitoring surfaced and that the operator's structure gave us a clean path to fix.
### The replica reinit
The second moment was more dramatic.
A replica went into a crash loop. What happened: the replica had lost its `pg_control` file, could not stream from the primary, and fell through to a fallback behavior specific to StackGres, trying to restore itself from the latest WAL-G backup on S3. The restore timed out. The operator set a failed-backup flag, and the replica restarted every 60 seconds.
With a raw StatefulSet this would mean shelling into the pod, understanding the state of the Patroni member, deciding whether to wipe and resync or run a manual `pg_basebackup`, and hoping you do not make it worse. With StackGres, the operator's fallback logic made the recovery path explicit:
```bash
# Remove the failed-restore marker; operator falls back to streaming from primary
kubectl exec -n data -1 -c patroni -- \
rm /var/lib/postgresql/replication/initialization-failed-backup
kubectl delete pod -1 -n data
```
The replica came back, streamed from the primary, and rejoined. The operator's structured fallback, "try S3 first, then try leader streaming," gave us a deterministic recovery path instead of an open-ended debugging session.
### Migrating TimescaleDB across operators
When we moved data from the old deployment to the new StackGres cluster, vanilla `pg_restore` is not enough for TimescaleDB. The extension has its own restore protocol:
```sql
-- Run in the target database before pg_restore
SELECT timescaledb_pre_restore();
```
```bash
pg_restore -Fc --no-owner < dump.pgfc | psql target_db
```
```sql
-- Run after pg_restore
SELECT timescaledb_post_restore();
```
The source and target extension versions must match exactly; that is the real gate before attempting the restore. We ran the migration as an in-cluster byte-pipe, piping output from a `kubectl exec` on the source cluster directly into `kubectl exec -i` on the target, to avoid routing database traffic over a VPN connection.
One detail that slowed us down: StackGres installs PostgreSQL extensions declaratively. A database that relies on `uuid-ossp` will not restore successfully until that extension appears in the cluster spec:
```yaml
spec:
postgres:
extensions:
- name: uuid-ossp
version: "1.1"
```
Applying the updated cluster spec triggers a live install without a pod restart. The extension is available in minutes.
## Strimzi: the version coupling
Strimzi manages Kafka clusters through a `Kafka` CRD. You declare the cluster, and the operator handles broker placement, configuration, certificate management, and rolling restarts.
The first constraint we ran into was version coupling. Strimzi 1.0, which supports Kubernetes 1.30 through 1.36, ships Kafka 4.x only. Kafka 4.x is KRaft-only, meaning Kafka's built-in Raft-based consensus, with ZooKeeper gone entirely. If you are copying manifests from a Kafka 3.x deployment, remove the `inter.broker.protocol.version` and `log.message.format.version` settings; Kafka 4.x drops them entirely.
This matters less than it sounds for clients. The Kafka wire protocol negotiates versions bidirectionally. A 3.x client library can talk to a 4.x broker without modification.
### TLS: why cert-manager, not ACM
For external access, we needed clients to trust the broker certificate without importing a custom CA. The options were a managed certificate service or Let's Encrypt via cert-manager.
Managed certificates from cloud providers do not work here. They cannot be exported. You can terminate TLS at a load balancer, but you cannot mount a managed certificate into a broker pod. A Kafka broker needs the certificate locally for L4 TLS; a proxy terminating it upstream is not sufficient. cert-manager with Let's Encrypt was the only path to a publicly trusted certificate that can be mounted in the pod.
One gotcha that cost a few minutes: cert-manager generates PKCS#1 private keys by default. Kafka's SSL implementation rejects PKCS#1 with `algid parse error, not a sequence`. The fix is one field:
```yaml
spec:
privateKey:
encoding: PKCS8
```
After fixing the key encoding and triggering an operator reconcile via the `strimzi.io/force-reconcile` annotation, the brokers started cleanly.
### Certificate rotation that runs itself
The Let's Encrypt certificate expires in 90 days. cert-manager renews it automatically at day 60 and overwrites the same Kubernetes Secret in place. The Secret name does not change, which means the Strimzi listener reference does not change.
Strimzi hashes the referenced Secret and rolls brokers when the hash changes, one at a time, preserving availability. Clients notice nothing: the host and SAN stay constant, and Let's Encrypt's root is already in the default JVM and OS trust stores.
The monitoring posture becomes: watch the cert-manager `Certificate` object for `Ready=False` near the renewal date, and watch for a missing `CertificateRenewed` event. If cert-manager cannot complete the DNS-01 challenge, the brokers keep serving the still-valid old certificate until it expires. You have a 30-day window to notice and fix the renewal before clients see anything.
Compare this to certificate rotation without an operator: generate a new cert, update a Secret, identify which pods need a restart, coordinate the restart to avoid a partition quorum loss, confirm clients reconnected. With Strimzi, that sequence is the default behavior on every renewal cycle.
### Broker placement and the AZ deadlock
Kafka brokers need to be on separate nodes. Without required anti-affinity, all three brokers will schedule onto a single node, and that node going down takes the cluster with it:
```yaml
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: strimzi.io/name
operator: In
values: ["my-cluster-kafka"]
topologyKey: kubernetes.io/hostname
```
Adding anti-affinity creates a subtler problem. If the brokers initially co-locate on one node during cluster bring-up, their EBS volumes provision in that node's availability zone. When the anti-affinity rule displaces a broker to a node in a different zone, the volume cannot follow. EBS volumes are zone-local. The displaced broker enters a pending state with `didn't match PersistentVolume's node affinity`.
On a fresh cluster the fix is straightforward: delete the stuck broker's empty PVC. Strimzi recreates it on reconcile, and this time the volume provisions in the zone where the broker actually scheduled.
For real fault tolerance, brokers should span three availability zones. Two zones is a cost compromise with a known failure mode: an AZ loss can take two of three brokers and drop quorum.
### Declarative users and ACLs
KafkaUser CRDs let you manage authentication and authorization as YAML:
```yaml
apiVersion: kafka.strimzi.io/v1
kind: KafkaUser
metadata:
name: event-producer
spec:
authentication:
type: scram-sha-512
authorization:
type: simple
acls:
- resource:
type: topic
name: "*"
patternType: literal
operations: [Write, Create, Describe]
```
The operator creates SCRAM credentials, stores them in a Secret named after the user, and keeps ACLs synchronized with the live cluster. Revoking a user is a `kubectl delete kafkauser`. The operator removes the credentials and the ACLs. No broker config to edit, no password to rotate manually.
One behavior to keep in mind: renaming a KafkaUser requires deleting the old CR explicitly. `kubectl apply` with a new name creates a new user; it does not remove the old one. The old user keeps working with live credentials until you delete the old CR. This is correct behavior, but it can produce ghost users with live SCRAM credentials during a cleanup.
## What operators do not fix
Operators reduce toil; they do not eliminate it.
`SGInstanceProfile` changes in StackGres do not fully propagate. The operator caches sidecar resource requests and can produce a `requests > limits` conflict when you change CPU or memory. The fix is to delete and recreate the profile so it recomputes cleanly. This is a known behavior, not a bug, but the "just update the YAML" assumption breaks on resource changes.
PVC resize in StackGres requires a specific sequence: update the cluster spec before deleting any pods. If you delete a pod before updating the spec, the in-pod cluster controller reads the old size and tries to shrink the PVC back. That gets a 422, and the controller crash-loops. The window for making this mistake is small but real.
Strimzi's broker anti-affinity plus zone-local volumes means that a two-AZ node group provides no real fault tolerance. You get isolation from node failures, not zone failures.
## The pattern that emerges
After running both operators through an environment rebuild, data migration, and the first weeks of production-like traffic, the pattern is clear. Operators earn their cost, which is real CRD complexity and a new layer of debugging, specifically on operations that are hard to get right once and nearly impossible to get right every time under pressure.
Backup restoration with StackGres. Certificate rotation with Strimzi. Replica reinit after a bad state transition. These are the tasks where "someone who understands this system deeply wrote a controller" is worth more than any amount of well-intentioned shell scripting.
The setup benefit is real but modest. The Day-2 benefit compounds every time something goes wrong and you know exactly what the operator will do next.
---
# Helm deploy succeeded. Config never applied.
> A green CI pipeline while the live gateway serves 404s is not a test failure. It is a silent reload gap. Here is the cross-release checksum pattern that closes it in helmfile.
- URL: https://ashkmb.com/blog/helm-configmap-reload-cross-release/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-21
- Language: en
We added a new API route to the gateway service. The helmfile pipeline ran, every stage went green, and the deploy completed with no errors.
The route returned 404.
A port-forward and a curl confirmed it: the new route definition was not on the live gateway. The pod was running the config from the last restart, not the one we had just deployed. We had updated a ConfigMap. The pod had no idea.
What made this harder to spot: it had worked before. Two months earlier, a similar config change had gone live without incident. What we did not know then is that the change happened to also touch a volume `mountPath`, which caused Kubernetes to roll the pod as a side effect. The config update looked causal. It was coincidence.
## Why ConfigMaps do not trigger restarts
Kubernetes rolls a pod when its *pod template spec* changes. A ConfigMap is a separate object in the Kubernetes API. Updating one does not mutate the pod template. The pod continues running with whatever was mounted at its last start.
This is by design. Kubernetes deliberately separates "the data changed" from "the consumer needs to restart." For apps with in-process file watchers, this is the right behavior: they can reload config without a pod restart. For apps that read config files at startup and hold them in memory, it is a trap.
The gateway service falls into the second category. It reads API definitions from mounted files when it starts. There is no file watcher. A ConfigMap update lands on disk and stays there, invisible to the running process, until something restarts the pod.
## The standard fix: checksum annotation
The canonical solution is to add a `checksum/config` annotation to the Deployment's pod template, derived from the ConfigMap content:
```yaml
# templates/deployment.yaml — standard single-chart pattern
spec:
template:
metadata:
annotations:
checksum/config: {{ include "gateway.configmap" . | sha256sum | quote }}
```
When the ConfigMap content changes, the annotation value changes. The annotation lives inside `spec.template.metadata`, which is part of the pod spec. Kubernetes sees the pod template has changed and triggers a rolling restart. The annotation value is meaningless as metadata; its only job is to carry the change signal into the pod spec.
This pattern appears in the Helm docs and most writeups on forcing pod restarts on ConfigMap changes. It works well in a single Helm chart where `include "gateway.configmap"` can reach the named template.
## Why it breaks across releases
Our setup has two separate Helm releases: one that owns the gateway Deployment and one that generates the API-definition ConfigMaps from individual definition files.
`include` is scoped to the current chart. You cannot call `include "other-release.configmap"` from a Deployment template; the named template does not exist in that chart's rendering context. The ConfigMap content is not available to the Deployment chart at render time.
This is the part most checksum-annotation writeups skip. They assume a monolithic chart where the Deployment and ConfigMap share a template namespace. The moment you split them into separate releases, which is common for dynamically-generated config, the standard pattern has no way to reach across.
## The helmfile solution
helmfile values files support Go templating with a set of functions beyond standard Helm. Two of them solve this problem directly.
`readFile` reads a file's raw content and returns it as a string. `readDirEntries` returns the entries in a directory. Both resolve paths relative to the values file's own directory, not the repo root. That last detail matters.
In the gateway release's values file, we read every source file that feeds the ConfigMaps, concatenate the content, hash it, and expose the result as a values key:
```yaml
# helmfile-values/gateway/values.yaml.gotmpl
{{- $apiDir := "./apis" -}}
{{- $content := "" -}}
{{- range readDirEntries $apiDir -}}
{{- $content = cat $content (readFile (printf "%s/%s" $apiDir .Name)) -}}
{{- end -}}
configChecksum: {{ $content | sha256sum | quote }}
```
The `./apis` path resolves relative to the values file's location. If `values.yaml.gotmpl` lives at `helmfile-values/gateway/values.yaml.gotmpl`, then `./apis` must be `helmfile-values/gateway/apis/` on disk. Get this wrong and `readDirEntries` returns an empty list, `$content` stays empty, and the hash is constant. The annotation renders but never changes regardless of what you put in the source files.
The Deployment template then reads the pre-computed hash from values:
```yaml
# gateway chart — templates/deployment.yaml
spec:
template:
metadata:
annotations:
checksum/config: {{ .Values.configChecksum }}
```
The key insight: the hash computation happens in the helmfile values layer, before any chart-scoped templating runs. The Deployment chart does not need to know about the ConfigMap chart. The two releases are decoupled; the checksum bridges them through the values interface.
## Verifying it works
`helmfile template` renders the Deployment YAML with the annotation populated. Edit any file in the APIs directory, re-run `helmfile template`, and confirm the hash in the annotation changes. If it does not change, the path is wrong. Add `{{ $content | len }}` to the values template to confirm content is being read at all.
`helmfile diff` surfaces the annotation update as a clean pod-template change: just the annotation value, nothing else. After apply, a port-forward and a curl on the new route confirms the config is live.
## What to take from this
Multi-release architectures break single-release assumptions. The checksum annotation is well-documented for single charts; the cross-release variant almost never appears in official docs or blog posts.
helmfile's `readFile` and `readDirEntries` are the right escape hatch because they operate at the values layer, before any chart-scoped template context runs. This makes them available to any release that needs to hash content from another release's source files.
The relative-path behavior is the one place the abstraction leaks. Document the path mapping in your repo's values file with a comment once, and it stays solved.
The same pattern applies to any service that reads config from mounted files at startup: message brokers, proxies, certificate bundles, policy engines. If the service does not watch for file changes at runtime, a ConfigMap update is silent until something restarts the pod. The checksum annotation makes that restart automatic and deterministic.
---
# My Blog Now Posts to Instagram Automatically. Here Is the Agentic Pipeline Behind It.
> I built a pipeline that reads my blog's RSS feed and posts informative Instagram carousels without me touching anything. The interesting part is not the automation. It is how agents built it and what they broke.
- URL: https://ashkmb.com/blog/agentic-content-pipeline-instagram-carousel/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-19
- Language: en
Last month I got tired of the gap between writing a technical post and actually getting people to read it. The post exists. The audience is elsewhere. Bridging that gap manually means reformatting, resizing, rewriting for a different medium, and nobody does it consistently.
So I automated it. The result is a pipeline that reads my RSS feed, converts each post into an Instagram photo carousel, and uploads it on a daily schedule without me touching it. The interesting part is not the automation itself; it is what I learned building it with AI agents as co-developers, and what their code reviews actually caught.
## The Shape of the Pipeline
The system takes one input and produces two outputs. Given a blog post URL, it generates a YouTube Short and an Instagram carousel.
The Short follows the simpler path: an LLM writes a 60-second narration script, Google Cloud TTS voices it, Pillow renders minimal text slides, and MoviePy assembles them into a 9:16 MP4. One post becomes one vertical video.
The carousel is the newer, harder output. Instagram's photo carousel format is fundamentally different from video: it rewards information density over linear narrative. Eight swipeable cards that each stand alone are not the same thing as a 60-second script read aloud. That difference forced a different design.
The pipeline runs on a launchd agent, uses SQLite as a checkpoint database so any stage can resume after a crash, and processes one post per day. Every stage is idempotent. If a TTS call fails, the next run resumes from that exact point without re-generating the script.
## Why the Carousel Format Forced a Rethink
The obvious move for automating Instagram would have been to re-export the Short as a Reel. Same content, different platform.
But Reels optimized for reach are fundamentally entertainment content. Technical posts compressed into 60 seconds become noise. The reader who wants to understand something does not want a narrator reading a summary over stock footage of servers.
Instagram carousels work differently. The reader swipes at their own pace. Each card can carry a diagram, a comparison table, a concrete finding, or a single stat that lands with weight. The format rewards information hierarchy, not rhythm.
This pushed the design toward a typed card system. The carousel deck has a defined vocabulary:
```python
CARD_TYPES = {
"cover": "Title and subtitle for the post",
"concept": "One idea explained in plain language",
"comparison": "Side-by-side: A vs B",
"flow": "Process with numbered steps",
"bar": "Horizontal bar visualization from article data",
"stat": "Single number that matters",
"figure": "An image scraped directly from the article",
"takeaway": "The one thing to remember",
}
```
A dedicated deck LLM call receives the full article text and emits a structured JSON array of 6 to 9 cards. Each card has a type, a title, and type-specific content fields. The `takeaway` card always goes last. The model is not summarizing freely; it is selecting and fitting content from the article into defined containers.
That constraint matters more than it might seem.
## The No Invented Data Rule
The easiest failure mode for an LLM-driven content pipeline is hallucination. A bar card showing made-up benchmark numbers, a stat card with a figure the article never cited: these erode trust faster than not posting at all.
The pipeline enforces two hard rules. Bar and stat cards are validated against the article text before rendering. If a number appears on a card but not in the source article, the card is demoted to a `concept` type rather than dropped, so the deck length stays stable.
```python
def _validate_deck(deck: list[dict], article_text: str) -> list[dict]:
clean = []
for card in deck:
if card["type"] in ("bar", "stat"):
value = str(card.get("value", ""))
if value and value not in article_text:
card["type"] = "concept" # demote, don't drop
if card["type"] == "figure":
idx = card.get("figure_index", -1)
if idx < 0 or idx >= len(available_figures):
continue # drop invalid figure references entirely
clean.append(card)
return clean
```
Figure cards follow the same principle but stricter: they can only reference images scraped from the article itself. The scraper fetches the article HTML, finds all `` tags, filters out anything that looks like UI chrome (icons, navigation elements, images below a minimum pixel dimension), downloads the rest, and passes them to the deck prompt as a numbered list. The model can reference figure 0, figure 1, figure 2. It cannot invent one.
This is a meaningful architectural decision: the LLM is a selector and formatter, not a content generator. The article is the source of truth.
## The Stack
**OpenRouter** handles all LLM calls. The practical reason is routing flexibility: different tasks in the pipeline use different models. The narration script for YouTube (short, punchy, 60 seconds) uses `openai/gpt-4o-mini` for speed and cost. The carousel deck (longer reasoning, structured JSON output, content fidelity requirements) can target a more capable model without changing any other infrastructure. One endpoint, one API key, swap models per task.
```python
response = openrouter_client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[
{"role": "system", "content": DECK_SYSTEM_PROMPT},
{"role": "user", "content": article_text},
],
response_format={"type": "json_object"},
)
deck = json.loads(response.choices[0].message.content)["cards"]
```
The same pattern repeats for every LLM call in the pipeline. OpenRouter's unified API means model selection is a configuration concern, not an architectural one. When a new model ships that handles structured JSON output better, one line changes.
**Google Cloud TTS** voices the YouTube narration. The voice selection is context-aware: posts from my own blog use a male neural voice; posts from external URLs in the queue use a female voice. This is a minor detail, but it matters for consistency when you are generating audio daily and the output accumulates over months.
```python
voice = texttospeech.VoiceSelectionParams(
language_code="en-US",
name=TTS_VOICE_NAME if is_own_post else TTS_VOICE_NAME_FEMALE,
)
response = tts_client.synthesize_speech(
input=texttospeech.SynthesisInput(text=script),
voice=voice,
audio_config=texttospeech.AudioConfig(
audio_encoding=texttospeech.AudioEncoding.MP3
),
)
```
Neural TTS has become good enough that a daily content pipeline can rely on it without sounding robotic. The quality ceiling for narrated technical content is not the voice anymore; it is the script.
**Pillow** renders every carousel card as a 1080x1350 JPEG. There is no browser, no HTML-to-image conversion, no headless Chrome. The rendering is direct: load fonts, calculate text layout, draw primitives, paste images, write the file. This is more code than a screenshot-based approach, but it produces deterministic output with no external runtime dependencies and runs in a few hundred milliseconds per card.
The renderer dispatches on card type:
```python
def render_card(card: dict, out_path: str, figures: list[Path]) -> None:
img = Image.new("RGB", (1080, 1350), color=BACKGROUND)
draw = ImageDraw.Draw(img)
match card["type"]:
case "cover": _render_cover(draw, img, card)
case "concept": _render_concept(draw, img, card)
case "comparison": _render_comparison(draw, img, card)
case "bar": _render_bar(draw, img, card)
case "figure": _render_figure(draw, img, card, figures)
case "takeaway": _render_takeaway(draw, img, card)
case _: _render_concept(draw, img, card)
img.save(out_path, "JPEG", quality=92)
```
Each renderer is a self-contained function. Adding a new card type is one function and one entry in `CARD_TYPES`. Brand primitives, fonts, colors, and padding constants live in one module. The card schema is the stable interface between the LLM layer and the visual layer.
**Instagrapi** handles the Instagram upload. The carousel upload takes a list of image paths and a caption. The music selection runs a priority chain: try trending audio first, fall back to a fixed track if the trending lookup fails, fall back to no music if both fail. A failed music lookup should not block an upload.
## How Agents Actually Built This
This is where I want to slow down, because the development process is as interesting as the product.
The carousel feature was designed and implemented through a subagent-driven workflow. The process works like this: write a spec, write an implementation plan broken into discrete tasks, then dispatch each task to a fresh implementer subagent that has no knowledge of the other tasks, followed immediately by an independent reviewer subagent that sees only the implementation and has no context about my intentions.
The reviewer is not a polish pass. The reviewer is adversarial: its job is to find problems, not improve style.
Seven tasks went through this loop. The reviews caught five real bugs before any code ran:
**Cover subtitle spacing overlap.** The cover card renderer placed the subtitle at a fixed Y offset from the title. Long titles pushed into the subtitle zone and the text overlapped. The reviewer flagged this. The fix was to measure the title bounding box height and derive the subtitle Y position from it dynamically.
**Empty-bullet IndexError.** The flow card renderer iterated over step bullets and assumed at least one existed. The reviewer mentally traced what happens when the deck LLM emits a flow card with an empty steps list and flagged the crash path. One guard added.
**Hollow test.** The test for the figure card renderer checked that the function ran without raising an exception but asserted nothing about the output. The reviewer flagged it as passing for the wrong reasons. Assertions on JPEG file size and existence were added.
**Stage key collision.** The pipeline checkpoints each stage in SQLite using a string key. The carousel stage had inherited the key `"instagram"` from the old Reels code. The reviewer caught that if both paths ever ran against the same post, they would share a checkpoint row and the pipeline would treat one as already done. The key was renamed to `"carousel"`.
**Unguarded article fetch in the final stage.** The integration stage fetched the article HTML to build the carousel. If that fetch raised an exception, it propagated and marked the post as `error`. An `error` status locks the post from future retries. By that point in the sequence, the YouTube upload had already succeeded. The reviewer caught this: a transient network error on the article fetch would permanently lose the post from the queue even though the video had already landed on YouTube. A try/except now isolates the carousel stage from the YouTube result.
None of these bugs would have been caught by running the code against happy-path inputs. They are the kind of thing you discover six weeks into production, usually at an inconvenient hour.
The pattern worth generalizing: a reviewer that has no knowledge of your intentions and whose only job is to find problems is different from any code review where the reviewer already shares context with the author. Shared context is exactly why code review misses the bugs it misses.
## What Running This Daily Teaches You
Transient failures are permanent without an explicit retry gate. Google TTS occasionally returns a 504. When a post's stage row gets marked `error`, the pipeline's "have I seen this?" check treats any existing row as seen and skips the post forever. One transient network blip burns a post slot. The fix is a manual retry command that clears the error row; the main loop's idempotency depends on that invariant and you do not want to weaken it.
The SQLite checkpoint database is the right choice for a solo pipeline running unattended. Every stage writes its output and marks itself complete before the next stage starts. The pipeline can be killed at any point and resumed from where it stopped without re-running work that already succeeded. For a daily cron that nobody is watching, this matters more than it sounds.
OpenRouter's model routing reveals its value over time. The narration script and the carousel deck can use completely different models with no structural change to the codebase. When a model ships that handles long-context structured output better, one config key changes. That flexibility was not the original motivation for using OpenRouter; it became obvious only after running the pipeline long enough to want to experiment with different models for different tasks.
## What to Take From This
The pipeline I described is specific to my setup. The design posture is what transfers.
LLMs are selectors and formatters, not content generators. The article text is the source of truth; the model decides what to surface and how to structure it. Validation checks that the model stayed within the boundary the source established. This makes the output trustworthy in a way that pure generation does not, and it makes failures diagnosable because the input is always traceable.
Typed card vocabularies separate content decisions from rendering decisions. Once you define a `comparison` type, you can render it differently for Instagram, LinkedIn, or email without touching the LLM call. The card schema becomes the stable interface between the intelligence layer and the visual layer, and that separation is what lets you evolve either side independently.
The independent reviewer pattern in agentic development catches a class of bugs that test suites miss: interaction effects between independently implemented parts, missing guards on adversarial input paths, tests that pass but assert nothing meaningful. A reviewer with no context about your intentions finds different problems than one who already understands what you were trying to do.
If you are designing something similar, the architecture that has worked: SQLite for idempotent checkpointing, OpenRouter for flexible per-task model routing, a typed output schema that separates content from rendering, and a validation layer that refuses to forward data the source did not contain. The specific services are interchangeable. The design principles are not.
---
*The pipeline source is not public, but the architecture, stack, and development process described here are real and running daily.*
---
# Anthropic Got Shut Down Three Days After Launch. Here Is What That Means.
> The government pulled the plug on Fable 5 and Mythos 5 seventy-two hours after launch over a jailbreak claim. If you build on closed AI APIs, this week should make you uncomfortable.
- URL: https://ashkmb.com/blog/anthropic-export-controls-fable-mythos/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-13
- Language: en
Three days after Anthropic launched Fable 5 and Mythos 5, the Trump administration sent Commerce Secretary Howard Lutnick's letter to Dario Amodei and the models went dark for every customer, everywhere. Not just foreign governments. Everyone.
The stated reason: another company claimed it could jailbreak Mythos 5, the restricted cybersecurity-focused model available only to vetted US government users via a program called Project Glasswing. That claim was enough for the Commerce Department to impose export controls and demand that Anthropic prevent any foreign national from accessing both models. Since Anthropic has no technical way to verify the nationality of every user in real time, "comply with the directive" meant "shut it down for everyone."
That is the situation. Here is what I think it actually means.
## This Has Happened Before
In the 1990s, the US government classified strong encryption as a munition and tried to control its export under the same legal framework used for weapons. Phil Zimmermann was investigated for making PGP freely available online. Researchers were threatened for publishing cryptography papers. The NSA pushed the Clipper Chip, a hardware backdoor baked into telephones.
The government lost that fight. Not because it gave up, but because math does not respect borders. Once the algorithms were published, they were everywhere. Export controls on cryptography collapsed not from a single court ruling but from the sheer impossibility of enforcing them in a world of global internet connectivity.
The parallel to AI is imperfect but the shape is familiar. The thing the government is trying to control is information, not hardware. And last week alone, twenty-five open-weight models dropped across every modality. While Fable 5 and Mythos 5 are locked behind a Commerce license, Liquid AI's LFM2.5-8B runs on your laptop and Ideogram 4's weights are downloadable by anyone on the planet. The capability the government fears is available; it is just not labeled Anthropic.
## The Safety Trap
There is a specific irony in Anthropic's situation worth naming. Anthropic is the AI lab that made safety its founding identity. It partnered with the Center for AI Standards and Innovation at Commerce for pre-deployment testing. It built Mythos 5 specifically for US government cyber defenders, under a restricted access program, with safety guardrails designed to prevent harm.
The result: Anthropic is now simultaneously on a Pentagon blacklist deeming it too dangerous for the government's own use, and subject to export controls deeming it too dangerous for anyone outside the US. The lab that tried hardest to work with the government is the one that got shut down.
This does not mean safety work is pointless. But it should make other labs think carefully about the assumption that regulatory cooperation creates protection. It can just as easily create exposure. If you sit at the table and let the government test your models under a pre-deployment agreement, you also hand them the mechanism to act when they find something they dislike.
## What "Jailbreak" Actually Means Here
The word jailbreak is doing a lot of work in this story and it is worth being precise. A jailbreak in this context means someone found a way to get a model to produce outputs it was designed to refuse. That is a real security concern. But the threat model matters enormously.
The government's argument seems to be that a jailbroken Mythos 5 could provide meaningful uplift to adversaries. That is a testable claim, and Anthropic's own statement says the demonstration revealed "a small number of previously known, minor vulnerabilities." A narrow jailbreak on a model that is already restricted to vetted US users is a very different risk class than, say, a bioweapons synthesis route freely available through an API.
The Commerce Department appears to have treated a commercial safety incident the way it would treat a weapons system vulnerability. Those are different things. Conflating them produces policy that does real harm to real users, without meaningfully reducing the actual risk, because the underlying capability is available through other means.
## What This Means If You Build on AI APIs
The practical lesson is blunt: the ground can shift overnight. Seventy-two hours after launch, with no warning, every customer lost access to two models simultaneously. If your product depends on a specific model from a single provider, you have a single point of failure that your infrastructure runbooks do not cover.
This is not unique to Anthropic. Any sufficiently advanced closed model is a candidate for export controls under the logic the administration applied here. The more capable the model, the more it looks like a national security asset.
For teams building on AI APIs, the architecture question is not just "which model is best?" anymore. It is "what is our fallback if this model becomes unavailable?" The answer increasingly points toward model-agnostic abstraction layers, multi-provider routing, and at least some capacity to run open-weight models locally when the API goes dark.
The irony is that the government's action accelerated exactly the behavior it was trying to prevent: driving sophisticated users toward open-weight alternatives that nobody can export-control.
## Where This Goes
The administration says the lockdown could lift "in the next few weeks" once the national security apparatus is hardened. Anthropic says it is a misunderstanding and is working to restore access. Both of those statements might be true.
But the precedent is set. The US government has demonstrated that it will treat advanced AI models as export-controlled technology, that a single jailbreak claim is sufficient to trigger action, and that commercial impact on millions of users is not a blocking consideration.
If you think that precedent stays limited to Anthropic, or stays limited to the current administration, I would not bet on it.
---
*Source: [Axios, Scoop: Trump admin blocks foreign access to Anthropic's most powerful AI](https://www.axios.com/2026/06/12/anthropic-trump-mythos-fable-national-security)*
---
# Twenty-Five Open-Weight Models in One Week. A Practitioner's Breakdown.
> More than 25 open-weight model releases dropped last week across every modality. A breakdown of what each one does, which ones are actually deployable, and what the week means for infrastructure teams.
- URL: https://ashkmb.com/blog/open-weight-ai-june-2026/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-13
- Language: en
There is a phrase that has been floating around AI circles this week: "open AI, notice the space." A deliberate dig at the increasingly closed posture of OpenAI the company, and a nod to the fact that the most interesting action in AI right now is happening in the open-weight space.
Last week delivered more than 25 notable open-weight releases across text, image, audio, video, and 3D generation. That is not a normal week. Before going deep, here is the short version for practitioners who want the bottom line first.
## Quick Picks
| Use case | Model | Why |
|---|---|---|
| On-device / Apple Silicon | Liquid AI LFM2.5-8B | 1.5B active params, MLX-ready |
| Deployable multimodal | Google Gemma 4 12B | One checkpoint, ONNX + MLX, 140+ languages |
| Frontier reasoning (cloud) | NVIDIA Nemotron 3 Ultra | 89.1 [MMLU](https://en.wikipedia.org/wiki/MMLU), 1M context, 55B active |
| Coding agents | JetBrains Mellum2-12B | Built for IDE workflows, 2.5B active |
| Text-in-image / design | Ideogram 4 | #1 open-weight on Design Arena |
| Real-time TTS | Higgs Boson Health Audio v3 | Sub-second first audio, 21 emotions |
| Artifact-free TTS | rednote dots.tts | Codec-free, continuous waveform |
| Speech-to-text at scale | NVIDIA Nemotron-3.5 ASR | 17x concurrency vs Parakeet [RNNT](https://en.wikipedia.org/wiki/Recurrent_neural_network) |
| Document parsing | PaddleOCR-VL-1.6 | State-of-the-art at 1B params |
| Audio-visual generation | Baidu NAVA | Best A/V sync in open weights |
| Long-form video | JD JoyAI-Echo | Up to 5 minutes, multi-shot |
| Image to 3D | VAST TripoSplat | MIT license, Gaussian splatting |
| Robotics simulation | NVIDIA Cosmos3-Super | Physical AI, action-conditioned video |
---
## Language Models
**NVIDIA Nemotron 3 Ultra (550B)**
The headline number is 550 billion parameters, but the more interesting number is 55 billion: the active parameter count at inference time. Nemotron Ultra uses a hybrid Mamba-[MoE](https://en.wikipedia.org/wiki/Mixture_of_experts) architecture, combining recurrent state-space models (Mamba) with Mixture-of-Experts routing. Instead of activating all parameters for every token, MoE routes each token through a small subset of specialist sub-networks, keeping inference cost proportional to active params, not total params.
The 1 million token context window puts it in the same league as Gemini 1.5 Pro for long-document tasks. At 89.1 on [MMLU](https://en.wikipedia.org/wiki/MMLU) it sits comfortably in frontier territory. The [NVFP4](https://en.wikipedia.org/wiki/Minifloat) variant uses a 4-bit floating point format where numbers are grouped into blocks with a shared scaling factor, recovering dynamic range while keeping memory footprint small. NVIDIA claims 5x throughput on Blackwell compared to standard FP16. For teams already running Blackwell clusters, this is worth serious evaluation. For everyone else, the 550B weight size means a multi-node setup regardless.
**Google Gemma 4 12B**
Gemma 4 is the most practically deployable model of the week. It handles text, image, audio, and video in a single encoder-free architecture, supports 256k context, and covers 140+ languages. The [AIME](https://en.wikipedia.org/wiki/American_Invitational_Mathematics_Examination) 2026 score of 77.5 puts it above most models twice its size on mathematical reasoning.
What sets it apart operationally is the 23-checkpoint [QAT](https://en.wikipedia.org/wiki/Quantization_(signal_processing)) wave. Quantization-Aware Training means the model was trained with quantization in mind from the start, rather than shrunk post-hoc. Google shipped [ONNX](https://en.wikipedia.org/wiki/Open_Neural_Network_Exchange) and MLX variants simultaneously, meaning you can run it on mobile or Apple Silicon without a separate quantization step. If you need a single model that works across web, mobile, and server without maintaining multiple checkpoints, this is the obvious pick this week.
**Liquid AI LFM2.5-8B**
Liquid Foundation Models use a recurrent architecture rather than the standard Transformer. The LFM2.5-8B has 8B total parameters but only 1.5B active at inference, with 128k context. MATH500 at 88.8 is strong for an on-device model. MLX-ready out of the box, meaning it runs natively on Apple Silicon using Apple's own ML framework.
This is the pick for anything that needs to run locally without cloud round-trips. The active parameter count fits comfortably in the unified memory of an M-series chip.
**JetBrains Mellum2-12B**
JetBrains' first open [MoE](https://en.wikipedia.org/wiki/Mixture_of_experts) model. 12B total parameters, 2.5B active, with a reasoning mode ("Thinking") that closes the gap with Qwen3-14B on coding benchmarks. Apache 2.0 license. Given that JetBrains built this specifically for IDE integration and code completion, it is worth testing in coding agent workflows where latency matters more than peak benchmark scores.
## Image Generation
**Ideogram 4 (9.3B)**
Ideogram releasing open weights is the surprise of the week. This is a 9.3B parameter flow-matching Diffusion Transformer trained from scratch, not a fine-tune of an existing checkpoint. A Diffusion Transformer (DiT) replaces the UNet backbone of classic diffusion models with a Transformer, giving it better scaling properties. Flow-matching is the training objective, a more stable alternative to the denoising score matching used in older diffusion models.
It ranks second overall on design benchmarks behind GPT Image 2, and first among open-weight models on both Design Arena and LMArena. Its specific strength is text rendering inside images: logos, typography, posters, anywhere the text needs to be legible and correctly spelled. This has historically been the hardest problem for diffusion models to get right. Getting access to the weights changes what is possible for teams building design tooling.
## Audio and Speech
Four labs shipped audio models this week, which is unusual.
**Higgs Boson Health Audio v3 (4B)**: 102 languages, 21 distinct emotional styles including singing, whispering, and shouting. Sub-second Time to First Audio makes it viable for real-time applications. The emotional range here goes well beyond what most open [TTS](https://en.wikipedia.org/wiki/Speech_synthesis) models offer.
**rednote dots.tts**: The architecturally interesting one. Most TTS systems convert text to discrete audio tokens via a neural codec, then synthesize audio from those tokens. dots.tts removes the codec entirely, generating waveforms in a fully continuous space. Apache 2.0. The practical benefit is fewer artifacts and better prosody in edge cases that confuse codec-based systems, particularly unusual pronunciations and emotional transitions.
**Google Magenta RealTime 2**: Music generation with under 200ms latency, accepting text, audio, and [MIDI](https://en.wikipedia.org/wiki/MIDI) as input. The latency number makes it viable for live performance tools where a human musician is in the loop. It was ported to PyTorch and running on ZeroGPU demos within hours of release.
**NVIDIA Nemotron-3.5 ASR (600M)**: A streaming [ASR](https://en.wikipedia.org/wiki/Speech_recognition) model that handles 17x more concurrent streams than Parakeet [RNNT](https://en.wikipedia.org/wiki/Recurrent_neural_network) 1.1B at comparable accuracy. RNNT (Recurrent Neural Network Transducer) is an architecture that combines an encoder, prediction network, and joint network to enable streaming transcription without requiring the full audio sequence upfront. For teams running speech recognition at scale, that 17x concurrency multiplier translates directly to infrastructure cost per audio hour processed.
## Vision and Multimodal
**StepFun Step-3.7-Flash**: 198B sparse [MoE](https://en.wikipedia.org/wiki/Mixture_of_experts) VLM with around 11B active parameters. The SWE-Bench PRO score of 56.3 is notable for a vision-language model; software engineering benchmarks are usually dominated by text-only models. Apache 2.0.
**PaddleOCR-VL-1.6**: Document parsing at 1B parameters. Most document understanding models require much larger checkpoints to handle complex layouts, tables, and mixed text/image content reliably. At 1B it is deployable on hardware that would struggle with heavier VLMs, which matters for enterprise environments with strict hardware constraints.
**Baidu NAVA (6.3B)**: Joint audio-video generation with best-in-class audio-visual synchronization. Generating video where mouth movements match audio, or where ambient sound matches scene content, has been a persistent weakness in open-weight video models. NAVA addresses the sync problem at the model level rather than as a post-processing step. Apache 2.0.
## Video, 3D, and World Models
**NVIDIA Cosmos3-Super (64B)**: An omnimodal world model for Physical AI. The use case is robotics and autonomous systems, not content generation. It couples action trajectories with video and audio generation, letting you condition outputs on "what would happen if the robot arm moved this way." The target audience is simulation environments for robot training, where you need photorealistic rollouts of hypothetical actions at scale.
**JD JoyAI-Echo**: Text-to-video up to 5 minutes long, built on LTX-2.3. Five minutes of coherent multi-shot video from text is a meaningful capability jump; most open models cap out at 10-15 seconds. Multi-shot means the model maintains scene and character consistency across cuts, which is the harder problem.
**ByteDance Bernini-R + VAST TripoSplat**: Single-image-to-3D generation using Gaussian splatting, under [MIT license](https://en.wikipedia.org/wiki/MIT_License). Gaussian splatting represents a 3D scene as a collection of semi-transparent ellipsoids, each with a color and opacity, rather than a traditional mesh or voxel grid. It is fast to render and produces photorealistic novel views from any angle. MIT license means usable in commercial products without restriction.
## What This Week Actually Means
The pattern across all of these releases is compression. Models that required frontier-scale infrastructure six months ago now run on laptops. The gap between what is possible with a closed API and what is possible with local weights is narrowing faster than most people expected.
The more interesting question is what happens to the deployment layer. Running a single model endpoint is straightforward. Running a heterogeneous fleet where different requests route to different specialized models (LFM2.5 for on-device, Nemotron Ultra for complex reasoning, Ideogram 4 for design tasks) requires actual infrastructure thinking: routing logic, fallbacks, cost monitoring, latency SLOs per model type.
That is the part that does not ship in a LinkedIn post. It is also the part that will matter most over the next twelve months.
---
# GitLab Is Rebuilding Its Core for the Agentic Era. The Timing Is Right.
> AI coding tools don't just write code faster. They generate dramatically more Git activity, pipeline runs, and context overhead than humans do. GitLab's Transcend 2026 announcements finally address that.
- URL: https://ashkmb.com/blog/gitlab-transcend-2026-agentic-platform/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-11
- Language: en
There is a problem building quietly in every engineering org that has adopted AI coding tools. It is not a quality problem, though quality is certainly a conversation. It is a volume problem. AI agents don't just write code faster than humans. They create dramatically more Git activity, pipeline runs, review cycles, and context overhead than any human developer on the team. The infrastructure that was designed around human commit cadences is starting to buckle.
GitLab's Transcend 2026 conference this week was, at its core, a response to this problem. Across four major announcements, GitLab is making a coherent bet that the DevOps platform has to be redesigned from the ground up, not just patched, to handle the throughput and context demands of agentic workflows.
## Rethinking Git at the Core
The most technically ambitious announcement is what GitLab calls Next Generation Source Code Management. This is a re-implementation of the Git protocol built on a distributed architecture rather than the traditional centralized model. The headline number is that AI agents can complete tasks 50 times faster.
That number needs context. The performance gain is not about Git's data model; it is about eliminating the bottleneck that occurs when large numbers of concurrent AI agents all hit the same server-side operations simultaneously. GitLab's implementation limits server-side queries to only what the current task actually requires, rather than loading the full context by default. The result is that agentic workflows that would have created queue storms under the old model can now execute in parallel without degrading each other.
This is the right problem to solve. When you start running multiple AI coding agents in parallel, even on medium-sized repos, the overhead shows up in places you wouldn't expect.
## Context as Infrastructure
The second piece is GitLab Orbit, now in public beta. Orbit is a context graph: a structured representation of code, work items, pipelines, deployments, and production signals that AI tools can query directly.
The rationale is straightforward. The biggest cost in agentic AI workflows today is not compute; it is tokens. Every time an agent needs context, it either loads too much (expensive and slow) or too little (and makes errors). Orbit is GitLab's attempt to solve this at the platform level rather than leaving each team to build their own context engineering layer.
GitLab claims 11 times faster responses and up to 4.5 times fewer tokens per query. Even if the real-world numbers are half that, the value proposition holds. Getting context retrieval right at the platform level has compounding returns: every agent that runs on top of it benefits, and you stop solving the same problem in seventeen different repos.
## Governance Where It Actually Belongs
The announcement I find most important is the AI Governance framework, currently in private beta. Every agent action gets an identity, a policy path, and an audit record. DevSecOps teams get real-time visibility into agent inputs, reasoning, and tool calls. Policies like mandatory code scans can be applied across the entire agentic workflow.
Right now, most teams running AI agents are essentially doing so on trust. The agent runs, the code appears, and if you're lucky someone reviews it before it hits the pipeline. That is not a sustainable model as agentic code generation scales up. The question of who authorized what, and what the agent actually did to get there, is not currently answerable in most platforms.
GitLab is making that question answerable. That shifts the platform from a build-and-deploy system to something closer to what security and compliance teams actually need: a system of record for automated action.
## Pricing That Matches the New Reality
The fourth announcement, GitLab Flex, is the least technical but addresses a real friction point. Flex combines seats and AI credits into a single annual commitment, and allows teams to shift spend between the two as usage patterns change, without renegotiating contracts.
This is less of a technical innovation and more of a recognition that the old seat-based licensing model doesn't fit how teams are actually buying and consuming AI capabilities. If your team's AI usage spikes during a large feature push and then drops back, you shouldn't have to forecast that six months in advance.
## The Bigger Picture
What strikes me about the Transcend announcements collectively is that they are not driven by a single capability addition. They are a coherent re-architecture of the DevOps platform for a workflow where the majority of commits, PRs, and pipeline runs are initiated by agents rather than humans.
That is a different design brief than the one GitLab was originally built against. Humans commit code a few times a day. Agents can do it hundreds or thousands of times. Humans read documentation to get context. Agents consume tokens at cost. Humans understand implicitly what they are authorized to do. Agents need that spelled out in policy.
The platforms that survive the agentic era will be the ones that redesign around these new constraints rather than treating AI coding as just another feature layer on top of the existing pipeline. GitLab is betting it can be one of them. Based on what they showed at Transcend, the bet looks credible.
---
# Generalist vs Specialist in the Agentic AI Era
> For years the advice was clear: pick a lane, go deep, become indispensable. Then AI agents arrived and quietly rewrote the rules.
- URL: https://ashkmb.com/blog/generalist-vs-specialist-agentic-ai-era/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-06-07
- Language: en
For most of the last decade the career advice in tech was remarkably consistent: become a specialist. Pick something hard, go deep, and own it. The advice was not wrong; it was a rational response to the market as it existed.
## The Old Equation
Five or six years ago, when I was helping colleagues find their footing in the industry, the guidance was roughly the same regardless of which team or company you were joining. Learn the fundamentals (data structures, networking, systems design, distributed computing basics) and then choose a domain and commit. Kubernetes, Splunk, Spark, Terraform, whatever pulled you in. The fundamentals were the floor. The specialization was the ceiling, and the ceiling is what got you paid and made you hard to replace.
The logic held up under scrutiny. A specialist brought something no one else on the team had in the same depth. When the cluster started behaving strangely at 2 AM, you called the Kubernetes person. When the SIEM alert fired and no one could decode the query, you called the Splunk person. That depth of knowledge created leverage for both the individual and the team around them. People relied on you not just for answers but for the framing of the problem itself.
The generalist argument was never without merit. Wide knowledge creates connective tissue. A generalist can bridge between domains, spot patterns across systems, and unstick conversations that have deadlocked because two specialists are talking past each other. Generalists also tend to adapt faster when the technology shifts, and in tech, it always shifts.
But when you ran the full pros-and-cons matrix, the specialist usually came out ahead. Depth was defensible. Breadth felt, in a market increasingly crowded with capable people, like it could be replicated too easily. Anyone could read the same blog posts and tutorials. Not everyone could have spent three years in the trenches with the same platform.
I was in the specialist camp for a long time. I believed the argument, I gave the advice, and for most of the 2010s and early 2020s the data supported it.
Then the agentic era arrived.
## The Shift
The rise of large language models changed the calculus gradually, then all at once. Early LLMs were impressive curiosities. You could prompt them, get something plausible, and maybe use it as a starting point. But they were unreliable enough at the edges of a domain that you still needed the specialist to validate everything non-trivial.
What changed is the quality floor. Models like the Sonnet 4.x family or GPT-4o are not just "pretty good at a lot of things." They are, in many domains, deep enough to be genuinely relied upon for work that previously required a seasoned specialist. Ask a modern frontier model to write a Kubernetes admission webhook, explain a Byzantine consensus failure mode, or draft a Terraform module for cross-account VPC peering: the output is not a rough approximation. It is, increasingly, something a competent engineer would be proud to have written.
This is where the equation starts to creak. If a general-purpose AI agent can perform at near-specialist level across a wide range of domains (simultaneously, without fatigue, at the cost of a few cents per request), what is the structural advantage of human specialization?
The honest answer is that the advantage narrows. Not to zero, but it narrows.
There is a second layer to this that is easy to miss. These models are not just competent in isolation. When you invest in context engineering (carefully constructed system prompts, well-scoped task definitions, curated memory and tool access) the effective quality of their output increases substantially. A well-orchestrated AI agent working with good context can produce output that exceeds what an average domain specialist would produce without that scaffolding. That is not a hypothetical. It is observable today.
## A New Role Emerges
Something interesting is happening at the intersection of all this. A new kind of engineering role is quietly taking shape in the market: the Agentic AI Engineer.
This is not a prompt engineer, though prompt engineering is part of the skill set. It is not an ML engineer in the traditional sense; you are not training models or tuning hyperparameters. It is not a software engineer in the classic sense either, though you write a lot of code.
The Agentic AI Engineer designs, builds, and operates systems where AI agents are first-class components. They decide how agents are orchestrated, what tools they have access to, how memory and context are managed, how the human review layer is structured, and how failures are detected and recovered from. They understand the behavioral properties of LLMs well enough to design around them: knowing when to trust model output, when to add a validation step, when to break a task into smaller chunks, and when to bring a human back into the loop.
This role requires knowing enough about a wide range of domains to design agents that work across them. You might be building an agent that handles infrastructure provisioning, then one that handles code review, then one that handles security auditing. Each of those domains has enough depth that a pure generalist would miss important failure modes. But no single specialist could hold all three.
So the question becomes: for this specific role, what is the right shape of knowledge?
## The New Equation
My take is that the equation flips. Or more precisely, it rebalances.
For the Agentic AI Engineer, a wide base of domain knowledge is more valuable than extreme depth in a single area. You need enough understanding of Kubernetes to know when an agent's infrastructure recommendation is plausible vs dangerous. Enough understanding of security primitives to know when the agent's proposed IAM policy is too permissive. Enough understanding of data systems to know when the agent is hallucinating a query optimization that does not exist.
You do not need to be the deepest person in any of those rooms. You need to be fluent enough to read the output critically and recognize when something is wrong.
This is a genuine reversal. The generalist's wide-but-shallow profile, which was a structural disadvantage in the old market, becomes a structural advantage when your primary job is to direct, evaluate, and take responsibility for the output of systems that themselves operate across many domains simultaneously.
The specialist's depth does not become worthless. Far from it. Complex, high-stakes domains will still benefit from true experts who can catch failure modes that neither a generalist engineer nor a general-purpose model would recognize. But the specialist who cannot work with or reason about AI-augmented systems will find their leverage shrinking. The depth needs to be paired with an understanding of how to amplify it through agents, not just apply it directly.
## An Open Debate with No Final Answer
It would be easy to end here with a clean verdict. But this is one of those debates that is more useful as an ongoing frame than as a closed question.
Both specialists and generalists are needed today. The mix and the balance will keep shifting as model capabilities improve, as agentic tooling matures, and as teams develop sharper intuitions about where human judgment is irreplaceable and where it is a bottleneck. The opportunist take (that AI makes all human expertise obsolete and the only skill that matters now is prompting) is not a serious position. It is content, not analysis.
Here is something I believe firmly, and it is worth saying plainly: even when an AI agent writes a piece of code that is elegant, correct, and well-tested, there should be a human reviewing it before it goes anywhere near production. Not because the agent is likely to be wrong about the obvious things (it usually is not), but because the agent has no stake in the outcome, no understanding of what the code actually runs, and no ability to catch the classes of error that only appear when you hold the full context in your head and ask whether this thing should exist at all.
The agent is a powerful collaborator. It is not yet a responsible one.
We will write about that distinction in more depth, specifically about hallucinations and the risks of unsupervised agentic systems, in a future post. The topic deserves its own space.
For now: if you are a specialist wondering whether to broaden, the answer is probably yes, and the direction is toward understanding how to work with and reason about AI systems. If you are a generalist who was told for years that breadth was a liability, you may find the next few years more favorable than the last ten. The shape of the advantage has changed. The need for human judgment has not.
---
# Running Hermes Agent on EKS: from docker-compose to Helm
> Nous Research's self-improving AI agent running in a production-grade EKS setup. Private ECR, IRSA, API key secrets, and a custom Helm chart built from scratch.
- URL: https://ashkmb.com/blog/hermes-agent-eks-deployment/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-05-31
- Updated: 2026-11-20
- Language: en
> **Update, November 2026:** for a multi-user setup, with one isolated agent per person behind HTTPS, see the tutorial [Multi-user Hermes Agent on Kubernetes](https://ashkmb.com/tutorials/multi-user-hermes-agent-kubernetes/).
During a two-day internal workshop we set out to evaluate [Hermes Agent](https://github.com/NousResearch/hermes-agent) as a self-hosted AI agent platform. What started as a quick docker-compose spin-up ended with a custom Helm chart, an ECR-backed deployment on EKS, and some genuine appreciation for how much thought Nous Research have put into the agent loop design. Here is the full arc from local container to production-ish Kubernetes.
## What is Hermes?
Hermes is an open-source AI agent framework developed by [Nous Research](https://nousresearch.com), an independent AI research organization. The headline feature is a **closed learning loop**: the agent creates skills from experience, refines them during subsequent use, maintains a persistent memory of who you are across sessions, and searches its own past conversations to recall relevant context. It is not tied to a specific model. Point it at OpenRouter, AWS Bedrock, or any OpenAI-compatible endpoint and swap models on the fly with `hermes model`.
Something worth clarifying upfront, because the "self-improving" framing tends to trigger a mental model of reinforcement learning: Hermes does **not** fine-tune or retrain the underlying model. There is no gradient update happening anywhere. The improvement is entirely at the **context engineering layer**: skills are stored as structured prompts, memory is curated text that gets injected into the system context, and user profiles accumulate facts that shape how the agent frames responses. You could describe it as a semi-supervised inference approach: a human is still in the loop validating and pruning what persists, but the agent nudges itself to save useful things and improves its own skill definitions over time. The intelligence comes from the model; the continuity and growth come from what you put in front of it.
Architecturally, Hermes runs as two processes:
- **Gateway**: the main agent loop plus an optional OpenAI-compatible API server on port 8642. This is where conversations happen, tools run, skills execute, and the messaging bridge (Telegram, Slack, Discord, etc.) connects.
- **Dashboard**: a web UI on port 9119 for browsing conversations, managing skills and memory, and monitoring the agent.
Both processes share the same `HERMES_HOME` directory (`~/.hermes` locally, `/opt/data` in containers).
## Step 1: getting it running locally with docker-compose
The upstream repository ships a `docker-compose.yml` that covers the two-service setup cleanly. A few things are immediately worth noting.
```yaml
services:
gateway:
build: .
image: hermes-agent
container_name: hermes
restart: unless-stopped
network_mode: host
volumes:
- ~/.hermes:/opt/data
environment:
- HERMES_UID=${HERMES_UID:-10000}
- HERMES_GID=${HERMES_GID:-10000}
# Uncomment both to expose the API server:
# - API_SERVER_HOST=0.0.0.0
# - API_SERVER_KEY=${API_SERVER_KEY}
command: ["gateway", "run"]
dashboard:
image: hermes-agent
container_name: hermes-dashboard
restart: unless-stopped
network_mode: host
depends_on:
- gateway
volumes:
- ~/.hermes:/opt/data
environment:
- HERMES_UID=${HERMES_UID:-10000}
- HERMES_GID=${HERMES_GID:-10000}
command: ["dashboard", "--host", "127.0.0.1", "--no-open"]
```
The `HERMES_UID` / `HERMES_GID` pattern is handled by an `s6-overlay` init stage inside the image: the container starts as root, remaps the internal `hermes` user to match your host UID via `gosu/usermod`, then drops privileges before any supervised service starts. This keeps files created under `/opt/data` readable by your host user without needing `chown` gymnastics.
`network_mode: host` on a developer laptop is intentional. The gateway and dashboard talk to each other via localhost, and the host user gets direct access on familiar ports without any port-mapping boilerplate.
The dashboard intentionally binds to `127.0.0.1` by default. The upstream comments spell out why: the dashboard stores API keys and has no authentication layer. If you want remote access, the right move is an SSH tunnel (`ssh -L 9119:localhost:9119`), not opening it on `0.0.0.0` on a shared network.
The quickest start:
```bash
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose up -d
```
Then open `http://localhost:9119` for the dashboard and, once you run `hermes model` to pick a provider, start a conversation via the CLI or the dashboard chat pane.
## Step 2: building the image and pushing to ECR
For the EKS deployment we needed the image in our private ECR registry rather than built locally.
```bash
# Authenticate to ECR
aws ecr get-login-password --region eu-central-1 \
| docker login --username AWS --password-stdin \
.dkr.ecr.eu-central-1.amazonaws.com
# Build from the upstream Dockerfile
docker build -t hermes-agent .
# Tag and push
docker tag hermes-agent \
.dkr.ecr.eu-central-1.amazonaws.com/hermes-agent:latest
docker push \
.dkr.ecr.eu-central-1.amazonaws.com/hermes-agent:latest
```
The upstream `Dockerfile` uses a multi-stage build: a build stage installs Python dependencies with `uv`, and a runtime stage packages the agent on top of a slim base with s6-overlay already baked in. The image is self-contained (no side-car, no external init system to wire up).
In the Kubernetes manifests below, `imagePullPolicy: Always` ensures each pod restart pulls the freshest `:latest`. In a real pipeline you would tag by commit SHA and control rollouts that way; for a PoC, `latest` is fine.
## Step 3: the Kubernetes manifest
Here is the raw manifest we converged on. Walk through each section:
### Namespace and Secret
```yaml
apiVersion: v1
kind: Namespace
metadata:
name: hermes-agent
---
apiVersion: v1
kind: Secret
metadata:
name: hermes-secrets
namespace: hermes-agent
type: Opaque
data:
API_SERVER_KEY: ""
```
The `API_SERVER_KEY` authenticates requests to the gateway's OpenAI-compatible API server. Generate one before applying the manifest:
```bash
kubectl create secret generic hermes-secrets \
--from-literal=API_SERVER_KEY="$(openssl rand -hex 32)" \
-n hermes-agent --dry-run=client -o yaml | kubectl apply -f -
```
Never commit a real key into the YAML file. The placeholder in the manifest above is a reminder to replace it. Better yet, manage the secret out-of-band with something like External Secrets Operator feeding from your secrets manager.
### Persistent Volumes
```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hermes-data-gateway
namespace: hermes-agent
spec:
accessModes:
- ReadWriteOnce
storageClassName: gp3
resources:
requests:
storage: 10Gi
```
Both the gateway and the dashboard get their own PVC. `ReadWriteOnce` maps to EBS GP3. A single node can mount it at a time, which is fine since each deployment runs one replica. If you scale the gateway horizontally you would need `ReadWriteMany` (EFS), but for an agent that maintains conversational state a single replica is the sensible default anyway.
### ServiceAccount with IRSA
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: hermes-agent
namespace: hermes-agent
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam:::role/hermes-agent-role
```
The `eks.amazonaws.com/role-arn` annotation is the entry point for **IRSA (IAM Roles for Service Accounts)**. If your cluster has the Pod Identity Agent or OIDC provider configured, any pod that uses this ServiceAccount automatically gets short-lived credentials scoped to `hermes-agent-role` injected into the container (no static AWS keys, no EC2 instance profile sharing).
In our case the IAM role grants `bedrock:InvokeModel` (and `bedrock:InvokeModelWithResponseStream`) on the models we wanted available. This lets the gateway call AWS Bedrock directly for inference, so no third-party API key is needed for the LLM provider. The agent's cloud identity handles authentication. If you are not on AWS or do not care about Bedrock you can remove the annotation entirely and pass provider keys as extra environment variables via the Secret.
### Gateway Deployment
The gateway deployment surfaces two environment variables that matter beyond the obvious ones:
```yaml
env:
- name: API_SERVER_HOST
value: "0.0.0.0"
- name: API_SERVER_KEY
valueFrom:
secretKeyRef:
name: hermes-secrets
key: API_SERVER_KEY
optional: true
```
`API_SERVER_HOST: "0.0.0.0"` opens the API server on all interfaces inside the pod so the Kubernetes Service (ClusterIP) can route traffic to it. On a developer laptop this would be a security concern; inside a pod with no external route, it just makes the service reachable within the cluster.
`API_SERVER_KEY` is pulled from the Secret so it never appears in the Deployment spec. `optional: true` means the pod starts even if the secret key is absent. Useful during initial bootstrapping, but in a real deployment you would remove `optional` once the secret is in place.
### Dashboard Deployment
```yaml
args: ["dashboard", "--host", "0.0.0.0", "--no-open", "--insecure"]
```
Three flags that each solve a different problem:
- `--host 0.0.0.0`: same reasoning as the gateway: the ClusterIP Service cannot reach the dashboard if it only listens on loopback.
- `--no-open`: suppresses the "open browser on start" behaviour that makes sense on a developer laptop but would fail silently (or noisily) inside a headless container.
- `--insecure`: this is the important one. The dashboard's built-in HTTP server enforces that requests arrive on a specific FQDN by default; without `--insecure`, any request coming from the ALB (with a different `Host` header or internal routing path) gets rejected. In a container behind a load balancer, `--insecure` is not a security regression. TLS termination and access control happen at the ALB layer.
### Services and Ingress
Both deployments get ClusterIP Services. The interesting piece is the Ingress:
```yaml
rules:
- host: hermes.internal.your-domain.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hermes-dashboard
port:
name: http
- path: /api/
pathType: Prefix
backend:
service:
name: hermes-gateway
port:
name: api
- path: /v1/
pathType: Prefix
backend:
service:
name: hermes-gateway
port:
name: api
```
`/` routes to the dashboard; `/api/` and `/v1/` route to the gateway. The `/v1/` prefix is the OpenAI-compatible endpoint, so tooling that speaks the OpenAI chat completions API can point at `https://hermes.internal.your-domain.com/v1/` and use Hermes as a drop-in provider.
The Ingress is marked `alb.ingress.kubernetes.io/scheme: internal` and placed in an `internal` ALB group; it is never exposed on the public internet. SSL redirect is enforced at the ALB layer with a TLS 1.2+ policy.
## A note on model choice and cost
For the workshop we used Claude Sonnet 4.6 (via AWS Bedrock) rather than Opus. The reasoning is straightforward: Opus is roughly 5× more expensive per token than Sonnet, and for the tasks we threw at Hermes (code review, writing scripts, answering questions about internal documentation) Sonnet handled everything well. The longer the agent runs and the more tool calls it makes in a single session, the more token cost adds up; picking the right model tier for the actual task complexity matters.
Hermes makes this easy: `hermes model` lets you switch provider and model mid-session without losing context. We started some sessions on Sonnet and bumped to Opus only when we hit genuinely complex multi-step reasoning tasks. In practice, that happened maybe once in two days.
## Step 4: packaging it as a Helm chart
Once the raw manifest was stable, we extracted it into a Helm chart. The chart structure is minimal:
```
hermes/
├── Chart.yaml
├── values.yaml
└── templates/
├── _helpers.tpl
├── namespace.yaml
├── secret.yaml
├── pvc.yaml
├── serviceaccount.yaml
├── deployment-gateway.yaml
├── deployment-dashboard.yaml
├── service-gateway.yaml
├── service-dashboard.yaml
└── ingress.yaml
```
The `values.yaml` exposes the knobs you actually want to change across environments: image tag, resource requests/limits, storage size, IRSA role ARN, ingress host, and whether the namespace and secret are chart-managed or external. Everything in the manifest that was a hardcoded string becomes a template variable.
This matters because the ECR image URI, the IAM role ARN, the ACM certificate ARN, and the ingress hostname are all environment-specific. Without a chart you either maintain multiple copies of the manifest or do find-and-replace in CI. With a chart, a single `helm upgrade --install` with a per-environment values override is enough.
The `secret.create: false` option in values lets you tell the chart to skip managing the Secret, so you can use External Secrets Operator or Vault and inject the actual API key outside the chart's control. This is the pattern we'd use in production.
## Where we landed after two days
We got Hermes deployed, configured with a Bedrock-backed model, and ran through a handful of PoC scenarios: having the agent write and execute shell scripts, summarize internal documentation, and coordinate multi-step tasks via its subagent spawning capability. The learning loop worked as advertised. Skills we taught the agent on day one appeared in context on day two without explicit prompting.
What we did not get to explore: the full messaging gateway integration, the cron scheduler, the trajectory compression for training data generation, and deeper MCP server integrations. Hermes has surface area that a two-day workshop barely scratches.
I'll come back with a more thorough writeup once we have meaningful production usage data: how the skill accumulation holds up over weeks, whether the memory system needs active curation, and what the actual Bedrock cost profile looks like at scale. There is a lot here worth digging into properly.
The code for the Kubernetes manifest and Helm chart is sitting in our internal monorepo. If you are evaluating Hermes for your own infrastructure, the upstream docker-compose is the right starting point. Everything above is just what it took to make it production-grade in our specific environment.
---
# Three peerings, $10 a month: when VPC Peering beats Transit Gateway
> Transit Gateway is the default everyone reaches for. For a handful of VPCs in a single region, peering is dramatically cheaper, and here's the math.
- URL: https://ashkmb.com/blog/vpc-peering-vs-transit-gateway-cost/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-05-20
- Language: en
We run a small AWS Organization. One ops/internal account holds a handful of shared internal services. Three workload accounts (dev, staging, prod) each have their own VPC and need to reach those services. Single region, us-east-1, three AZs each. The AWS reference architectures all point at Transit Gateway. I priced it out against our actual traffic and went with VPC Peering instead. Here's the reasoning and the numbers.
## The problem
Four AWS accounts under one Organization:
- **ops-internal**: shared services VPC, `172.16.0.0/16`. Hosts a small set of internal tools: observability, secrets management, internal connectivity control plane. Three services in total.
- **dev**: `172.17.0.0/16`
- **staging**: `172.18.0.0/16`
- **prod**: `172.19.0.0/16`
The workload VPCs need to reach the ops VPC. They do *not* need to reach each other: dev shouldn't see prod, prod shouldn't see dev. Hub-and-spoke, ops VPC at the centre.
Constraints:
- Small team. Whatever I pick, I'm the one maintaining it.
- Single region, no expansion plans for at least a year.
- Cost-sensitive. We're a startup; every recurring line item on the AWS bill needs to justify itself.
- All four accounts already under AWS Organizations, so cross-account IAM is straightforward.
That's the setup. The interesting decision is the connectivity layer.
## The options I considered
| Option | What it is | Sweet spot | Cost model |
|---|---|---|---|
| **VPC Peering** | Direct 1:1 link between two VPCs | Few VPCs, no transitive routing | $0/hr, data transfer only |
| **Transit Gateway** | Regional router, hub-and-spoke | Many VPCs, transitive routing, central inspection | $0.05/hr per attachment + $0.02/GB |
| **Site-to-Site VPN** | IPSec tunnels | Hybrid (on-prem ↔ AWS) | $0.05/hr per connection + data out |
| **PrivateLink** | NLB-fronted service endpoints | Exposing specific services across accounts | $0.01/hr per endpoint per AZ + $0.01/GB |
| **VPC Lattice** | Application-layer service mesh | Many services, identity-aware auth | $0.025/hr per service + $0.025/GB |
| **Userspace overlay (Tailscale-style)** | WireGuard mesh on top of any underlay | App-layer connectivity for participating hosts | Free / self-hosted |
The overlay option is worth a separate note. A WireGuard mesh doesn't replace VPC peering; it sits on top of whatever underlay you have, and only hosts that join the mesh can use it. For machine-to-machine traffic between EC2 instances that don't run the agent (Prometheus scrapes, internal API calls), you still need VPC-level connectivity. Ruling it out as the *only* connectivity layer was easy: too many things would need to be mesh-aware.
Site-to-Site VPN is for hybrid (your data centre to AWS). Using it intra-AWS is overpriced and wrong-shaped: you'd pay for tunnels and customer-gateway operations to solve a problem AWS already solves with peering. I'm including it for completeness.
That leaves four serious contenders: Peering, TGW, PrivateLink, Lattice.
## Why I picked VPC Peering
Four VPCs in hub-and-spoke means **three peering connections**. That's it. The `n*(n-1)/2` scaling warning everyone repeats only bites when every VPC needs to talk to every other VPC. In hub-and-spoke with one hub, it's `n-1`.
Tradeoffs I knowingly accepted:
- **No transitive routing.** If dev ever needs to reach staging, I'd have to add a fourth peering or rethink. Today it doesn't, and today's problem is the only problem I'm solving.
- **Manual route table entries on both sides.** Both VPCs in a peering need explicit routes pointing at the `pcx-*` ID. Forget one side and you get a silent black-hole (more below).
- **CIDRs must not overlap.** I planned the address space up front (adjacent /16s under a /14 supernet), so this was a one-time cost.
- **No central egress, inspection, or firewall hop.** Acceptable for us; we don't have a SecOps team mandating a transit inspection point.
The thing that tipped it: at four VPCs, TGW's attachment fee alone runs ~$146/month before any data charge. Peering is $0/month at rest. The "TGW scales better" argument is true, but it's not free, and we're not at the scale where the operational simplicity is worth $146/month.
## The setup walkthrough
Three Terraform highlights. The pattern repeats for each spoke.
**Provider aliases for cross-account.** The peering connection lives on the requester (ops) side; the accepter resource lives on the workload side. Both need explicit providers. My first cut had the `aws_vpc_peering_connection_accepter` running under the requester provider by mistake. Terragrunt happily applied; the accepter never ran:
```hcl
provider "aws" {
alias = "ops"
region = "us-east-1"
assume_role { role_arn = "arn:aws:iam::${var.ops_account_id}:role/TerragruntExec" }
}
provider "aws" {
alias = "workload"
region = "us-east-1"
assume_role { role_arn = "arn:aws:iam::${var.workload_account_id}:role/TerragruntExec" }
}
```
**Requester side (ops account).** Don't set `peer_region` for same-region peerings; that argument is for inter-region only, and setting it switches AWS into cross-region mode (different pricing, different option-block rules). The `auto_accept` flag here only matters when both VPCs are in the same account; for cross-account you must declare a separate `aws_vpc_peering_connection_accepter` resource under the accepter's provider:
```hcl
resource "aws_vpc_peering_connection" "ops_to_workload" {
provider = aws.ops
vpc_id = aws_vpc.ops.id
peer_vpc_id = var.workload_vpc_id
peer_owner_id = var.workload_account_id
auto_accept = false
# no peer_region — same-region peering
tags = { Name = "ops-to-${var.workload_env}" }
}
```
**Accepter side (workload account):**
```hcl
resource "aws_vpc_peering_connection_accepter" "workload_from_ops" {
provider = aws.workload
vpc_peering_connection_id = aws_vpc_peering_connection.ops_to_workload.id
auto_accept = true
tags = { Name = "from-ops" }
}
```
**Route table entries, both sides:**
```hcl
resource "aws_route" "ops_to_workload" {
provider = aws.ops
route_table_id = aws_route_table.ops_private.id
destination_cidr_block = var.workload_vpc_cidr
vpc_peering_connection_id = aws_vpc_peering_connection.ops_to_workload.id
}
resource "aws_route" "workload_to_ops" {
provider = aws.workload
route_table_id = var.workload_private_rt_id
destination_cidr_block = aws_vpc.ops.cidr_block
vpc_peering_connection_id = aws_vpc_peering_connection.ops_to_workload.id
}
```
**The gotcha that ate 30 minutes of my life.** First peering went `ACTIVE`. Security groups were configured. Traffic black-holed. No error, no ICMP unreachable, just silent packet drops. I'd forgotten the route table entry on the *accepter* side. The state of the peering and the state of routing are independent; AWS will happily report the peering healthy while none of the actual traffic has anywhere to go.
Second gotcha: DNS. Internal hostnames resolved to public IPs from the workload accounts until I enabled remote DNS resolution. For cross-account peerings the option has to be set from *each* side's account; the requester can't set the accepter-side flag and vice versa. That means two separate resources, each under the right provider, each referencing the right peering ID (the accepter resource references the accepter's id, not the requester's):
```hcl
resource "aws_vpc_peering_connection_options" "requester" {
provider = aws.ops
vpc_peering_connection_id = aws_vpc_peering_connection.ops_to_workload.id
requester { allow_remote_vpc_dns_resolution = true }
}
resource "aws_vpc_peering_connection_options" "accepter" {
provider = aws.workload
vpc_peering_connection_id = aws_vpc_peering_connection_accepter.workload_from_ops.id
accepter { allow_remote_vpc_dns_resolution = true }
}
```
In hindsight, I should have built a `peering-pair` module on day one: requester, accepter, both route entries, both DNS option blocks, all behind one set of inputs. I inlined the first because "it's just one peering," copy-pasted for the second and third, and now I'm three peerings in with the duplication still sitting there. Refactoring would mean a state-move dance I haven't prioritised. Classic.
## Cost comparison with real numbers
Scenario: **3 workload VPCs ↔ 1 shared services VPC, us-east-1, ~500 GB/month cross-VPC traffic, 3 AZs.** All prices link to AWS pricing pages so you can re-derive when (not if) they change.
**VPC Peering.** $0/hr for the connection itself. Data transfer is the only line item. AWS bills cross-AZ transfer twice: $0.01/GB on the sender's account (out) plus $0.01/GB on the receiver's account (in), so $0.02/GB combined per GB transferred. At ~500 GB/month across all three peerings: **~$10/month**. Lower if you pin services to AZs, but I'll keep the worst case. ([VPC pricing](https://aws.amazon.com/vpc/pricing/))
**Transit Gateway.** 4 attachments × $0.05/hr × 730 hr = $146/month for attachments alone. Plus $0.02/GB processed × 500 GB = $10. **~$156/month** before anything else. The same ~$10 cross-AZ data transfer applies to TGW too; the real differential is the $146/month in attachment fees, not the data layer. ([TGW pricing](https://aws.amazon.com/transit-gateway/pricing/))
**Site-to-Site VPN.** $0.05/hr per connection × 730 hr × 3 connections = $109.50/month, plus data transfer out and the operational burden of customer gateways. **~$110/month** and the wrong tool for intra-AWS. ([VPN pricing](https://aws.amazon.com/vpn/pricing/))
**PrivateLink.** Per-endpoint pricing escalates fast at multiple services. Three services × 3 AZs × $0.01/hr × 730 = $65.70/month per consumer VPC. Three workload VPCs consuming = $197/month for endpoints alone, plus $0.01/GB × 500 GB = $5. **~$202/month**. ([PrivateLink pricing](https://aws.amazon.com/privatelink/pricing/))
**VPC Lattice.** $0.025/hr per service × 3 services × 730 = $54.75/month, plus $0.025/GB × 500 GB = $12.50. **~$67/month**. ([Lattice pricing](https://aws.amazon.com/vpc/lattice/pricing/))
| Option | Monthly cost (this scenario) |
|---|---|
| **VPC Peering** | **~$10** |
| VPC Lattice | ~$67 |
| Site-to-Site VPN | ~$110 |
| Transit Gateway | ~$156 |
| PrivateLink | ~$202 |
**Break-even with TGW.** Data-transfer per GB is roughly the same either way (~$0.02/GB). The decision swings entirely on the attachment fee vs. the operational pain of `n-1` peerings (hub-and-spoke) or `n*(n-1)/2` (full mesh). My rule of thumb: **above ~5 hub-and-spoke VPCs, or any full-mesh requirement, switch to TGW.** Below that, peering wins on cost by an order of magnitude and the operational delta is "two more route table entries."
## When you should NOT use peering
- **More than ~5 VPCs.** The `n*(n-1)/2` curve makes management painful even in a hub-and-spoke if any spoke needs to reach another spoke.
- **Transitive routing.** Peerings don't transit. If A↔B and B↔C, A still can't reach C without A↔C. TGW solves this natively.
- **Frequent CIDR changes.** Every change is a coordination event across accounts.
- **Central egress or inspection.** If compliance requires an inspection VPC or central NAT, you need TGW or a transit VPC pattern.
- **Cross-region at scale.** Inter-region peering works, but data costs and operational overhead climb fast. TGW peering across regions is the better shape.
- **Service-level access control instead of network-level.** That's PrivateLink or Lattice territory.
## Takeaways
- Default-to-TGW is a cargo-cult choice for small teams. The AWS reference architectures are written for enterprises with dozens of accounts and dedicated network teams. You are (probably) not them.
- The "peering doesn't scale" warning is real but mis-stated. It doesn't scale past ~5 VPCs in a full mesh. At 4 VPCs in hub-and-spoke, it's three connections: boring, cheap, done.
- Always compute connectivity cost on your actual traffic profile. The break-even point is dominated by attachment hours, not data, and AWS's calculator defaults will steer you toward TGW even when you'd save $140/month with peering.
- Build the peering-pair as a reusable Terraform module on day one. Don't inline the first one because "it's just one." I did, and I'm still paying for it in copy-paste.
- The silent failure modes are the real cost. Peering plus missing route table entries plus missing DNS option flags will burn an afternoon. Capture those in the module and never think about them again.
---
# I Vibe-Coded a Full-Stack Proxmox Dashboard: Here's What Actually Matters
> I built a full-stack Proxmox dashboard through vibe coding with Claude Code: 11K lines, 123 tests, 14 commits. Here's what the experience taught me about what actually matters in software engineering.
- URL: https://ashkmb.com/blog/vibe-coded-proxmox-dashboard/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2026-04-11
- Language: en
## 14 Commits, 11K Lines, One AI Agent
A few weeks ago I shipped [PVE Pilot](https://github.com/ashkmb/pve-pilot), a full-stack Proxmox VE management dashboard with a Go/Gin backend, a Next.js 16 frontend, and a NATS message queue for async provisioning. It has 123 tests. The entire thing was built through "vibe coding" with Claude Code, Anthropic's CLI agent.
I want to be precise about what that means, because the term "vibe coding" carries a lot of baggage. I didn't type "build me a Proxmox dashboard" and watch magic happen. What I actually did was architect a system. I chose Go for the backend because I wanted strong typing, excellent concurrency primitives, and a single binary deployment. Chose NATS for async job processing because provisioning a VM involves multiple slow Proxmox API calls that shouldn't block an HTTP handler. Designed a `proxmox.API` interface with 40 methods so every handler and worker depends on an abstraction, not a concrete client, making the whole thing testable with mocks.
The AI executed my architectural vision. It didn't create the vision.
## What Vibe Coding Actually Looks Like
The workflow resembled pair programming with a very fast but sometimes overconfident junior developer. I'd describe what I wanted at a high level, and the AI would produce a working first draft across the full stack. I described the backup flow in three sentences ("Proxmox uses vzdump with snapshot mode and zstd compression, backups go to the NFS storage, I need instant and scheduled options") and had a working UI with real-time SSE progress streaming forty minutes later. Go handler, Proxmox API calls, React components, the lot.
That breadth is where AI genuinely shines. Context-switching between Go, TypeScript, Docker Compose, and shell scripts in a single conversation without any of the mental overhead that usually comes with polyglot development. The boilerplate and plumbing came together remarkably fast. And once I established the interface-based pattern with `proxmox.API`, the AI generated 93 Go tests and 30 frontend tests with appropriate mocks and table-driven test cases. The pattern was clear enough that it could replicate it consistently.
But here's where the story gets more interesting.
## Where Deep Understanding Saved the Project
### The UPID Problem
Proxmox's clone and start operations don't complete synchronously. They return UPIDs (unique process IDs for background tasks). The AI's first implementation tried to verify a clone succeeded by checking if the target VM existed. This worked... most of the time. Except when it didn't, because the disk copy was still in progress and the VM was locked. Silent race conditions, the worst kind.
It took three iterations to get right. Not because the AI couldn't write the polling code, but because I had to understand *why* the clone was intermittently failing. The disk was still being copied. The VM was in a locked state. You can't configure cloud-init on a locked VM. Once I understood the root cause, the fix was straightforward: use `WaitForTask(upid)` to poll the task status endpoint until completion. The AI wrote the implementation in minutes. But the diagnosis required understanding how Proxmox actually works under the hood.
### LXC vs QEMU: Fundamentally Different Worlds
This one was the most architecturally significant. The AI kept trying to apply VM patterns to LXC containers, and it kept breaking. LXC containers have no guest agent. The `/config` endpoint doesn't accept `password` or `ssh-public-keys` after creation, only during the initial `POST /lxc`. Restore uses different parameter names (`ostemplate` with `restore=1` instead of `archive`). Storage filtering uses `rootdir` instead of `images`.
No amount of retrying would fix this. I had to architect a completely separate code path: SSH from the backend to the Proxmox host, then use `pct exec` to run commands inside the container. This meant adding an SSH client (`golang.org/x/crypto/ssh`), new environment variables, Docker volume mounts for the private key, and base64 encoding for scripts to avoid shell escaping issues.
The AI wrote all of that code once I designed the approach. But the approach itself came from understanding Proxmox's architecture deeply enough to know that LXC and QEMU are fundamentally different virtualization technologies with fundamentally different management APIs.
### The Guest Agent Trap
The Proxmox guest agent's `/agent/exec` endpoint requires a JSON body with `command: "bash"` and `input-data` as stdin. The AI sent form-encoded requests. Proxmox returned a 596 status code with "Broken pipe." That's it. No helpful error message, no hint about content types.
The AI guessed. It tried different encodings, different parameters, different endpoints. I diagnosed it by recognizing the pattern: "Broken pipe" on a POST usually means the server rejected the body before reading it completely, which screams content-type mismatch. Switching to JSON with the right field names fixed it immediately.
I saw this same dynamic with SSH key encoding. Proxmox needs `%20` for spaces, not `+`, and Go's `url.QueryEscape` produces `+`. The AI tried three approaches; I understood RFC 3986 vs HTML form encoding and prescribed the fix in one shot. When the problem is "two valid standards and this API chose the less common one," understanding the standards beats brute-force iteration every time.
### When No Documentation Exists
Some problems the AI simply cannot solve. While wiring up static IP support, VMs with IPs outside the DHCP range couldn't reach the internet. The AI tried different cloud-init configs, different gateway settings, different subnet masks. Nothing worked, because nothing was wrong with the configuration. My consumer router just won't NAT IPs it hasn't handed out via DHCP. You only discover this by running real hardware on a real network. The fix was to assign static IPs *within* the DHCP range but outside the dynamic pool, something no documentation mentions because enterprise routers don't have this limitation.
This pattern kept recurring. Debian 12 LXC containers have a `ssh.socket` vs `ssh.service` issue where SSH appears "running" but won't accept connections. Grafana's sandbox silently fails in unprivileged LXC containers. These aren't bugs in the AI. They're the kind of knowledge that comes from operating infrastructure, not from reading about it.
## What's Actually Scarce Now
Here's the thesis I keep coming back to: writing code is becoming a commodity. AI can produce syntactically correct, well-structured, idiomatically appropriate code faster than any human. But the code was always the easy part. The hard parts were always the parts *around* the code, and those haven't gotten any easier.
Systems thinking. Debugging beyond the error message. Domain knowledge from running real infrastructure. Architectural judgment about which abstractions are worth the investment and which are leaky. Every story in this post is an example of one of these, and in every case, the AI was stuck until I brought the understanding it couldn't generate on its own.
Computer science fundamentals (concurrency, networking, systems design, API design patterns) aren't being made obsolete by AI. They're becoming the differentiator between someone who can prompt an AI and someone who can actually ship working software.
## Try It, Break It, Improve It
PVE Pilot is open source at [github.com/ashkmb/pve-pilot](https://github.com/ashkmb/pve-pilot). If you run a homelab with Proxmox, give it a spin. It handles VM and container provisioning with real-time progress streaming, backup and restore (instant or scheduled), vertical scaling, disk management, and static or DHCP networking, all through a clean dark-themed UI.
The codebase is well-tested (123 tests across backend and frontend) and the architecture is intentionally clean. Check out `CONTRIBUTING.md` if you want to get involved. PRs are welcome, whether you bring deep Proxmox expertise, Go or Next.js chops, or you're looking for a real project to practice your own vibe coding workflow on.
If you find bugs or want features, open an issue. That's how open source works. One commit at a time, each one making the thing a little better than it was before. AI or not.
---
# Kubernetes Finalizers Explained: Why Namespaces Get Stuck in Terminating State
> Attempting to delete a Kubernetes namespace and discovering it perpetually stuck in a Terminating state? The culprit typically involves finalizers, special metadata fields that prevent resource deletion until cleanup tasks complete.
- URL: https://ashkmb.com/blog/kubernetes-finalizers-explained/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2025-10-21
- Language: en
## Introduction
Attempting to delete a Kubernetes namespace and discovering it perpetually stuck in a "Terminating" state represents one of DevOps' most frustrating recurring issues. The culprit typically involves finalizers, special metadata fields that prevent resource deletion until cleanup tasks complete.
## What Are Kubernetes Finalizers?
A finalizer functions as a "to-do list" for Kubernetes controllers. Before the Kubernetes API Server actually removes an object from etcd (the cluster's database), it checks the list of finalizers attached to that resource.
Each finalizer entry represents a controller responsible for cleanup operations before the Kubernetes API permits actual deletion.
## Why Finalizers Exist
Finalizers enable safe, predictable resource cleanup by preventing orphaned resources, like persistent volumes, network interfaces, or IAM roles, from remaining after deletion.
**Common use cases include:**
- **PersistentVolumeClaims (PVCs)** – Ensuring associated PersistentVolumes detach before removal
- **Namespaces** – Guaranteeing all sub-resources delete before namespace removal
- **Custom Resource Definitions (CRDs)** – Enabling operator cleanup before instance deletion
- **Service Controllers** – Cloud integrations managing load balancer deletion
## How Finalizers Work
The lifecycle follows these steps:
1. `kubectl delete` executes on an object
2. Kubernetes adds a `deletionTimestamp` to the object
3. Controllers managing finalizers identify the timestamp and initiate cleanup
4. After cleanup completion, the controller removes its finalizer
5. Once the finalizer list empties, Kubernetes deletes the object
## When Things Go Wrong
Controllers occasionally crash, get removed, or malfunction. When this occurs, Kubernetes waits indefinitely for cleanup that never happens, leaving resources stuck in "Terminating."
**Typical symptoms:**
- Resource stuck in "Terminating" state
- `kubectl delete` never completes
- Finalizers remain present in object YAML
- Controller logs display errors or missing references
## Debugging a Stuck Namespace or Resource
### Step 1: Inspect the Resource
```bash
kubectl get ns my-namespace -o yaml
```
This reveals the finalizers field blocking deletion.
### Step 2: Identify the Stuck Finalizer
Check relevant controller logs to understand which finalizer prevents deletion and why cleanup isn't progressing.
### Step 3: Remove the Finalizer
Once certain removal is safe, patch the resource:
```bash
kubectl patch ns my-namespace -p '{"metadata":{"finalizers":[]}}' --type=merge
```
Alternatively, edit directly via `kubectl edit ns my-namespace` and delete finalizer lines.
> **Critical caution:** Only remove finalizers after confirming cleanup is unnecessary; otherwise orphaned cloud resources may persist.
## Real-World Example
Consider a namespace managed by the AWS Load Balancer Controller. Deletion reveals:
```yaml
metadata:
finalizers:
- service.kubernetes.io/load-balancer-cleanup
```
If the controller is unavailable or lacks proper permissions, it cannot remove the finalizer, leaving the namespace perpetually terminating.
**Solution:** Restart the controller or repair permissions; if unsuccessful and confident no resources remain, manually remove the finalizer.
## Best Practices
1. Avoid manual finalizer removal unless necessary; address controller issues first
2. Examine controller logs for underlying causes
3. Recognize that some finalizers perform critical cleanup preventing resource leaks
4. Exercise caution with automated cleanup scripts; implement safeguards
5. For CRD developers: register finalizers responsibly, perform cleanup in Reconcile logic, and remove after success
## Conclusion
Finalizers represent subtle yet powerful Kubernetes mechanisms ensuring safe resource cleanup. They establish "cleanup contracts" between controllers and the API server. When controllers malfunction, resources become stuck, but understanding finalizer mechanics enables confident troubleshooting and safe removal.
---
# Discovering the Power of templatefile() in Terraform: A DevOps Engineer's Perspective
> Exploring Terraform's templatefile() function and its advantages over Jinja2 templating for infrastructure-as-code workflows. Why Terraform's minimalist approach to templating is intentional and beneficial.
- URL: https://ashkmb.com/blog/terraform-templatefile-power/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2025-09-15
- Language: en
## What is `templatefile()` Anyway?
The function accepts a template path and variable map: `templatefile(path, vars)`. Templates use straightforward syntax like `${variable}` for interpolation and `%{ if ... }` / `%{ for ... }` for control structures.
## User Data Example
Instead of embedding multi-line scripts directly in HCL, developers can separate concerns by using `.tpl` files. This approach enables modular configuration that's version-controlled and reusable across environments.
For example, an EC2 user data script can live in a template file:
```hcl
resource "aws_instance" "web" {
ami = var.ami_id
instance_type = var.instance_type
user_data = templatefile("${path.module}/templates/userdata.tpl", {
environment = var.environment
app_name = var.app_name
db_host = aws_db_instance.main.endpoint
})
}
```
And the template itself stays clean and readable:
```bash
#!/bin/bash
echo "Deploying ${app_name} in ${environment}"
echo "DB_HOST=${db_host}" >> /etc/environment
```
## Kubernetes YAML Integration
Templates allow teams to maintain existing YAML manifests while letting Terraform manage them dynamically. You can render a Deployment manifest with variables for app name, replicas, and container image, keeping your Kubernetes YAML familiar while injecting environment-specific values at plan time.
## Jinja2 vs. Terraform Comparison
| Aspect | Jinja2 | Terraform templatefile() |
|--------|--------|--------------------------|
| **Syntax** | `{{ var }}`, filters, macros | `${var}`, basic control flow |
| **Complexity** | High (logic-heavy possible) | Low (minimal by design) |
| **Use Case** | General-purpose templating | IaC-focused helper |
| **Philosophy** | Maximum power | Just enough power |
The key insight: `templatefile()` is deliberately minimalist to maintain predictability in infrastructure definitions.
## Design Philosophy
Terraform's approach prioritizes clarity over capability. Excessive logic in templates can create maintenance nightmares, whereas Terraform's constraint keeps it sane. This aligns with infrastructure-as-code principles: declarative, reproducible, and transparent.
When you find yourself fighting `templatefile()` limitations, that's usually a signal to move logic into your HCL code or a dedicated configuration management tool, not to add more complexity to your templates.
## Conclusion
Both tools are contextually appropriate: Jinja2 for complex configuration generation, `templatefile()` for lightweight templating within Terraform workflows. Discovering this feature was a workflow improvement that emphasizes simplicity without sacrificing functionality.
---
# Kubernetes Operators: Unlocking the Power of Automated Operations
> How Kubernetes Operators automate complex operational tasks in containerized environments, addressing challenges that arise from managing microservices at scale.
- URL: https://ashkmb.com/blog/kubernetes-operators-automated-operations/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2023-08-30
- Language: en
## The Core Problem
Modern software deployments involve managing numerous containers across distributed clusters. Each container may have distinct lifecycles, configurations, and dependencies. While Kubernetes provides orchestration fundamentals, it doesn't handle application-specific operational requirements such as:
- Zero-downtime updates
- Custom configuration management
- Backup and recovery procedures
- High-availability setups
## What Are Kubernetes Operators?
Operators are custom controllers that use Custom Resource Definitions (CRDs) to manage Kubernetes applications. They encapsulate domain-specific operational knowledge into automated processes.
### Key Benefits
- **Domain Expertise Encoded**: Operators handle application-specific tasks automatically
- **Lifecycle Automation**: Manage deployments, scaling, and updates consistently
- **Environmental Consistency**: Uniform configurations across dev, staging, and production
- **Reduced Manual Work**: Decreased human intervention means fewer errors
- **State Management**: Handle stateful applications like databases with backups and data integrity
- **Kubernetes Extension**: Add custom capabilities to your cluster
## Practical Example: Redis Operator
Consider a Redis Operator implementation that manages:
- Primary-replica configurations for high availability
- Automatic failover mechanisms
- Replica scaling capabilities
### Step 1: Custom Resource Definition
Define a CRD allowing users to create Redis instances via `kubectl`:
```yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: redisclusters.cache.example.com
spec:
group: cache.example.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
replicas:
type: integer
version:
type: string
scope: Namespaced
names:
plural: redisclusters
singular: rediscluster
kind: RedisCluster
```
### Step 2: Operator Logic
Implement in Go using Kubernetes client libraries to deploy primary pods, replicas, and services. The operator watches for changes to `RedisCluster` resources and reconciles the desired state.
### Step 3: Deployment
Deploy with appropriate RBAC configurations to watch and manage Redis resources across the cluster.
## Conclusion
Operators represent a powerful pattern for managing complex applications in Kubernetes, encapsulating operational expertise and reducing the burden on development teams. If you're managing stateful workloads or applications with complex lifecycle requirements, building or adopting an operator is worth the investment.
---
# The Future of AI: How GPU Computation and the Transition to WebGPU Will Shape Our Everyday Lives
> The transition to WebGPU for AI and GPU computation represents a pivotal shift in how we'll experience artificial intelligence technology, democratizing access to advanced capabilities.
- URL: https://ashkmb.com/blog/future-of-ai-gpu-webgpu/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2023-04-17
- Language: en
## Introduction
The transition to WebGPU for AI and GPU computation represents a pivotal shift in how we'll experience artificial intelligence technology. WebGPU, an emerging web standard, will fundamentally change AI interactions and integrate advanced capabilities into daily experiences.
## The Rise of WebGPU
WebGPU functions as a next-generation graphics and computation API that streamlines GPU programming for developers. This technology democratizes access by eliminating barriers: users no longer need specialized hardware or software to interact with sophisticated AI applications.
Unlike its predecessor WebGL, WebGPU provides a more modern, lower-level abstraction that maps closely to how GPUs actually work. This means better performance, more predictable behavior, and access to compute shaders that are essential for machine learning workloads.
## Benefits of GPU Computation
GPUs are highly efficient at handling parallel computations, making them well-suited for training and executing AI models. WebGPU extends this efficiency to the browser, enabling broader developer adoption and reducing the barrier to entry for AI-powered applications.
Key advantages include:
- **Massive parallelism**: thousands of cores executing simultaneously
- **Memory bandwidth**: optimized for the data-heavy operations ML models require
- **Accessibility**: no CUDA installation, no driver management, just a browser
- **Cross-platform**: works on any device with a modern browser
## Real-World Applications
### Web Experiences
Real-time translation, content generation, and personalized recommendations running directly in the browser without server round-trips.
### Communication
AI-enhanced video and voice calls with live transcription, noise cancellation, and sentiment analysis, all processed locally.
### Healthcare
Advanced medical imaging analysis for improved diagnostics, with privacy benefits from on-device processing.
### Transportation
Traffic optimization and route efficiency powered by models that can run on edge devices.
### Home Automation
Learning systems that personalize daily convenience, understanding patterns and preferences over time.
## Conclusion
WebGPU's accessibility will unlock countless AI-driven innovations that reshape human experience across multiple sectors. As the standard matures and browser support expands, we'll see a new generation of applications that bring GPU-accelerated AI to everyone, no specialized hardware required.
---
# Revolutionizing AI Development and Deployment: The Advantages of MLOps over Traditional Cloud-Based Approaches
> How Machine Learning Operations (MLOps) transforms AI development by streamlining model creation and deployment compared to conventional cloud-based approaches.
- URL: https://ashkmb.com/blog/mlops-advantages-over-cloud/
- Author: Ashkan Kamyab (https://ashkmb.com)
- Published: 2023-04-03
- Language: en
## Overview
The way organizations develop and deploy AI models is undergoing a fundamental shift. Machine Learning Operations (MLOps) brings the principles of DevOps (automation, monitoring, collaboration) to the machine learning lifecycle, transforming how models move from experimentation to production.
## Key Benefits of MLOps
### Continuous Model Evolution
MLOps enables continuous training and evaluation of models, allowing them to be updated and improved as new data becomes available. This iterative approach produces more adaptive and accurate solutions compared to the traditional "train once, deploy, forget" pattern.
### Dataset Reusability
Organizations can leverage high-quality datasets across multiple applications, reducing redundant work and enabling training on larger, more diverse data pools. A well-managed feature store means your data investments compound over time.
### Streamlined Deployment
MLOps provides a streamlined and automated deployment process, allowing for faster and more efficient delivery of models to production. This reduces both time and implementation costs: what used to take weeks can happen in hours.
### Enhanced Collaboration
MLOps unites cross-functional teams (data scientists, ML engineers, DevOps, and product teams), eliminating silos that traditionally impede communication and slow development cycles.
### Additional Advantages
- Improved operational efficiency and resource allocation
- Automated security threat detection and response
- Faster market entry for AI solutions
- Reduced development and deployment expenses
- Enhanced model accuracy through continuous monitoring
## Popular Open-Source MLOps Tools
### 1. Kubeflow
Kubernetes-native platform for ML workflows. Supports TensorFlow, PyTorch, and other frameworks. Ideal if you're already running Kubernetes.
### 2. MLflow
End-to-end ML lifecycle management: experiment tracking, model registry, and deployment. Framework-agnostic and easy to get started with.
### 3. PyTorch Lightning
Lightweight framework for distributed training that reduces boilerplate code while maintaining flexibility.
### 4. Apache Airflow
Workflow orchestration and scheduling. Not ML-specific, but widely used for ML pipeline orchestration.
### 5. Polyaxon
Experiment management and ML scaling platform with built-in support for hyperparameter tuning and distributed training.
### 6. Feast
Feature store for centralized data management. Ensures consistent feature computation between training and serving.
### 7. Seldon Core
Production model deployment and monitoring on Kubernetes. Handles A/B testing, canary deployments, and model explainability.
## Conclusion
MLOps isn't just a buzzword; it's the natural evolution of bringing engineering discipline to machine learning. As models become more central to business operations, the ability to reliably train, deploy, monitor, and retrain them becomes a competitive advantage. The tools are mature, the patterns are proven, and the time to adopt is now.