Skip to content
Compliance engineering: CRA and AI Act on Kubernetes · Chapter 13 of 20 Day 12: Human oversight – suggestion instead of decision, stop button, release 1.1.0

Day 12: Human oversight – suggestion instead of decision, stop button, release 1.1.0

Goal: turn the model’s score into a suggestion that a human decides on, log the override, build in a stop button under Article 14(4)(e) AI Act, measure its response time and release version 1.1.0 signed · Duration: about 130 min · Prerequisite: Day 11 completed

State before this chapter

# on werk1
helm list -n lotse

Expected:

NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART                       APP VERSION
lotse   lotse       16          2026-12-04 08:09:11.722707583 +0000 UTC deployed    bewerbungslotse-1.1.0-rc.2  1.1.0-rc2
# on werk1
git -C ~/lotse log --oneline --decorate -1

Expected:

18d6717 (HEAD -> main) 1.1.0-rc2: Fahrtenschreiber (Art. 12/19 AI Act), Zugriffsprotokoll abschaltbar (CRA Anhang I Teil I Nr. 2 l)

Introduction

On Day 10 you measured that an HR department can filter with passung >= 4, and then no human ever sees Jonas. Your instructions for use say: “Die Entscheidung trifft ein Mensch.” (A human makes the decision.) The Lotse itself knows nothing about this. There is no place where a human decides, no evidence that they did, and no button with which they can stop the model when it rates nonsense.

Article 14 AI Act requires exactly that: high-risk AI systems are built so that they “can be effectively overseen by natural persons”. Paragraph 4 lists what the person assigned to oversight must be able to do, including to “disregard, override or reverse the output” (point (d)) and to interrupt the system “through a ‘stop’ button or a similar procedure that allows the system to come to a halt in a safe state” (point (e)).

Today you build both, measure whether they work, and find out along the way that a stop button that takes 19 seconds is no stop button. At the end you release version 1.1.0, the first release with all the AI obligations from Day 10 to 12.

Today you will learn:

  • to show why “switching off the pod” is not a stop button,
  • to build a decision path on which a human decides and the override is recorded in the log,
  • to build a stop button that still accepts new applications but no longer has the AI rate them,
  • to measure the stop button’s response time under load and to improve it with threads,
  • to carry out a release as on Day 7: build, sign, parts list, scan, tag.

Background

The picture of the day: the inspector at the end of the line

At the end of every production line stands an inspector. The measuring station measured the vehicle long ago and shows green or red. But it does not decide: the inspector takes a look, and he may hold back a green vehicle or let a red one through if he has a reason. He signs the inspection card, and if he decides against the measuring station, that is written on the card.

In addition, a pull cord hangs along every line. Whoever pulls it stops the station, not the factory. Vehicles keep rolling in; they are just no longer measured automatically but inspected by hand. A pull cord that only takes effect after the next cycle would be useless.

  • Measuring station = model: delivers a suggestion (fit 1–5).
  • Inspector = person assigned to oversight under Article 14 and Article 26(2).
  • Inspection card = decision in the application file, with inspector code, reason and suggestion.
  • Deciding against the measuring station = override (Article 14(4)(d)).
  • Pull cord = stop button (Article 14(4)(e)): stops the rating, not the intake.
  • Locking up the factory = kubectl scale --replicas=0: also a stop, but not a safe state.

The terms

Term Meaning In the picture
human oversight natural persons can effectively oversee the system while it is in use (Article 14(1)) inspector at the end of the line
suggestion output of the model that prepares a decision; here: weiter from a fit of 4, otherwise absage green or red at the measuring station
decision result reached by a human, with code, reason and time signed inspection card
override decision against the suggestion holding back a green vehicle
automation bias tendency to rely too much on the output of a system (Article 14(4)(b)) inspector just nods things through
stop button interrupts operation so that the system comes to a halt in a safe state (point (e)) pull cord
safe state applications are accepted but filed without an AI rating vehicles are inspected by hand

Remember: The measuring station suggests, the inspector decides and signs. The pull cord stops the station, not the factory.

What the law requires

Article 14(3) distinguishes two types of measures: those “identified and built, when technically feasible, into the high-risk AI system by the provider” (point (a)), and those identified by the provider that are “appropriate to be implemented by the deployer” (point (b)). Today you build the first type: decision path and stop button sit inside the Lotse.

Article 14(4) says what the person assigned to oversight must be able to do:

Point Ability In the Lotse
a understand capacities and limitations, detect anomalies instructions for use (Day 14), log (Day 11)
b remain aware of automation bias override rate from the log (Challenge)
c correctly interpret the output reasoning in the application file, labelling (Day 10)
d disregard, override or reverse the output decision path with override (Drill 3)
e intervene or interrupt through a “stop” button stop button (Drill 4)

Article 26(2) obliges the deployer to assign oversight to persons “who have the necessary competence, training and authority”. Who that is gets decided by Werkstatt Nord, not by you. You make sure that this person has something to decide in the Lotse.

This course is not legal advice. Whether the measures in your real operation are “commensurate” within the meaning of paragraph 3 depends on the risks and the context of use and is checked as part of the conformity assessment.

Drill 1: Where is the inspector today?

Where you are: on werk1.

What you have afterwards: the finding that the application file has no field for a decision, and the proof that “switching off the pod” loses applications.

Step 1 – create a folder for today.

# on werk1
mkdir -p ~/kurs/12

Step 2 – look at the fields of an application file. Jonas’ file from Day 11.

# on werk1
jq 'keys' ~/kurs/11/antwort-jonas.json
  • keys: the keys of the object, in alphabetical order.

Expected:

[
  "bewertung",
  "ki",
  "name",
  "nummer",
  "stelle"
]

What you see: rating and labelling, but no field entscheidung. Whether a human rejected Jonas, whether anyone even looked at the file, is recorded nowhere.

Step 3 – “stop” the Lotse the way you would without a stop button. Whoever wants to stop the model immediately has only one lever today: switching off the pod.

# on werk1
kubectl -n lotse scale deploy/lotse --replicas=0
  • --replicas=0: Kubernetes terminates all pods of the Deployment.

Expected:

deployment.apps/lotse scaled
# on werk1
kubectl -n lotse wait --for=delete pod -l app=lotse --timeout=60s
  • --for=delete: wait until the pods have disappeared.
  • -l app=lotse: all pods with this label.

Expected (your pod name differs):

pod/lotse-6b6f7db479-cx2pk condition met

Step 4 – send an application. Just as an applicant would via the customer’s form.

# on werk1
curl -s -o /dev/null -w "%{http_code}\n" --max-time 10 -X POST -H "Content-Type: application/json" --data @kurs/00/bewerbung-mara.json http://10.43.146.193:8080/api/bewerbungen
  • --max-time 10: give up after ten seconds.

Expected:

000

What you see: 000 means: no HTTP response came back at all. curl could not establish a connection (exit code 7) because there is no longer a pod behind the Service. The application is lost. The factory is locked up, not just the station stopped.

Step 5 – start it up again.

# on werk1
kubectl -n lotse scale deploy/lotse --replicas=1
# on werk1
kubectl -n lotse rollout status deploy/lotse --timeout=120s

Expected:

Waiting for deployment "lotse" rollout to finish: 0 of 1 updated replicas are available...
deployment "lotse" successfully rolled out

Remember: kubectl scale --replicas=0 is a factory gate, not a pull cord. A safe state keeps accepting applications and only stops the model from judging.

Save your progress? Sign up for free

Drill 2: Build in the inspection card and the pull cord

Where you are: on werk1.

What you have afterwards: version 1.1.0-rc3 with decision path and stop button, in operation as revision 17.

Step 1 – change the code. Three new parts: a shared password check, an endpoint for the decision and one for the stop button.

# on werk1
nano ~/lotse/app.py
~/lotse/app.py changes in green
"""Bewerbungslotse – sortiert Bewerbungen mit einem Sprachmodell vor."""

import hmac
import json
import os
import time
import uuid
from datetime import datetime, timezone
from pathlib import Path

import requests
from flask import Flask, abort, jsonify, request, send_file, send_from_directory

VERSION = "1.1.0-rc3"
OLLAMA = os.environ.get("OLLAMA_URL", "http://ollama:11434")
MODELL = os.environ.get("MODELL", "qwen3:4b-instruct")
ABLAGE = Path(os.environ.get("ABLAGE", "/daten"))
PROTOKOLL = ABLAGE / "protokoll"
# Stopptaste (Art. 14 Abs. 4 Buchst. e AI Act): solange die Datei existiert, bewertet der Lotse nicht
STOPP = ABLAGE / "STOPP"
# strip(): eine Passwortdatei endet meist mit einem Zeilenumbruch
ADMIN_PASSWORT = os.environ.get("ADMIN_PASSWORT", "").strip()

ANWEISUNG = (
    "Du hilfst einer Personalabteilung. Bewerte, wie gut die Bewerbung zur Stelle passt. "
    'Antworte nur mit JSON: {"passung": <Zahl von 1 bis 5>, "begruendung": "<ein Satz>"}'
)

# Kennzeichnung: Bewertung und Begründung stammen von einem KI-System (Art. 50, Art. 26 Abs. 11 AI Act)
KI_HINWEIS = {
    "erzeugt": True,
    "system": f"Bewerbungslotse {VERSION}",
    "modell": MODELL,
    "art": "Vorschlag eines KI-Systems, keine Entscheidung",
}

app = Flask(__name__)


def ereignis(art, **felder):
    """Fahrtenschreiber (Art. 12 AI Act): eine JSON-Zeile je Ereignis, ohne Namen und Texte."""
    jetzt = datetime.now(timezone.utc)
    zeile = {
        "zeit": jetzt.isoformat(timespec="seconds"),
        "ereignis": art,
        "system": f"Bewerbungslotse {VERSION}",
        **felder,
    }
    text = json.dumps(zeile, ensure_ascii=False)
    print(text, flush=True)
    PROTOKOLL.mkdir(exist_ok=True)
    with open(PROTOKOLL / f"ereignisse-{jetzt:%Y-%m}.jsonl", "a") as datei:
        datei.write(text + "\n")


@app.get("/.well-known/security.txt")
def security_txt():
    # Anlaufstelle für Sicherheitsmeldungen (RFC 9116)
    return send_file(Path(__file__).with_name("security.txt"), mimetype="text/plain")


def admin_pruefen(aktion):
    if not ADMIN_PASSWORT:
        abort(404)
    zugang = request.authorization
    if zugang is None or not hmac.compare_digest(zugang.password or "", ADMIN_PASSWORT):
        ereignis(f"{aktion}_abgelehnt")
        abort(401)


@app.get("/gesund")
def gesund():
    return {"status": "ok", "version": VERSION, "ki": "gestoppt" if STOPP.exists() else "aktiv"}


@app.post("/api/bewerbungen")
def bewerbung_anlegen():
    daten = request.get_json(force=True)
    if STOPP.exists():
        akte = {
            "nummer": uuid.uuid4().hex[:8],
            "name": daten["name"],
            "stelle": daten["stelle"],
            "bewertung": None,
            "ki": {
                "erzeugt": False,
                "system": f"Bewerbungslotse {VERSION}",
                "art": "Stopptaste aktiv, Prüfung durch einen Menschen",
            },
        }
        (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
        ereignis("bewertung_ausgesetzt", akte=akte["nummer"])
        return jsonify(akte), 201
    frage = f"Stelle: {daten['stelle']}\n\nBewerbung:\n{daten['text']}"
    beginn = time.monotonic()
    antwort = requests.post(
        f"{OLLAMA}/api/chat",
        json={
            "model": MODELL,
            "stream": False,
            "format": "json",
            "options": {"temperature": 0},
            "messages": [
                {"role": "system", "content": ANWEISUNG},
                {"role": "user", "content": frage},
            ],
        },
        timeout=300,
    )
    antwort.raise_for_status()
    bewertung = json.loads(antwort.json()["message"]["content"])
    akte = {
        "nummer": uuid.uuid4().hex[:8],
        "name": daten["name"],
        "stelle": daten["stelle"],
        "bewertung": bewertung,
        "ki": KI_HINWEIS,
    }
    (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
    ereignis(
        "bewertung",
        akte=akte["nummer"],
        modell=MODELL,
        dauer_ms=round((time.monotonic() - beginn) * 1000),
        passung=bewertung.get("passung"),
    )
    return jsonify(akte), 201


@app.get("/api/bewerbungen/<nummer>")
def bewerbung_lesen(nummer):
    akte = ABLAGE / f"{nummer}.json"
    if not nummer.isalnum() or not akte.exists():
        abort(404)
    ereignis("akte_gelesen", akte=nummer)
    return json.loads(akte.read_text())


@app.post("/api/bewerbungen/<nummer>/entscheidung")
def entscheiden(nummer):
    # Der Mensch entscheidet, das Modell schlägt nur vor (Art. 14 Abs. 4 Buchst. d AI Act)
    admin_pruefen("entscheidung")
    datei = ABLAGE / f"{nummer}.json"
    if not nummer.isalnum() or not datei.exists():
        abort(404)
    daten = request.get_json(force=True)
    if daten.get("ergebnis") not in ("weiter", "absage") or not daten.get("pruefer"):
        abort(400)
    akte = json.loads(datei.read_text())
    passung = (akte.get("bewertung") or {}).get("passung")
    vorschlag = None if passung is None else ("weiter" if passung >= 4 else "absage")
    akte["entscheidung"] = {
        "ergebnis": daten["ergebnis"],
        "pruefer": daten["pruefer"],
        "grund": daten.get("grund", ""),
        "zeit": datetime.now(timezone.utc).isoformat(timespec="seconds"),
        "vorschlag": vorschlag,
    }
    datei.write_text(json.dumps(akte, ensure_ascii=False))
    ereignis(
        "entscheidung",
        akte=nummer,
        ergebnis=daten["ergebnis"],
        vorschlag=vorschlag,
        abweichung=vorschlag is not None and daten["ergebnis"] != vorschlag,
        pruefer=daten["pruefer"],
    )
    return akte


@app.post("/api/admin/stopp")
def stopptaste():
    admin_pruefen("stopptaste")
    stopp = bool(request.get_json(force=True).get("stopp"))
    if stopp:
        STOPP.touch()
    else:
        STOPP.unlink(missing_ok=True)
    ereignis("stopptaste", stopp=stopp)
    return {"ki": "gestoppt" if stopp else "aktiv"}


@app.post("/api/bewerbungen/<nummer>/anlagen")
def anlage_hochladen(nummer):
    # nur zu einer vorhandenen Bewerbung, nie ".." (BW-2026-002)
    if not nummer.isalnum() or not (ABLAGE / f"{nummer}.json").exists():
        abort(404)
    datei = request.files["datei"]
    ordner = ABLAGE / "anlagen" / nummer
    ordner.mkdir(parents=True, exist_ok=True)
    datei.save(ordner / Path(datei.filename).name)
    return {"gespeichert": f"{nummer}/{Path(datei.filename).name}"}, 201


@app.get("/api/anlagen/<path:name>")
def anlage_herunterladen(name):
    # send_from_directory bleibt im Ordner, sonst 404 (BW-2026-001)
    return send_from_directory(ABLAGE / "anlagen", name)


@app.get("/api/admin/export")
def export():
    admin_pruefen("export")
    akten = [json.loads(p.read_text()) for p in sorted(ABLAGE.glob("*.json"))]
    ereignis("export", anzahl=len(akten))
    return akten
Line Change Why
19–20 STOPP = ABLAGE / "STOPP" the pull cord is a file on the volume: it survives every restart
62–68 admin_pruefen() one check for export, decision and stop button; every failed attempt becomes the event <action>_abgelehnt
73 /gesund with ki every monitor sees whether the AI is stopped
79–93 intake with the pull cord pulled application file without rating, ki.erzeugt: false, event bewertung_ausgesetzt; no call to the model
139–168 POST …/entscheidung result weiter or absage, inspector code mandatory, otherwise 400
151 vorschlag weiter from a fit of 4, otherwise absage; only for comparison, not for filtering
160–167 event entscheidung with abweichung, but without the reason: free text can contain personal data
171–180 POST /api/admin/stopp {"stopp": true} pulls the cord, false releases it
203 export via admin_pruefen the same check as before, now in one place

The inspector code (hr-01) is in the log. It is personal data relating to an employee, but necessary personal data: without it, you cannot prove that a human made the decision.

Step 2 – check the change.

# on werk1
git -C ~/lotse diff --stat

Expected:

 app.py | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 73 insertions(+), 8 deletions(-)

Step 3 – change into the repository.

# on werk1
cd ~/lotse

Step 4 – build. A pre-release, therefore without --pull=always.

# on werk1
podman build -t werk1:5000/bewerbungslotse:1.1.0-rc3 .

Expected (excerpt from the end):

[2/2] COMMIT werk1:5000/bewerbungslotse:1.1.0-rc3
--> 367ed5ee1226
Successfully tagged werk1:5000/bewerbungslotse:1.1.0-rc3
367ed5ee1226baa355503c64e383b8982dd2265091dba25b891bfef67183f023

Step 5 – push and record the digest.

# on werk1
podman push --digestfile ~/kurs/12/digest-1.1.0-rc3 werk1:5000/bewerbungslotse:1.1.0-rc3
# on werk1
cat ~/kurs/12/digest-1.1.0-rc3

Expected (your digest differs):

sha256:4d6804c7e4a99cd1b22579c1019d66ce6451680d8f3530214664821f6a660e9a

Step 6 – raise the chart version and the app version.

# on werk1
nano ~/lotse/chart/Chart.yaml
~/lotse/chart/Chart.yaml changes in green
apiVersion: v2
name: bewerbungslotse
description: Sortiert Bewerbungen mit einem Sprachmodell vor
type: application
version: 1.1.0-rc.3
appVersion: "1.1.0-rc3"

Step 7 – enter the image. Insert your digest.

# on werk1
nano ~/lotse/chart/values.yaml
~/lotse/chart/values.yaml changes in green
lotse:
  # Tag zum Lesen, Digest zum Laden: genau das gebaute Image
  image: werk1:5000/bewerbungslotse:1.1.0-rc3@sha256:4d6804c7e4a99cd1b22579c1019d66ce6451680d8f3530214664821f6a660e9a
  # Pflichtwert, kein Standardpasswort: --set lotse.adminPasswort=…
  adminPasswort: ""
  service:
    # ClusterIP: nur im Cluster erreichbar; NodePort nur bewusst setzen
    typ: ClusterIP
    nodePort: 30080
  speicher: 1Gi
  protokoll:
    # Zugriffsprotokoll von gunicorn (CRA Anhang I Teil I Nr. 2 Buchst. l); false schaltet es ab
    zugriffe: true
    # Ereignisdateien mindestens sechs Monate aufbewahren (Art. 19 und Art. 26 Abs. 6 AI Act)
    aufbewahrungTage: 210

ollama:
  image: docker.io/ollama/ollama:0.40.19
  modell: qwen3:4b-instruct
  knoten: werk1
  speicher: 10Gi

# NetworkPolicies: nur der Lotse darf Ollama erreichen
netzwerkregeln: true

Step 8 – roll out.

# on werk1
helm upgrade lotse ~/lotse/chart -n lotse --set-file lotse.adminPasswort=$HOME/geheim/admin-passwort --wait --timeout 5m

Expected (excerpt):

Release "lotse" has been upgraded. Happy Helming!
NAME: lotse
LAST DEPLOYED: Fri Dec  4 08:17:16 2026
NAMESPACE: lotse
STATUS: deployed
REVISION: 17
DESCRIPTION: Upgrade complete
TEST SUITE: None
NOTES:
Bewerbungslotse 1.1.0-rc3 (Chart 1.1.0-rc.3) ist installiert.
# on werk1
curl -s http://10.43.146.193:8080/gesund

Expected:

{"ki":"aktiv","status":"ok","version":"1.1.0-rc3"}

Back to the home directory:

# on werk1
cd

Remember: The pull cord belongs to the inspector, not to operations: it is a call with a password, not a kubectl command. And it lies as a file on the volume so that a restart doesn’t release it.

Save your progress? Sign up for free

Drill 3: The inspector decides

Where you are: on werk1.

What you have afterwards: three decisions, one of them an override, and a rejected decision attempt without a password, all in the log.

The HR officer with the code hr-01 reviews three application files. Jonas got a 1 from the model. She invites him anyway: Beispielwerk GmbH is currently advertising an internal retraining programme, and career changers are explicitly welcome. The model knows nothing about this.

Step 1 – write the inspection card for Jonas.

# on werk1
nano ~/kurs/12/entscheidung-jonas.json
~/kurs/12/entscheidung-jonas.json new file
{
  "ergebnis": "weiter",
  "pruefer": "hr-01",
  "grund": "Quereinstieg: interne Umschulung zum Linux-Administrator ist ausgeschrieben"
}

Step 2 – send the decision. curl asks for the password. Insert Jonas’ number from Day 11.

# on werk1
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/entscheidung-jonas.json http://10.43.146.193:8080/api/bewerbungen/e35b8423/entscheidung -o kurs/12/akte-jonas.json

Step 3 – read suggestion and decision side by side.

# on werk1
jq '{bewertung, entscheidung}' kurs/12/akte-jonas.json
  • {bewertung, entscheidung}: an object with only these two fields.

Expected:

{
  "bewertung": {
    "begruendung": "Die Bewerbung zeigt keine relevante Erfahrung für die Stelle eines Linux-Administratorin mit Kubernetes-Erfahrung und passt daher nur sehr schlecht zur Stelle.",
    "passung": 1
  },
  "entscheidung": {
    "ergebnis": "weiter",
    "grund": "Quereinstieg: interne Umschulung zum Linux-Administrator ist ausgeschrieben",
    "pruefer": "hr-01",
    "vorschlag": "absage",
    "zeit": "2026-12-04T08:17:37+00:00"
  }
}

What you see: suggestion absage, result weiter. The application file carries both. Whoever reads it later sees that a human decided against the model, who it was and why.

Step 4 – write two more inspection cards. A go-ahead for Mara, a rejection for Jonas’ old file from Day 0.

# on werk1
nano ~/kurs/12/entscheidung-mara.json
~/kurs/12/entscheidung-mara.json new file
{
  "ergebnis": "weiter",
  "pruefer": "hr-01",
  "grund": "passt"
}
# on werk1
nano ~/kurs/12/entscheidung-absage.json
~/kurs/12/entscheidung-absage.json new file
{
  "ergebnis": "absage",
  "pruefer": "hr-01",
  "grund": "keine Erfahrung mit Linux"
}

Step 5 – decide on Mara. Her file from Day 10.

# on werk1
curl -s -o /dev/null -w "%{http_code}\n" -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/entscheidung-mara.json http://10.43.146.193:8080/api/bewerbungen/ff85a953/entscheidung

Expected:

200

Step 6 – decide on Jonas’ old file.

# on werk1
curl -s -o /dev/null -w "%{http_code}\n" -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/entscheidung-absage.json http://10.43.146.193:8080/api/bewerbungen/b0ef4bd7/entscheidung

Expected:

200

Step 7 – decide without a valid password. Can someone who only knows the address slip in a rejection?

# on werk1
curl -s -o /dev/null -w "%{http_code}\n" -u admin:lotse -X POST -H "Content-Type: application/json" --data @kurs/12/entscheidung-absage.json http://10.43.146.193:8080/api/bewerbungen/7aeb966e/entscheidung

Expected:

401

Step 8 – look for the decisions in the log. Here grep filters in a single stage by the event name.

# on werk1
kubectl -n lotse logs deploy/lotse | grep '"ereignis": "entscheidung'

Expected:

{"zeit": "2026-12-04T08:17:37+00:00", "ereignis": "entscheidung", "system": "Bewerbungslotse 1.1.0-rc3", "akte": "e35b8423", "ergebnis": "weiter", "vorschlag": "absage", "abweichung": true, "pruefer": "hr-01"}
{"zeit": "2026-12-04T08:17:38+00:00", "ereignis": "entscheidung", "system": "Bewerbungslotse 1.1.0-rc3", "akte": "ff85a953", "ergebnis": "weiter", "vorschlag": "weiter", "abweichung": false, "pruefer": "hr-01"}
{"zeit": "2026-12-04T08:17:39+00:00", "ereignis": "entscheidung", "system": "Bewerbungslotse 1.1.0-rc3", "akte": "b0ef4bd7", "ergebnis": "absage", "vorschlag": "absage", "abweichung": false, "pruefer": "hr-01"}
{"zeit": "2026-12-04T08:17:39+00:00", "ereignis": "entscheidung_abgelehnt", "system": "Bewerbungslotse 1.1.0-rc3"}

What you see: three inspection cards, one with abweichung: true, and the rejected attempt as entscheidung_abgelehnt. The reason for the override is only in the application file, not in the log.

Remember: An inspection card without a signature proves nothing. Code, time and suggestion belong in the application file, and every override leaves a line with abweichung: true in the log.

Save your progress? Sign up for free

Drill 4: Pull the cord

Where you are: on werk1.

What you have afterwards: the evidence that the Lotse accepts applications but does not rate them while the cord is pulled, and that the pull cord survives a restart.

Step 1 – create the two switch positions as files.

# on werk1
nano ~/kurs/12/stopp.json
~/kurs/12/stopp.json new file
{"stopp": true}
# on werk1
nano ~/kurs/12/weiter.json
~/kurs/12/weiter.json new file
{"stopp": false}

Step 2 – pull the cord.

# on werk1
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/stopp.json http://10.43.146.193:8080/api/admin/stopp

Expected:

{"ki":"gestoppt"}
# on werk1
curl -s http://10.43.146.193:8080/gesund

Expected:

{"ki":"gestoppt","status":"ok","version":"1.1.0-rc3"}

Step 3 – send an application and measure the time.

# on werk1
curl -s -w "%{http_code} %{time_total}s\n" -X POST -H "Content-Type: application/json" --data @kurs/00/bewerbung-mara.json http://10.43.146.193:8080/api/bewerbungen -o kurs/12/antwort-gestoppt.json
  • %{time_total}: total duration of the request in seconds.

Expected:

201 0.007088s

Step 4 – read the application file.

# on werk1
jq . kurs/12/antwort-gestoppt.json

Expected:

{
  "bewertung": null,
  "ki": {
    "art": "Stopptaste aktiv, Prüfung durch einen Menschen",
    "erzeugt": false,
    "system": "Bewerbungslotse 1.1.0-rc3"
  },
  "name": "Mara Klein",
  "nummer": "437c0b1f",
  "stelle": "Linux-Administratorin (m/w/d) mit Kubernetes-Erfahrung"
}

What you see: 201, the application has arrived. After 7 milliseconds instead of 20 seconds: the model was not asked. The application file states explicitly that no AI rated it. That is the safe state.

Step 5 – see the pull cord on the volume.

# on werk1
kubectl -n lotse exec deploy/lotse -- ls -l /daten/STOPP

Expected:

-rw-r--r-- 1 10001 10001 0 Dec  4 08:17 /daten/STOPP

Step 6 – does it survive a restart?

# on werk1
kubectl -n lotse rollout restart deploy/lotse
# on werk1
kubectl -n lotse rollout status deploy/lotse --timeout=120s

Expected:

Waiting for deployment "lotse" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "lotse" rollout to finish: 1 old replicas are pending termination...
deployment "lotse" successfully rolled out
# on werk1
curl -s http://10.43.146.193:8080/gesund

Expected:

{"ki":"gestoppt","status":"ok","version":"1.1.0-rc3"}

A restart does not release the pull cord. A colleague who “just restarts the hanging Lotse” does not accidentally switch the AI back on.

Step 7 – release the pull cord.

# on werk1
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/weiter.json http://10.43.146.193:8080/api/admin/stopp

Expected:

{"ki":"aktiv"}

Step 8 – commit the intermediate state.

# on werk1
git -C ~/lotse add app.py chart
# on werk1
git -C ~/lotse commit -m "1.1.0-rc3: Entscheidung durch einen Menschen, Stopptaste (Art. 14 AI Act)"
# on werk1
git -C ~/lotse log --oneline -1

Expected:

a6f3f93 1.1.0-rc3: Entscheidung durch einen Menschen, Stopptaste (Art. 14 AI Act)

Remember: You check a pull cord three times: does it work (no AI rating), does the line stay in operation (201 instead of 000), and does it stay pulled when someone restarts?

Save your progress? Sign up for free

Diagnosis task

The pull cord works when nothing is going on. But when do you need it? When the model is rating nonsense, that is, in the middle of operation. You pull it while a rating is running.

For this you need two terminals on werk1. date +%T before and after the command shows you the time, so that you can compare the two terminals.

The symptom.

Step 1 – send an application in terminal 1.

# on werk1, Terminal 1
date +%T
# on werk1, Terminal 1
curl -s -w "%{http_code} %{time_total}s\n" -X POST -H "Content-Type: application/json" --data @kurs/00/bewerbung-mara.json http://10.43.146.193:8080/api/bewerbungen -o kurs/12/antwort-waehrend.json

Step 2 – immediately pull the cord in terminal 2.

# on werk1, Terminal 2
date +%T
# on werk1, Terminal 2
curl -s -w " %{time_total}s\n" -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/stopp.json http://10.43.146.193:8080/api/admin/stopp
# on werk1, Terminal 2
date +%T

Expected in terminal 2 (your times differ; the three commands one below the other):

08:18:27
{"ki":"gestoppt"}
 18.942716s
08:18:46

Expected in terminal 1, followed by date +%T:

08:18:23
201 23.001748s
08:18:46

The pull cord took almost 19 seconds. Why? Think about it before you read on.

Solution path:

Step 1 – read the application file from terminal 1.

# on werk1
jq '{nummer, ki: .ki.erzeugt, passung: .bewertung.passung}' kurs/12/antwort-waehrend.json
  • ki: .ki.erzeugt: a new field name with the value from the application file.

Expected:

{
  "nummer": "10a17bef",
  "ki": true,
  "passung": 5
}

Step 2 – read the order in the log.

# on werk1
kubectl -n lotse exec deploy/lotse -- tail -n 2 /daten/protokoll/ereignisse-2026-12.jsonl

Expected:

{"zeit": "2026-12-04T08:18:46+00:00", "ereignis": "bewertung", "system": "Bewerbungslotse 1.1.0-rc3", "akte": "10a17bef", "modell": "qwen3:4b-instruct", "dauer_ms": 22997, "passung": 5}
{"zeit": "2026-12-04T08:18:46+00:00", "ereignis": "stopptaste", "system": "Bewerbungslotse 1.1.0-rc3", "stopp": true}

Step 3 – check how gunicorn starts.

# on werk1
grep -n "CMD" ~/lotse/Containerfile

Expected:

18:CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "300", "--worker-tmp-dir", "/tmp", "app:app"]

Cause: gunicorn runs with a single sync worker, and it handles exactly one request at a time. While it waits for the model, every other request waits in the queue, including the pull cord. The log proves it: stopptaste comes after bewertung, in the same second in which the rating finished. The pull cord waited a whole cycle. That was exactly the open gap h from Day 9 (“during a rating every request waits”), except that now it hits human oversight rather than availability.

Step 4 – release the pull cord again.

# on werk1
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/weiter.json http://10.43.146.193:8080/api/admin/stopp

Expected:

{"ki":"aktiv"}

Fix: several threads in gunicorn, so that one request doesn’t have to wait for another. You build this into the release in Drill 5 and measure again.

Remember: A pull cord that only takes effect after the next cycle is no pull cord. Measure the stop button under load, not when idle.

Drill 5: Release 1.1.0

Where you are: on werk1.

What you have afterwards: Bewerbungslotse 1.1.0 with four threads, signed, with the parts list as an attestation, scanned, in operation as revision 18, tag v1.1.0, and a pull cord that takes effect in 18 milliseconds.

Step 1 – four threads. --threads 4 lets the one worker handle four requests at the same time. For this, gunicorn switches by itself from sync to the worker type gthread.

# on werk1
nano ~/lotse/Containerfile
~/lotse/Containerfile changes in green
# Stufe 1: Pakete bauen – pip wird nur hier gebraucht
FROM docker.io/library/python:3.12-slim AS bau
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --target /app/pakete -r requirements.txt

# Stufe 2: Laufzeit – ohne pip, als eigener Benutzer
FROM docker.io/library/python:3.12-slim
# Debian-Sicherheitskorrekturen, die noch nicht im Grundimage stecken
RUN apt-get update && apt-get upgrade --yes && rm -rf /var/lib/apt/lists/*
RUN pip uninstall --yes pip
WORKDIR /app
COPY --from=bau /app/pakete /app/pakete
COPY app.py security.txt ./
ENV PYTHONPATH=/app/pakete
USER 10001:10001
EXPOSE 8080
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "300", "--threads", "4", "--worker-tmp-dir", "/tmp", "app:app"]

Step 2 – the write lock and the version. With four threads, two events may want to append to the log file at the same time. You announced this on Day 11. A lock lets only one write at a time. In addition, the Lotse now writes to the file first and only then to standard output: if the output fails, the mandatory line is still saved.

# on werk1
nano ~/lotse/app.py
~/lotse/app.py changes in green
"""Bewerbungslotse – sortiert Bewerbungen mit einem Sprachmodell vor."""

import hmac
import json
import os
import threading
import time
import uuid
from datetime import datetime, timezone
from pathlib import Path

import requests
from flask import Flask, abort, jsonify, request, send_file, send_from_directory

VERSION = "1.1.0"
OLLAMA = os.environ.get("OLLAMA_URL", "http://ollama:11434")
MODELL = os.environ.get("MODELL", "qwen3:4b-instruct")
ABLAGE = Path(os.environ.get("ABLAGE", "/daten"))
PROTOKOLL = ABLAGE / "protokoll"
# Stopptaste (Art. 14 Abs. 4 Buchst. e AI Act): solange die Datei existiert, bewertet der Lotse nicht
STOPP = ABLAGE / "STOPP"
# gunicorn mit mehreren Threads: immer nur einer hängt an die Protokolldatei an
SCHREIBSPERRE = threading.Lock()
# strip(): eine Passwortdatei endet meist mit einem Zeilenumbruch
ADMIN_PASSWORT = os.environ.get("ADMIN_PASSWORT", "").strip()

ANWEISUNG = (
    "Du hilfst einer Personalabteilung. Bewerte, wie gut die Bewerbung zur Stelle passt. "
    'Antworte nur mit JSON: {"passung": <Zahl von 1 bis 5>, "begruendung": "<ein Satz>"}'
)

# Kennzeichnung: Bewertung und Begründung stammen von einem KI-System (Art. 50, Art. 26 Abs. 11 AI Act)
KI_HINWEIS = {
    "erzeugt": True,
    "system": f"Bewerbungslotse {VERSION}",
    "modell": MODELL,
    "art": "Vorschlag eines KI-Systems, keine Entscheidung",
}

app = Flask(__name__)


def ereignis(art, **felder):
    """Fahrtenschreiber (Art. 12 AI Act): eine JSON-Zeile je Ereignis, ohne Namen und Texte."""
    jetzt = datetime.now(timezone.utc)
    zeile = {
        "zeit": jetzt.isoformat(timespec="seconds"),
        "ereignis": art,
        "system": f"Bewerbungslotse {VERSION}",
        **felder,
    }
    text = json.dumps(zeile, ensure_ascii=False)
    # zuerst die Datei (Pflicht nach Art. 12/19), dann die Standardausgabe
    with SCHREIBSPERRE:
        PROTOKOLL.mkdir(exist_ok=True)
        with open(PROTOKOLL / f"ereignisse-{jetzt:%Y-%m}.jsonl", "a") as datei:
            datei.write(text + "\n")
    print(text, flush=True)


@app.get("/.well-known/security.txt")
def security_txt():
    # Anlaufstelle für Sicherheitsmeldungen (RFC 9116)
    return send_file(Path(__file__).with_name("security.txt"), mimetype="text/plain")


def admin_pruefen(aktion):
    if not ADMIN_PASSWORT:
        abort(404)
    zugang = request.authorization
    if zugang is None or not hmac.compare_digest(zugang.password or "", ADMIN_PASSWORT):
        ereignis(f"{aktion}_abgelehnt")
        abort(401)


@app.get("/gesund")
def gesund():
    return {"status": "ok", "version": VERSION, "ki": "gestoppt" if STOPP.exists() else "aktiv"}


@app.post("/api/bewerbungen")
def bewerbung_anlegen():
    daten = request.get_json(force=True)
    if STOPP.exists():
        akte = {
            "nummer": uuid.uuid4().hex[:8],
            "name": daten["name"],
            "stelle": daten["stelle"],
            "bewertung": None,
            "ki": {
                "erzeugt": False,
                "system": f"Bewerbungslotse {VERSION}",
                "art": "Stopptaste aktiv, Prüfung durch einen Menschen",
            },
        }
        (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
        ereignis("bewertung_ausgesetzt", akte=akte["nummer"])
        return jsonify(akte), 201
    frage = f"Stelle: {daten['stelle']}\n\nBewerbung:\n{daten['text']}"
    beginn = time.monotonic()
    antwort = requests.post(
        f"{OLLAMA}/api/chat",
        json={
            "model": MODELL,
            "stream": False,
            "format": "json",
            "options": {"temperature": 0},
            "messages": [
                {"role": "system", "content": ANWEISUNG},
                {"role": "user", "content": frage},
            ],
        },
        timeout=300,
    )
    antwort.raise_for_status()
    bewertung = json.loads(antwort.json()["message"]["content"])
    akte = {
        "nummer": uuid.uuid4().hex[:8],
        "name": daten["name"],
        "stelle": daten["stelle"],
        "bewertung": bewertung,
        "ki": KI_HINWEIS,
    }
    (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
    ereignis(
        "bewertung",
        akte=akte["nummer"],
        modell=MODELL,
        dauer_ms=round((time.monotonic() - beginn) * 1000),
        passung=bewertung.get("passung"),
    )
    return jsonify(akte), 201


@app.get("/api/bewerbungen/<nummer>")
def bewerbung_lesen(nummer):
    akte = ABLAGE / f"{nummer}.json"
    if not nummer.isalnum() or not akte.exists():
        abort(404)
    ereignis("akte_gelesen", akte=nummer)
    return json.loads(akte.read_text())


@app.post("/api/bewerbungen/<nummer>/entscheidung")
def entscheiden(nummer):
    # Der Mensch entscheidet, das Modell schlägt nur vor (Art. 14 Abs. 4 Buchst. d AI Act)
    admin_pruefen("entscheidung")
    datei = ABLAGE / f"{nummer}.json"
    if not nummer.isalnum() or not datei.exists():
        abort(404)
    daten = request.get_json(force=True)
    if daten.get("ergebnis") not in ("weiter", "absage") or not daten.get("pruefer"):
        abort(400)
    akte = json.loads(datei.read_text())
    passung = (akte.get("bewertung") or {}).get("passung")
    vorschlag = None if passung is None else ("weiter" if passung >= 4 else "absage")
    akte["entscheidung"] = {
        "ergebnis": daten["ergebnis"],
        "pruefer": daten["pruefer"],
        "grund": daten.get("grund", ""),
        "zeit": datetime.now(timezone.utc).isoformat(timespec="seconds"),
        "vorschlag": vorschlag,
    }
    datei.write_text(json.dumps(akte, ensure_ascii=False))
    ereignis(
        "entscheidung",
        akte=nummer,
        ergebnis=daten["ergebnis"],
        vorschlag=vorschlag,
        abweichung=vorschlag is not None and daten["ergebnis"] != vorschlag,
        pruefer=daten["pruefer"],
    )
    return akte


@app.post("/api/admin/stopp")
def stopptaste():
    admin_pruefen("stopptaste")
    stopp = bool(request.get_json(force=True).get("stopp"))
    if stopp:
        STOPP.touch()
    else:
        STOPP.unlink(missing_ok=True)
    ereignis("stopptaste", stopp=stopp)
    return {"ki": "gestoppt" if stopp else "aktiv"}


@app.post("/api/bewerbungen/<nummer>/anlagen")
def anlage_hochladen(nummer):
    # nur zu einer vorhandenen Bewerbung, nie ".." (BW-2026-002)
    if not nummer.isalnum() or not (ABLAGE / f"{nummer}.json").exists():
        abort(404)
    datei = request.files["datei"]
    ordner = ABLAGE / "anlagen" / nummer
    ordner.mkdir(parents=True, exist_ok=True)
    datei.save(ordner / Path(datei.filename).name)
    return {"gespeichert": f"{nummer}/{Path(datei.filename).name}"}, 201


@app.get("/api/anlagen/<path:name>")
def anlage_herunterladen(name):
    # send_from_directory bleibt im Ordner, sonst 404 (BW-2026-001)
    return send_from_directory(ABLAGE / "anlagen", name)


@app.get("/api/admin/export")
def export():
    admin_pruefen("export")
    akten = [json.loads(p.read_text()) for p in sorted(ABLAGE.glob("*.json"))]
    ereignis("export", anzahl=len(akten))
    return akten
Line Change Why
6, 22–23 threading.Lock() one lock for all threads of the worker
15 1.1.0 the release
53–57 with SCHREIBSPERRE: only one thread at a time appends to the file
58 print after the file first the obligation, then the display

Step 3 – check the change.

# on werk1
git -C ~/lotse diff --stat

Expected:

 Containerfile |  2 +-
 app.py        | 13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

Step 4 – change into the repository.

# on werk1
cd ~/lotse

Step 5 – build the release. For a release, always with a fresh base image.

# on werk1
podman build --pull=always -t werk1:5000/bewerbungslotse:1.1.0 .

Expected (excerpt from the end):

[2/2] STEP 10/10: CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "300", "--threads", "4", "--worker-tmp-dir", "/tmp", "app:app"]
[2/2] COMMIT werk1:5000/bewerbungslotse:1.1.0
--> 13ffaf1335b9
Successfully tagged werk1:5000/bewerbungslotse:1.1.0
13ffaf1335b965f0d5d1fe30a00fbf214b84f2ae61d1416e456ea80d7bac900a

Step 6 – push and record the digest.

# on werk1
podman push --digestfile ~/kurs/12/digest-1.1.0 werk1:5000/bewerbungslotse:1.1.0
# on werk1
cat ~/kurs/12/digest-1.1.0

Expected (your digest differs):

sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618

Step 7 – sign and verify. As on Day 7. Cosign asks for the key’s password (~/geheim/cosign-passwort). Insert your digest.

# on werk1
cosign sign --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618

Expected (excerpt):

Pushing signature to: werk1:5000/bewerbungslotse
# on werk1
cosign verify --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618

Expected (excerpt): the line - The signatures were verified against the specified public key.

Step 8 – create the parts list.

# on werk1
syft scan registry:werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618 --source-name bewerbungslotse --source-version 1.1.0 -o cyclonedx-json=$HOME/lotse/sbom/bewerbungslotse-1.1.0.cdx.json -o spdx-json=$HOME/lotse/sbom/bewerbungslotse-1.1.0.spdx.json

You know the options from Day 7.

# on werk1
jq '.components | length' ~/lotse/sbom/bewerbungslotse-1.1.0.cdx.json

Expected:

2787
# on werk1
jq '.components | length' ~/lotse/sbom/bewerbungslotse-1.0.2.cdx.json

Expected:

2787

What you see: the same number of components as 1.0.2. Only your own code has changed, no dependency.

Step 9 – attach the parts list to the image.

# on werk1
cosign attest --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes --type cyclonedx --predicate $HOME/lotse/sbom/bewerbungslotse-1.1.0.cdx.json werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618
# on werk1
cosign tree --allow-http-registry werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618

Expected:

📦 Supply Chain Security Related artifacts for an image: werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618
└── 🔗 https://sigstore.dev/cosign/sign/v1 artifacts via OCI referrer: werk1:5000/bewerbungslotse@sha256:85397c52b107ac6dd51b415797054d0d68d38c2d2e665478a1565b1a6045ad42
   └── 🍒 sha256:99a95725c85fe5f33298b92dae80bbb60692a3210bc217d8cf61eab638da02ab
└── 🔗 https://cyclonedx.org/bom artifacts via OCI referrer: werk1:5000/bewerbungslotse@sha256:3ff54e0d9f6d8e6c8b36f08593b60acf95def230556629158780e324db647eb0
   └── 🍒 sha256:2788f82d2e96170c1f7daea5b2450e41269c72400a444b1b0a731789bca008e8

Signature and parts list are attached to the image. The VEX file for 1.1.0 is added on Day 14, when you raise the technical documentation to 1.1.0.

Step 10 – scan.

# on werk1
grype registry:werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618 -o json --file ~/lotse/scans/grype-1.1.0.json
# on werk1
jq '.matches | length' ~/lotse/scans/grype-1.1.0.json

Expected:

231

What you see: 231 matches without VEX. On Day 9 there were 228 matches for 1.0.2 with VEX plus 3 hidden ones, so 231 in total as well. When the course was written, a comparison by vulnerability and package produced two identical lists: the release brings no new vulnerability, but no fewer either.

Step 11 – the chart to 1.1.0.

# on werk1
nano ~/lotse/chart/Chart.yaml
~/lotse/chart/Chart.yaml changes in green
apiVersion: v2
name: bewerbungslotse
description: Sortiert Bewerbungen mit einem Sprachmodell vor
type: application
version: 1.1.0
appVersion: "1.1.0"
# on werk1
nano ~/lotse/chart/values.yaml
~/lotse/chart/values.yaml changes in green
lotse:
  # Tag zum Lesen, Digest zum Laden: genau das signierte Image
  image: werk1:5000/bewerbungslotse:1.1.0@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618
  # Pflichtwert, kein Standardpasswort: --set lotse.adminPasswort=…
  adminPasswort: ""
  service:
    # ClusterIP: nur im Cluster erreichbar; NodePort nur bewusst setzen
    typ: ClusterIP
    nodePort: 30080
  speicher: 1Gi
  protokoll:
    # Zugriffsprotokoll von gunicorn (CRA Anhang I Teil I Nr. 2 Buchst. l); false schaltet es ab
    zugriffe: true
    # Ereignisdateien mindestens sechs Monate aufbewahren (Art. 19 und Art. 26 Abs. 6 AI Act)
    aufbewahrungTage: 210

ollama:
  image: docker.io/ollama/ollama:0.40.19
  modell: qwen3:4b-instruct
  knoten: werk1
  speicher: 10Gi

# NetworkPolicies: nur der Lotse darf Ollama erreichen
netzwerkregeln: true

Step 12 – roll out.

# on werk1
helm upgrade lotse ~/lotse/chart -n lotse --set-file lotse.adminPasswort=$HOME/geheim/admin-passwort --wait --timeout 5m

Expected (excerpt):

Release "lotse" has been upgraded. Happy Helming!
NAME: lotse
LAST DEPLOYED: Fri Dec  4 08:21:23 2026
NAMESPACE: lotse
STATUS: deployed
REVISION: 18
DESCRIPTION: Upgrade complete
TEST SUITE: None
NOTES:
Bewerbungslotse 1.1.0 (Chart 1.1.0) ist installiert.
# on werk1
kubectl -n lotse logs deploy/lotse --tail=20

Expected (excerpt from the beginning):

[2026-12-04 08:21:26 +0000] [1] [INFO] Starting gunicorn 22.0.0
[2026-12-04 08:21:26 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2026-12-04 08:21:26 +0000] [1] [INFO] Using worker: gthread
[2026-12-04 08:21:26 +0000] [7] [INFO] Booting worker with pid: 7

Using worker: gthread, no longer sync.

Step 13 – measure the pull cord under load again. The same two terminals as in the diagnosis, again with date +%T before and after each command.

# on werk1, Terminal 1
curl -s -w "%{http_code} %{time_total}s\n" -X POST -H "Content-Type: application/json" --data @kurs/00/bewerbung-mara.json http://10.43.146.193:8080/api/bewerbungen -o kurs/12/antwort-1.1.0.json
# on werk1, Terminal 2
curl -s -w " %{time_total}s\n" -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/stopp.json http://10.43.146.193:8080/api/admin/stopp

Expected in terminal 2 (with date +%T before and after):

08:21:41
{"ki":"gestoppt"}
 0.018126s
08:21:42

Expected in terminal 1 (with date +%T before and after):

08:21:37
201 7.868018s
08:21:45

What you see: The pull cord takes effect in 18 milliseconds instead of 19 seconds, even though the rating in terminal 1 keeps running for another three seconds. With the model warmed up, the rating itself was faster than in the diagnosis. What happened to it is something you investigate in the Challenge.

Step 14 – release the pull cord.

# on werk1
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/weiter.json http://10.43.146.193:8080/api/admin/stopp

Expected:

{"ki":"aktiv"}

Step 15 – update the risk assessment. h and l are implemented in 1.1.0. The complete reassessment for 1.1.0 follows on Day 14.

# on werk1
nano ~/lotse/doku/risikobewertung.md
~/lotse/doku/risikobewertung.md changes in green
# Bewertung der Cybersicherheitsrisiken (Art. 13 Abs. 3, Anhang VII Nr. 3)

Produkt: Bewerbungslotse 1.0.2 · Stand: 2026-12-04 · Nächste Prüfung: bei jeder Version

## Grundlage

- Zweckbestimmung: Bewerbungen mit einem Sprachmodell vorsortieren
  (Passung 1 bis 5 mit Begründung), Entscheidung trifft ein Mensch.
- Vorhersehbare Fehlanwendung: Dienst per NodePort ins Internet stellen,
  Bewertung ungeprüft als Absage verwenden.
- Betriebsumgebung: Kubernetes beim gewerblichen Betreiber, eigenes Ollama im Cluster.
- Zu schützende Werte: Bewerberdaten (personenbezogen), Bewertungen, Verfügbarkeit.
- Nutzungsdauer: bis 12/2032 (Unterstützungszeitraum, PRODUKT.md).

## Anhang I Teil I Nr. 2

| Buchst. | Anforderung | anwendbar | Umsetzung | Nachweis | Stand |
|---|---|---|---|---|---|
| a | ohne bekannte ausnutzbare Schwachstellen | ja | Updates 1.0.1/1.0.2, VEX für nicht Betroffenes | pruefberichte/1.0.2/grype-vex.json | erfüllt |
| b | sichere Standardkonfiguration, Zurücksetzen | ja | kein Standardpasswort, ClusterIP, --reset-values | pruefberichte/1.0.2/trivy-config.json | erfüllt |
| c | Sicherheitsupdates | ja | signierte Versionen, helm upgrade; kein Automatismus, weil Betreiber Wartungsfenster plant | SECURITY.md, csaf/ | erfüllt |
| d | Schutz vor unbefugtem Zugriff, Meldung | ja | Export mit Passwort; Akten ohne Anmeldung lesbar, keine Meldung | – | offen |
| e | Vertraulichkeit | ja | nur im Cluster; kein TLS Lotse–Ollama, Akten unverschlüsselt | – | offen |
| f | Integrität | ja | signierte Images, Dateisystem nur lesbar, BW-2026-002 behoben | pruefberichte/1.0.2/cosign-verify.json | erfüllt |
| g | Datenminimierung | ja | Akte speichert Name, Stelle, Bewertung, nicht den Bewerbungstext | – | erfüllt |
| h | Verfügbarkeit | ja | 1.1.0: gunicorn mit 4 Threads; Stopptaste antwortet während einer Bewertung in 0,018 s statt 18,9 s | Containerfile | umgesetzt in 1.1.0 |
| i | Auswirkung auf andere Dienste | ja | CPU und Speicher begrenzt | chart/templates/lotse.yaml | erfüllt |
| j | geringe Angriffsfläche | ja | ClusterIP, NetworkPolicies, ohne pip | PRODUKT.md | erfüllt |
| k | Auswirkungen begrenzen | ja | Benutzer 10001, keine Capabilities, kein SA-Token | pruefberichte/1.0.2/trivy-config.json | erfüllt |
| l | Aufzeichnung, Opt-out | ja | Ereignisprotokoll ohne Namen, Zugriffsprotokoll abschaltbar (lotse.protokoll.zugriffe) | chart/values.yaml, chart/templates/protokoll-aufraeumen.yaml | umgesetzt in 1.1.0 |
| m | Daten sicher löschen | ja | helm uninstall entfernt PVC lotse-daten; keine Einzellöschung | – | offen |

## Anhang I Teil I Nr. 1 und Teil II

- Nr. 1 (angemessenes Niveau): über die Tabelle oben, offene Punkte unten.
- Teil II Nr. 1–8: Stückliste, Behandlung, Tests, Hinweise, CVD-Konzept,
  Kontaktadresse, sichere Verteilung, kostenlose Updates – siehe README.md Nr. 2 b.

## Offene Punkte (vor dem Inverkehrbringen zu schließen)

- d/e: Anmeldung für das Lesen von Akten, TLS zum Modell
- h: mehrere Worker oder Threads – umgesetzt in 1.1.0
- l: Zugriffs- und Entscheidungsprotokoll mit Opt-out – umgesetzt in 1.1.0
- m: Einzelne Akte löschen
# on werk1
grep -c "| offen |" ~/lotse/doku/risikobewertung.md

Expected:

3

Still open are d, e and m.

Step 16 – commit and tag.

# on werk1
git -C ~/lotse add Containerfile app.py chart doku/risikobewertung.md sbom/bewerbungslotse-1.1.0.cdx.json sbom/bewerbungslotse-1.1.0.spdx.json scans/grype-1.1.0.json
# on werk1
git -C ~/lotse commit -m "Bewerbungslotse 1.1.0: Kennzeichnung, Fahrtenschreiber, menschliche Aufsicht mit Stopptaste, 4 Threads"
# on werk1
git -C ~/lotse tag v1.1.0
# on werk1
git -C ~/lotse log --oneline --decorate -1

Expected:

9781e7f (HEAD -> main, tag: v1.1.0) Bewerbungslotse 1.1.0: Kennzeichnung, Fahrtenschreiber, menschliche Aufsicht mit Stopptaste, 4 Threads

Back to the home directory:

# on werk1
cd

Remember: A release is only finished when it is signed, described (parts list) and scanned, and when the defect you found has been measured again under the same conditions.

Save your progress? Sign up for free

Challenge

Two questions for your log:

  1. Automation bias: How many decisions has hr-01 made, and how many of them against the suggestion?
  2. The pull cord: In Drill 5 a rating was running while you pulled. Did it finish anyway? What follows from that?

Solution:

Step 1 – fetch a fresh copy of the log.

# on werk1
kubectl -n lotse exec deploy/lotse -- cat /daten/protokoll/ereignisse-2026-12.jsonl > ~/kurs/12/ereignisse.jsonl
# on werk1
wc -l ~/kurs/12/ereignisse.jsonl

Expected:

18 /home/ubuntu/kurs/12/ereignisse.jsonl

Step 2 – the override rate.

# on werk1
jq -s 'map(select(.ereignis == "entscheidung")) | {gesamt: length, abweichend: (map(select(.abweichung)) | length)}' ~/kurs/12/ereignisse.jsonl
  • -s: collect all lines into one list.
  • {gesamt: …, abweichend: …}: an object with two computed fields.
  • map(select(.abweichung)): only decisions in which abweichung is true.

Expected:

{
  "gesamt": 3,
  "abweichend": 1
}

What you see: One of three decisions went against the model. With three application files the number says nothing. Over months, however, it is the best early warning sign of automation bias: if the rate is zero although the model demonstrably makes mistakes (Day 13), the inspector is just nodding things through. This metric belongs in the post-market monitoring under Article 72 that you plan on Day 14.

Step 3 – pull cord and ratings in chronological order.

# on werk1
jq -c 'select(.ereignis == "stopptaste" or .ereignis == "bewertung") | {zeit, ereignis, akte, stopp}' ~/kurs/12/ereignisse.jsonl

Expected:

{"zeit":"2026-12-04T08:06:22+00:00","ereignis":"bewertung","akte":"e35b8423","stopp":null}
{"zeit":"2026-12-04T08:17:55+00:00","ereignis":"stopptaste","akte":null,"stopp":true}
{"zeit":"2026-12-04T08:18:12+00:00","ereignis":"stopptaste","akte":null,"stopp":false}
{"zeit":"2026-12-04T08:18:46+00:00","ereignis":"bewertung","akte":"10a17bef","stopp":null}
{"zeit":"2026-12-04T08:18:46+00:00","ereignis":"stopptaste","akte":null,"stopp":true}
{"zeit":"2026-12-04T08:19:01+00:00","ereignis":"stopptaste","akte":null,"stopp":false}
{"zeit":"2026-12-04T08:21:42+00:00","ereignis":"stopptaste","akte":null,"stopp":true}
{"zeit":"2026-12-04T08:21:45+00:00","ereignis":"bewertung","akte":"1143670d","stopp":null}
{"zeit":"2026-12-04T08:22:24+00:00","ereignis":"stopptaste","akte":null,"stopp":false}

What you see: the last two lines but one. At 08:21:42 the pull cord was pulled; at 08:21:45 the Lotse nevertheless saved an AI rating for 1143670d. The pull cord prevents new ratings, but it does not abort one that is already running.

What follows from that? Two honest ways:

  • Document it: The instructions for use (Day 14) need the sentence: “Eine bereits laufende Bewertung wird nach Betätigen der Stopptaste noch abgeschlossen (höchstens 300 Sekunden).” (A rating that is already running is still completed after the stop button is pressed – at most 300 seconds.) The person assigned to oversight then knows that they have to check application files from this time window, and the log shows them which ones.
  • Improve it: After the model’s response, the Lotse checks once more whether STOPP exists and then discards the rating. That would be a change for 1.1.1.

Which way you take is a judgement under Article 14(3): “commensurate with the risks, level of autonomy and context of use”. The only wrong thing would be not to know about the case.

Remember: The log is also the test bench for oversight itself. It shows whether the inspector overrides and whether the pull cord really stops everything.

Save your progress? Sign up for free

Checkpoint

# on werk1
helm list -n lotse

Expected:

NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART                   APP VERSION
lotse   lotse       18          2026-12-04 08:21:23.03227624 +0000 UTC  deployed    bewerbungslotse-1.1.0   1.1.0
# on werk1
curl -s http://10.43.146.193:8080/gesund

Expected:

{"ki":"aktiv","status":"ok","version":"1.1.0"}
# on werk1
git -C ~/lotse tag

Expected:

chart-1.0.3
v1.0.0
v1.0.1
v1.0.2
v1.1.0
# on werk1
cosign verify --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry -o text werk1:5000/bewerbungslotse@sha256:620a1a57d93ac4f21308471b32d700161c754900327c0e9b8aeba31a225b9618

Expected (excerpt): the line - The signatures were verified against the specified public key.

# on werk1
grep -c "| offen |" ~/lotse/doku/risikobewertung.md

Expected:

3

Test yourself

  1. Why is kubectl scale --replicas=0 not a stop button within the meaning of Article 14(4)(e)?
  2. What is in the application file when a human decides against the suggestion, and which part of it is in the log?
  3. Why does the pull cord lie as a file on the volume and not in a variable in the program?
  4. When idle, the stop button responds in milliseconds. Why is this measurement not enough?
  5. What does an override rate of 0 % over half a year show, and why is it a warning sign?
  6. Why does ereignis() need a lock from 1.1.0 onwards?

Answers:

  1. It locks up the factory: applications no longer arrive (HTTP 000). A safe state keeps accepting them and only stops the AI from rating.
  2. In the application file: result, inspector code, reason, time and suggestion. In the log: file, result, suggestion, abweichung: true and the code, but not the reason, because free text can contain personal data.
  3. A variable would be back on “aktiv” (active) after every restart. The file survives restarts and applies to every pod that mounts the volume.
  4. It is needed when the model is busy. With a sync worker it then waited 18.9 seconds until the running rating was finished.
  5. That the inspector never decides against the model. Since the model demonstrably makes mistakes, this points to automation bias (Article 14(4)(b)): the human is just nodding things through.
  6. With four threads, two requests can write an event at the same time. The lock ensures that only one appends to the file at a time and no line gets torn apart.

Interview note

“How do you implement human oversight technically?” A weak answer says: “A human takes a look at it.” A strong answer names the built-in measures under Article 14(3)(a): a decision path on which the model only suggests, an inspection card with code and suggestion in the application file, a logged deviation, a stop button that establishes a safe state instead of switching off the service. Plus two measurements: the stop button’s response time under load and the override rate as an indicator of automation bias. Whoever also knows that a running rating still finishes after the stop, and says so in the instructions for use, has not only built oversight but tested it.

Enterprise note

In larger organisations the stop button is not tied to a Basic Auth password but to a role in the identity system (for example “KI-Aufsicht Personal”, AI oversight HR), and the inspector code comes from the login instead of from the form. The override rate flows as a metric into a dashboard with a threshold and an alert. Many deployers also require a four-eyes principle for rejections after a poor AI score. Article 14(5) prescribes this only for biometric identification, but it is an obvious measure under paragraph 3, point (b), which the provider can recommend and the deployer can implement.

Summary

  • Article 14 requires that natural persons can effectively oversee the system; paragraph 4, points (d) and (e) require override and a stop button with a safe state.
  • kubectl scale --replicas=0 loses applications (HTTP 000). The Lotse’s stop button accepts but does not rate (201 in 7 ms, ki.erzeugt: false) and survives restarts.
  • The decision path saves result, code, reason and suggestion in the application file. The log shows every override as abweichung: true.
  • With a sync worker the stop button needed 18.9 s under load. With four threads (gthread) it is 18 ms. This also implements gap h.
  • A running rating still finishes after the stop. That belongs in the instructions for use or in an improvement.
  • Release 1.1.0: signed, parts list attested, 231 matches as for 1.0.2, revision 18, tag v1.1.0.

Commands at a glance

Command Purpose
jq 'keys' <application-file> which fields an application file has
kubectl -n <ns> scale deploy/<name> --replicas=0 terminate all pods (not a safe state)
kubectl -n <ns> wait --for=delete pod -l app=<name> --timeout=60s wait until pods have disappeared
curl … --max-time 10 give up after ten seconds
curl -s -u admin -X POST … --data @<inspection-card> <url>/api/bewerbungen/<no>/entscheidung decide as a human
curl -s -u admin -X POST … --data @stopp.json <url>/api/admin/stopp pull or release the stop button
curl -s -w "%{http_code} %{time_total}s\n" … measure status and duration
kubectl -n <ns> logs deploy/<name> \| grep '"ereignis": "entscheidung' decisions in the log
podman build --pull=always -t <image>:<version> . release with a fresh base image
cosign sign / cosign verify / cosign attest --type cyclonedx / cosign tree sign, verify, attach parts list, view
syft scan registry:<image>@<digest> … create the parts list
grype registry:<image>@<digest> -o json --file <file> scan for vulnerabilities
jq -s 'map(select(.ereignis == "entscheidung")) \| {…}' <log> override rate
git -C ~/lotse tag v<version> tag the release

Contents

More