ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

KI-Audit: Ein Status allein ist kein Nachweis für Agenten-Aktionen

Eine Runtime erlaubt KI-Agents Schreiboperationen in Unternehmenssystemen, etwa Datensätze anzulegen oder Serviceanfragen zu senden. Jede Aktion ist an Berechtigungen, Freigaben und nachvollziehbare Protokolle gebunden.

dev.toMontag 02:04 · 23.11.DE6 Min. Lesezeit
Bild: dev.to

Wir bauen eine Runtime, die es KI-Agenten erlaubt, echte Schreibaktionen in Unternehmenssystemen auszuführen: einen Datensatz anlegen, eine Anfrage an einen anderen Service senden. Jede Aktion trägt Berechtigungen, Freigaben und einen Eintrag, den jemand danach überprüfen kann.

Nachdem eine Autorisierung widerrufen wurde, kann sie drei Ebenen von Aufzeichnungen übergeben: was die Anfrage erlaubt hat, ob der laufende Aufruf gestoppt wurde und ob der Effekt, der bereits am Ziel angekommen ist, dort noch vorhanden ist. Dieser Text handelt von der dritten Ebene, der Abstimmung.

Eine Prüfung muss wissen, ob der Schreibvorgang überhaupt stattgefunden hat. "Er fand nicht statt" und "er fand statt und wurde später gelöscht" sind unterschiedliche Dinge; wenn man sie nicht unterscheiden kann, schreibt die Aufzeichnung zwei Ereignisse in einen Satz zusammen, ein Status ist kein Beleg.

Ein ausgehender Schreibvorgang läuft in einen Timeout. Die Anfrage mag das Ziel erreicht haben oder nicht; der Claim bleibt im Zustand claimed. Die Antwort kann nur vom Ziel kommen: eine einzige read-only-Abfrage, "habt ihr diesen Key ausgeführt". Ja, und die Zeile wird abgeschlossen; nein, und die Zeile wird freigegeben, sodass ein Wiederholungsversuch erlaubt ist; alles andere bleibt unbekannt.

Unsere Dokumentation nennt dies Evidence, Nachweis: read-only, eine Zeile pro Anfrage, append-only, Schweigen ist nie eine Antwort. Das Problem mit dieser Beschreibung kam von einer Leserin.

"Diese Lücke zwischen "ist es jetzt dort" und "wurde dieser Key jemals akzeptiert" ist genau der Ort, an dem eine Rückgängigmachung am Ziel von einer Anfrage, die nie angekommen ist, nicht mehr zu unterscheiden ist."

Die Leserin ist präziser als die Dokumentation. Die Probe sendet "habt ihr diesen Key ausgeführt", aber das Einzige, was zurückkommen kann, ist "existiert dieses Objekt jetzt". Für etwas, das noch vorhanden ist, stimmen die Antworten überein; für etwas, das da war und später gelöscht oder rückgängig gemacht wurde, fallen sie auseinander: der Status sagt "nicht da", ein Beleg sagt "akzeptiert".

Die Probe sendet ein einziges GET, wiederholt nicht und zählt nur ein explizites "nicht ausgeführt" als Antwort; alles andere ist unbekannt. Das verhindert, dass Schweigen als "es lief nie" gelesen wird. Was es nicht verhindert: "jetzt nicht da" war nie eine Aussage über die Vergangenheit.

Zwei Historien, eine Lesart: nie angekommen, und angekommen dann rückgängig gemacht, beide werden zu not_executed und geben den Claim frei.

Die eine Lesart ist die der Entsorgung: eine festhängende Zeile braucht ein Ende, und jede Antwort, die sie schließen lässt, genügt. Sie sagt "jetzt nicht da", wir schließen die Zeile, ein Wiederholungsversuch ist erlaubt.

Die andere ist die des Nachweises: nicht wie die Zeile endet, sondern ob der Schreibvorgang stattfand, in einer Form, die eine dritte Partei überprüfen kann. In dieser Lesart sagt "jetzt nicht da" nichts über die Vergangenheit aus.

Wir haben die Hälfte von jedem geschrieben. Der Mechanismus ist Entsorgung, ein GET, eine Stichprobe. Die Dokumentation ist Nachweis, so heißt er nämlich. Die Unstimmigkeit steckt nicht im Code: uns ist nicht aufgefallen, dass die beiden verschieden sind.

Entsorgung zahlt sich sichtbar aus: ein am Ziel rückgängig gemachter Effekt liest sich hier als "nie angekommen". Nachweis zahlt sich dort aus, wo wir keine Kontrolle haben: Der Beleg muss vom Ziel aufbewahrt werden. Der Key ist bereits geteilt, mit dem Schreibvorgang erzeugt, also ist ein Beleg billig, billig ist nicht dasselbe wie vorhanden.

Ein Agent stellt eine Rückerstattung aus. Es kommt zum Timeout. Eine Stunde später geht die automatische Nachfrage hinaus, das Ziel antwortet not_executed, der Claim wird mit releaseReason gesetzt auf target_status_not_executed zu released, und ein Wiederholungsversuch ist erlaubt.

Wenn diese Rückerstattung das Ziel doch erreichte und vierzig Minuten später rückgängig gemacht wurde, eine manuelle Korrektur, eine Batch-Abstimmung, eine Aufbewahrungsregel, gibt die nächste Abfrage wieder not_executed zurück. In unserem Ledger sind die beiden Ereignisse identisch: eines, das nie ankam, und eines, das ankam und gelöscht wurde.

Der Pfad bewegt sich weiter. released erlaubt einen erneuten Claim; der Wiederholungsversuch löscht releaseReason und erhöht attempts. Der Claim beschreibt jetzt nur noch den zweiten Versuch, und der erste, der angefragt und für nicht ausgeführt erklärt wurde, überlebt als ein paar Zeilen in der Lookup-Tabelle. Niemand, der den Claim liest, kann erkennen, dass hier ein nicht reproduzierbares Urteil gefällt wurde. Und wenn das Ziel nicht anhand des Keys dedupliziert, ist dieser Wiederholungsversuch ein echter Doppelschreibvorgang.

Der Vorschlag der Leserin ist klar: eine append-only-Liste akzeptierter Keys mit Zeitstempeln auf Zielseite würde die Lücke schließen. Wir stimmen zu.

Sie beantwortet "wurde er jemals akzeptiert", nicht "ist er noch da". Der Beleg sagt akzeptiert, der Status sagt nicht da: es geschah und wurde später rückgängig gemacht. Zeichnet die Zeile "ausgeführt" auf oder "ausgeführt und seither rückgängig gemacht"? Das Erste ist wahr und unvollständig; das Zweite verlangt, dass wir von einer Rückgängigmachung wissen, die möglicherweise nie über uns lief. Nur ein Beleg, der sagt, dass der Key nie akzeptiert wurde, schließt die Zeile sauber ab.

Die Grenze ist härter: Ein Beleg deckt nur Schreibvorgänge ab, die den Key tragen. Eine andere Integration, ein Batch-Job, ein Mensch, der den Datensatz zurückändert, jeder davon kann den Effekt spurlos verschwinden lassen. Notwendig, nicht hinreichend.

Und das Wort selbst. not_executed von einem Ziel kann bedeuten "wir sind sicher, dass dieser Key nie akzeptiert wurde" oder "wir haben ihn gerade nicht". Das Erste ist kausal; das Zweite ist eine einzelne Leseoperation, und der Lese-Pfad des Ziels kann eventual konsistent oder gecacht sein. Wir behandeln beide als das Erste, und die Probe fragt nur einmal, ohne Wiederholung, sodass eine Leseoperation, die noch nicht aufgeholt hat, zum letzten Wort wird.

Das Erste, was wir tun wollen, ist klein: jede Evidence-Zeile mit der Art der Lesung zu kennzeichnen, aktueller Zustand oder Beleg. Heute gibt es kein solches Feld: reason wird nur gefüllt, wenn das Ergebnis unbekannt ist, und ist bei einer echten Antwort null, sodass beide echten Antworten identisch aussehen. Die Tabelle existiert, damit "nie gefragt" und "gefragt und keine Antwort erhalten" nicht dieselbe Lesung sind; diese Überlegung wurde nicht auf die zweite Achse angewendet.

Das ist eine Lücke, keine Implementierung. Spalte, Migration, Schreib-Pfad und Lese-Oberfläche stehen alle noch aus.

Mit der Spalte an Ort und Stelle bleibt das eigentliche Problem. Wir zeichnen unsere eigene Stichprobe des Ziels auf, nicht die Historie des Ziels. Jede Abfrage ist eine Stichprobe des aktuellen Zustands; aufgeschichtet rekonstruieren sie, was das Ziel sagte, und wann. Keine dieser Stichproben ist Historie, also kann keine "wurde dieser Key jemals akzeptiert" beantworten. Nur das System, das die Historie hält, kann das, und wir kontrollieren es weder noch sollten wir dafür geradestehen.

Und es gibt eine engere Grenze. Ein Wechsel ist nur sichtbar, wenn eine Stichprobe in das Fenster fällt, in dem der Effekt noch existierte. Unser Rhythmus liegt in Stunden: etwas, das innerhalb von zehn Minuten erzeugt und rückgängig gemacht wurde, liest sich bei jeder Stichprobe als not_executed. Zeitstempel machen die Aufzeichnung ehrlich darüber, was wir sahen; sie können sie nicht vollständig machen über das, was geschah.

Die Frage ist also nicht, ob eine Spalte hinzukommen soll:

Wenn die dritte Ebene nur liefern kann "wir haben gefragt, und das ist es, was das Ziel damals sagte", verdient sie dann den Namen Abstimmung? Oder war sie immer ein Protokoll von Lesungen, und die Antwort, die die Prüfung braucht, war nie darin enthalten?

Die hier beschriebene Implementierung stammt aus dem Open-Source-Projekt KeelBase:

https://github.com/rain6fish/KeelBase Mit Unterstützung eines KI-Assistenten entworfen. Das System, die Positionen und die Fehler sind meine.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

We build a runtime that lets AI agents take real write actions inside enterprise systems: create a record, send a request to another service. Every action carries permissions, approvals, and a record someone can review afterwards.

After an authorization is revoked, it can hand over three layers of record: what allowed the request, whether the in-flight call stopped, and whether the effect that already landed at the target is still there. This piece is about the third — reconciliation.

An audit needs to know whether the write happened at all. "It did not" and "it did, and was later erased" are different things; when they cannot be told apart, the record writes two events as one sentence — a status is not a receipt.

An outbound write times out. The request may have reached the target, or not; the claim sits at claimed. The answer can only come from the target: one read-only query, "did you execute this key". Yes, and the row settles; no, and the row is released, so a retry is allowed; anything else stays unknown.

Our documentation calls this evidence — read-only, one row per ask, append-only, silence is never an answer. The problem with that description came from a reader.

"That gap between 'is it there now' and 'was this key ever accepted' is exactly where a reversal at the target becomes indistinguishable from a request that never arrived."

The reader is more precise than the documentation. The probe sends "did you execute this key", but the only thing that can come back is "does this object exist now". For something still present the answers coincide; for something that was there and was later deleted or reversed, they come apart — status says "not there", a receipt says "accepted".

The probe sends one GET, does not retry, and counts only an explicit "not executed" as an answer; everything else is unknown. That stops silence from being read as "it never ran". What it does not stop: "not there now" was never a statement about the past.

Two histories, one reading: never arrived, and landed then reversed, both become not_executed and release the claim

One reading is disposal: a stuck row needs an ending, and any answer that lets us close it will do. It says "not there now", we close the row, a retry is allowed.

The other is evidence: not how the row ends but whether the write happened, in a form a third party can review. Under this reading, "not there now" says nothing about the past.

We wrote half of each. The mechanism is disposal — one GET, one sample. The documentation is evidence — that is what it is called. The mismatch is not in the code: we did not notice the two were different.

Disposal pays visibly: an effect reversed at the target reads here as "never arrived". Evidence pays where we have no control: the receipt has to be kept by the target. The key is already shared, minted with the write, so a receipt is cheap — cheap is not the same as present.

An agent issues a refund. It times out. An hour later the automatic re-ask goes out, the target answers not_executed, the claim becomes released with releaseReason set to target_status_not_executed, and a retry is allowed.

If that refund did reach the target and was reversed forty minutes later — a manual correction, a batch reconciliation, a retention rule — the next query returns not_executed again. In our ledger the two events are identical: one that never arrived, one that arrived and was erased.

The path keeps moving. released permits a re-claim; the retry clears releaseReason and increments attempts. The claim now describes the second attempt only, and the first — asked about, told it did not run — survives as a few rows in the lookup table. Nobody reading the claim can tell an unreproducible judgement happened here. And if the target does not deduplicate by the key, that retry is a real double write.

The reader's suggestion is clear: an append-only list of accepted keys with timestamps on the target side would close the gap. We agree.

It answers "was it ever accepted", not "is it still there". Receipt says accepted, status says not there: it happened and was later reversed. Does the row record "executed", or "executed and since reversed"? The first is true and incomplete; the second needs us to know about a reversal that may never have passed through us. Only a receipt saying the key was never accepted closes the row cleanly.

The boundary is harder: a receipt covers only writes that carry the key. Another integration, a batch job, a person editing the record back — any of them can make the effect disappear without a trace. Necessary, not sufficient.

And the word itself. not_executed from a target can mean "we are certain this key was never accepted" or "we do not have it right now". The first is causal; the second is one read, and the target's read path may be eventually consistent or cached. We treat both as the first — and the probe asks once, without retrying, so a read that has not caught up becomes the final word.

The first thing we intend to do is small: label each evidence row with the kind of reading it is — current state or receipt. Today it has no such field: reason is filled only when the conclusion is unknown, and is null for a real answer, so both real answers look identical. The table exists so that "never asked" and "asked and got no answer" are not the same reading; that reasoning was not applied to the second axis.

That is a gap, not an implementation. Column, migration, write path and read surface are all still to do.

With the column in place, the real problem is still there. We record our own sampling of the target, not the target's history. Each query is one sample of the current state; stacked up they reconstruct what the target said, and when. Not one of those samples is history, so none can answer "was this key ever accepted". Only the system holding the history can, and we neither control it nor should answer for it.

And there is a narrower limit. A flip is only visible if one sample lands inside the window when the effect still existed. Our cadence is hours: something created and reversed within ten minutes reads not_executed at every sample. Timestamps make the record honest about what we saw; they cannot make it complete about what happened.

So the question is not whether to add a column:

If the third layer can only deliver "we asked, and this is what the target said at the time", does it deserve to be called reconciliation? Or was it always a log of readings — and the answer the audit needs was never in it?

The implementation described here comes from the open-source project KeelBase:

https://github.com/rain6fish/KeelBase Drafted with an AI assistant. The system, the positions and the mistakes are mine.

Originaltitel: AI Audit Evidence, Part 7: A Status Is Not a ReceiptQuelle: dev.to (dev.to). Original öffnen