ai newsFr., 4. Dez.
EilmeldungDoorDash gehackt: Cyberangreifer nutzten automatisierte KI-Tools

DeepLearning.AI startet Kurs zu Agent Harness Engineering mit Andrew Ng

DeepLearning.AI hat einen neuen Kurzkurs zu Agent Harness Engineering angekündigt, geleitet von Andrew Ng und Rohit Prasad. Kernidee: Ein Agent entsteht, indem man ein grosses Sprachmodell mit einem Harness umgibt, ein Teil der Agent-Entwicklung, den die meisten Demos auslassen.

dev.toFreitag 14:46 · 04.12.DE5 Min. Lesezeit
Bild: dev.to

DeepLearning.AI hat diese Woche einen neuen Kurzkurs angekündigt: Agent Harness Engineering, gelehrt von Andrew Ng und Rohit Prasad. Die Grundthese ist ein einziger Satz lang: Baue einen Agenten, indem du ein großes Sprachmodell mit einem Harness umgibst. Damit benennt der Kurs den Teil des Agentenbaus, den die meisten Demos komplett überspringen.

Das Modell ist der einfache Teil. Man ruft eine API auf und bekommt Text zurück. Der schwierige Teil ist alles drumherum: zu entscheiden, was das Modell tun darf, was es sehen darf, wann man es stoppt und was es sich für das nächste Mal merken soll. Dieser umgebende Code ist der Harness. Das Argument des Kurses lautet, dass nicht das Modell, sondern der Harness aus einer Demo etwas macht, das man mit seinen eigenen Dateien betreiben würde.

Tauscht man die Anweisungen und die Tools aus, erhält man einen anderen Agenten: einen Coding-Agenten mit Dateieditor und Testrunner, einen Support-Agenten mit Ticket-Suche und Rückerstattungstool, einen Datei-Organisierer mit einem Move-Befehl. Die Schleife bleibt dieselbe. Das ist die erste Lektion, die sich zu verinnerlichen lohnt, denn sie verschiebt die Frage, wohin die eigene Ingenieursarbeit fließen sollte. Man braucht kein besseres Modell, um einen besseren Agenten zu bekommen. Meistens braucht man eine bessere Schleife um das Modell, das man bereits hat.

Der Kurs baut sein Beispiel auf dieselbe Weise auf: einen Agenten, der einen chaotischen Downloads-Ordner in Unterordner sortiert. Er ist absichtlich unspektakulär. Ein Downloads-Ordner enthält alles, was Agenten in Miniaturform beunruhigend macht: Dateien, die einem wichtig sind, Schreibzugriff und einen Nutzer mit klaren Vorstellungen davon, wohin Dinge gehören. Wenn man dem Harness bei so etwas nicht vertrauen kann, kann man ihm bei nichts Größerem vertrauen.

Ein funktionierender Harness hat vier Aufgaben, und das Modell erledigt genau eine davon.

Die Schleife. Der Harness besitzt die While-Schleife: aufrufen, handeln, beobachten, wiederholen, mit einer harten Schrittbegrenzung. Diese Begrenzung ist wichtiger, als sie aussieht. Ohne sie probiert ein verwirrtes Modell denselben fehlschlagenden Tool-Aufruf so lange erneut, bis das Budget oder die Geduld erschöpft ist. Eine Schrittbegrenzung verwandelt „der Agent hängt fest“ aus einer offenen Rechnung in ein begrenztes, diagnostizierbares Versagen.

Die Tools. Tools sollten schmal, typisiert und langweilig sein. Ein Tool namens move_file(source, destination) ist auditierbar; ein Tool namens run_anything(command) ist eine geladene Waffe, die auf das eigene Dateisystem gerichtet ist. Der Harness entscheidet, welche Tools existieren, validiert ihre Argumente, bevor sie ausgeführt werden, und prüft ihre Ergebnisse, bevor sie das Modell erreichen. Ein Tool, das eine Fehlermeldung mit einem Geheimnis zurückgibt, hat dieses Geheimnis gerade in den Kontext des Modells geleakt, es sei denn, der Harness schwärzt es vorher aus.

Die Guardrails. Das ist der Teil, dem der Kurs echte Zeit widmet, und der Teil, den die meisten selbstgebauten Agenten überspringen. Drei Regeln:

Das Gedächtnis. Der Agent fragt einmal nach, wie man seine Dateien organisiert haben möchte, und verwendet die Antwort erneut. Das ist Präferenz-Gedächtnis: klein, stabil, unkompliziert. Die schwierigere Sorte ist Fortschritts-Gedächtnis: Was der Agent bereits versucht hat, was fehlgeschlagen ist, wo er aufgehört hat. Andrew Ng schrieb im November, dass langlebige Agenten eine eigene Speicherarchitektur brauchen, zum Beispiel eine, die den Kontext verdichtet, wenn er zu lang wird. Präferenzen sind eine Einstellungsdatei. Fortschritt ist ein Designproblem, und genau dort scheitern die meisten Agenten auf langen Aufgaben leise und unbemerkt.

Man braucht kein Framework, um die Grundform zu erkennen. Die gesamte Idee passt in eine Schleife, die man an einem Nachmittag schreiben könnte:

def run_agent ( task, tools, model, max_steps = 20 ): messages = [ { "role": "user", "content": task } ] for step in range ( max_steps ): reply = model. chat ( messages ) messages. append ( reply ) if reply. is_final_answer: return reply. text call = reply. tool_call # Guardrail: irreversible Tools brauchen ein menschliches Ja. if tools [ call. name ]. irreversible and not ask_user ( call ): messages. append ( { "role": "tool", "content": "User declined." } ) continue # Guardrail: Geheimnisse aus der Tool-Ausgabe entfernen, bevor # sie das Modell erreichen. result = redact_secrets ( tools [ call. name ]. run ( call. args ) ) messages. append ( { "role": "tool", "content": result } ) return "Stopped after 20 steps without finishing." Enter fullscreen mode Exit fullscreen mode Hier gibt es nichts Cleveres, und genau das ist der Punkt. Die Schleife, die Schrittbegrenzung, die Freigabeprüfung und die Redaktion liegen alle offen vor Augen. Wenn etwas schiefgeht, kann man den Harness lesen und herausfinden, warum, was man von den meisten Agenten-Frameworks nicht behaupten kann.

Das OpenWorker Harness SDK, das Open-Source-Projekt hinter dem Kurs, MIT-lizenziert und mit etwas über 20.000 GitHub-Sternen, ist im Wesentlichen diese Form mit abgeschliffenen Kanten: Genehmigungen, Audit-Trails, Sandboxing und dauerhafte Sitzungen sind enthalten.

Drei Versagensarten tauchen bei nahezu jedem Agenten auf, der ohne einen solchen Harness ausgeliefert wird:

Die entfesselte Schleife. Keine Schrittbegrenzung, keine Fortschrittsprüfung. Das Modell probiert ein fehlschlagendes Tool zwanzig Mal erneut, jeweils leicht umformuliert. Man erfährt es über die Rechnung.

Das geleakte Geheimnis. Ein Tool gibt eine Datei oder einen Fehler zurück, der einen API-Schlüssel enthält. Das Modell hält ihn nun im Kontext, und der nächste Tool-Aufruf kann ihn überallhin senden. Maskierung auf der Harness-Ebene ist die einzige zuverlässige Lösung, weil sie geschieht, bevor das Modell den Wert überhaupt sieht.

Die Amnesie. Der Agent fragt am Montag, wie man seine Dateien organisiert haben möchte, fragt am Dienstag erneut und am Mittwoch wieder. Jede erneute Frage ist eine kleine Steuer auf das Vertrauen. Präferenz-Gedächtnis ist billig hinzuzufügen und teuer zu überspringen.

Man beachte, was keiner dieser Versagensarten ist: ein Modellproblem. Ein stärkeres Modell gerät eloquenter in Endlosschleifen, leakt flüssiger und vergisst genauso vollständig. Der Harness ist der Ort, an dem Zuverlässigkeit entsteht.

Ein Harness ist keine Zauberei, und der Kurs tut auch nicht so, als wäre er das. Ein paar Dinge, die man klar sagen sollte:

Wer die geführte Version möchte: Der Kurs dauert etwa eine Stunde, ist im Audit-Modus kostenlos und ist um diesen einen Downloads-Ordner-Agenten herum aufgebaut, mit Schleife, Guardrails, Gedächtnis und einer Übungsaufgabe, bei der man ihn selbst zusammenbaut. Wer den Code möchte: Das OpenWorker Harness SDK liegt auf GitHub unter andrewyng/openworker, und die Installation ist eine Zeile: npm install @openworkerai/harness-sdk.

Wie auch immer, die Kernbotschaft ist dieselbe. Wenn dich das nächste Mal eine Agenten-Demo beeindruckt, frage, wie der Harness aussieht. Ein Modell, das Tools aufrufen kann, ist ein Partytrick. Eine Schleife mit Schrittbegrenzung, Redaktionsschicht, Freigabepunkt und Gedächtnis ist ein Werkzeug, das man einem echten Nutzer in die Hand geben kann. Der Unterschied zwischen beiden liegt nicht im Modell. Er liegt im Code drumherum.

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

Original (Englisch) anzeigen

DeepLearning.AI announced a new short course this week: Agent Harness Engineering, taught by Andrew Ng and Rohit Prasad. The premise is one sentence long — build an agent by wrapping a large language model with a harness — and it names the part of agent building that most demos skip entirely.

The model is the easy part. You call an API, you get text back. The hard part is everything around the call: deciding what the model is allowed to do, what it is allowed to see, when to stop it, and what it should remember next time. That surrounding code is the harness. The course's argument is that the harness, not the model, is what turns a demo into something you would run on your own files.

Swap the instructions and the tools and you get a different agent: a coding agent with a file editor and a test runner, a support agent with a ticket search and a refund tool, a file organizer with a move command. The loop stays the same. That is the first lesson worth internalizing, because it reframes where your engineering effort should go. You do not need a better model to get a better agent. You usually need a better loop around the model you already have.

The course builds its example the same way: an agent that sorts a messy Downloads folder into subfolders. It is deliberately boring. A Downloads folder has everything that makes agents scary in miniature — files you care about, write access, and a user with firm opinions about where things belong. If your harness cannot be trusted with that, it cannot be trusted with anything bigger.

A working harness has four jobs, and the model does exactly one of them.

The loop. The harness owns the while-loop: call, act, observe, repeat — with a hard step cap. The cap matters more than it looks. Without one, a confused model retries the same failing tool call until your budget or your patience runs out. A step cap turns "the agent is stuck" from an open-ended bill into a bounded, diagnosable failure.

The tools. Tools should be narrow, typed, and boring. A tool called move_file(source, destination) is auditable; a tool called run_anything(command) is a loaded gun pointed at your filesystem. The harness decides which tools exist, validates their arguments before they run, and checks their results before they reach the model. A tool that returns an error message containing a secret has just leaked that secret into the model's context — unless the harness redacts it first.

The guardrails. This is the part the course spends real time on, and it is the part most home-built agents skip. Three rules:

The memory. The agent asks once how you want files organized, then reuses the answer. That is preference memory — small, stable, easy. The harder kind is progress memory: what the agent already tried, what failed, where it left off. Andrew Ng wrote in November that long-running agents need a memory architecture of their own, for example one that compacts the context when it grows too long. Preferences are a settings file. Progress is a design problem, and it is where most agents quietly fall apart on long tasks.

You do not need a framework to see the shape of it. The whole idea fits in a loop you could write in an afternoon:

def run_agent ( task, tools, model, max_steps = 20 ): messages = [ { "role": "user", "content": task } ] for step in range ( max_steps ): reply = model. chat ( messages ) messages. append ( reply ) if reply. is_final_answer: return reply. text call = reply. tool_call # Guardrail: irreversible tools need a human yes. if tools [ call. name ]. irreversible and not ask_user ( call ): messages. append ( { "role": "tool", "content": "User declined." } ) continue # Guardrail: scrub secrets from tool output before it # reaches the model. result = redact_secrets ( tools [ call. name ]. run ( call. args ) ) messages. append ( { "role": "tool", "content": result } ) return "Stopped after 20 steps without finishing." Enter fullscreen mode Exit fullscreen mode There is nothing clever here, and that is the point. The loop, the step cap, the approval check, and the redaction are all in plain sight. When something goes wrong you can read the harness and find out why, which is more than you can say for most agent frameworks.

The OpenWorker Harness SDK — the open-source project behind the course, MIT-licensed, with just over 20,000 GitHub stars — is essentially this shape with the rough edges sanded off: approvals, audit trails, sandboxing, and durable sessions included.

Three failures show up in almost every agent that ships without one:

The runaway loop. No step cap, no progress check. The model retries a failing tool, slightly reworded, twenty times. You find out from the invoice.

The leaked secret. A tool returns a file or an error that contains an API key. The model now holds it in context, and the next tool call can send it anywhere. Masking at the harness layer is the only fix that works reliably, because it happens before the model ever sees the value.

The amnesia. The agent asks how you like your files organized on Monday, and asks again on Tuesday, and again on Wednesday. Each re-ask is a small tax on trust. Preference memory is cheap to add and expensive to skip.

Notice what none of these failures are: a model problem. A stronger model loops more eloquently, leaks more fluently, and forgets just as completely. The harness is where reliability lives.

A harness is not magic, and the course does not pretend otherwise. A few things worth saying plainly:

If you want the guided version, the course is about an hour long, free to audit, and built around that one Downloads-folder agent — loop, guardrails, memory, and a practice build where you assemble it yourself. If you want the code, the OpenWorker Harness SDK is on GitHub under andrewyng/openworker, and the install is one line: npm install @openworkerai/harness-sdk.

Either way, the takeaway is the same. The next time an agent demo impresses you, ask what the harness looks like. A model that can call tools is a party trick. A loop with a step cap, a redaction layer, an approval gate, and a memory is a tool you can hand to a real user. The difference between the two is not the model. It is the code around it.

Originaltitel: Your AI Agent Is a Loop With a Leash: What Harness Engineering Actually TeachesQuelle: dev.to (dev.to). Original öffnen