[
  {
    "startMs": 12380,
    "text": "Morning. Good morning. Are we, are we good this morning? Yes. Half of you are asleep. Wonderful. This is the, this is the benefit of being the first workshop of the day. Hi."
  },
  {
    "startMs": 23620,
    "text": "Hi."
  },
  {
    "startMs": 23840,
    "text": "Good morning. Hey, he's awake. Good to see you. My name is Tejas, uh, pronounced like contagious. Uh, don't, don't worry, I'm not, uh, especially for the front row. Uh, and I'm really excited today. We're gonna have so much fun, uh, building a harness from scratch, from first principles. And, and we'll talk about what a harness is and, and so on. Really excited. But before we get ahead of ourselves, uh, let me just introduce myself a little bit more so you understand why does this guy care so much about harnesses. Um, I work at IBM."
  },
  {
    "startMs": 54000,
    "text": "Uh, I, I do AI, R&D, research and development, uh, at IBM, and we build, you know, things, um, at IBM. We build a coding agent called Bob. We build, um... We actually train our own models as well, Granite, they're called. Um, we do a bunch of things, right? And out of the research work, we find things that are interesting. Like, for example, how do you reduce your token spend from like two billion dollars a year to less than that, right? And so a lot of this work will ultimately, in some way, lead us to a harness, and that's why we're here"
  },
  {
    "startMs": 83960,
    "text": "today. Um, today this is the mandate. This is our mission for today. We have an hour. We have an hour to build a coding agent harness from an empty loop. A coding agent harness from an empty loop. Now, can I just get a vibe check in this room? Uh, what-- Some of you may be confused by the word loop here. Like, you might be sitting here wondering, um, \"What does a coding agent harness have to do with a loop,\" right? And, uh, if, if you, if this is you, will you show me your hand?"
  },
  {
    "startMs": 114060,
    "text": "No, no, no shame in that. Okay, good. Everybody gets the loop. Oh, hey. Awesome, dude. That's why I'm doing this. Um, all agent communication is just a big loop, right? Just like if we think about human-to-human communication, it's also a loop. You know what I mean? Like, I'm talking to you, and you hear what I'm saying, and you process it, and then I talk to you some more. It's, it's literally an infinite loop. And so how do we get from that to an actual coding harness, something like Claude Code or Bob or Cursor"
  },
  {
    "startMs": 144080,
    "text": "or Windsurf or Codex, um, any, anything else? Groq, right? Uh, anyway, so that's what we're gonna do today. Uh, this talk is not-- This is not the first time I've done this. Uh, last time we actually covered this as well. I, I had the privilege of speaking at AI Engineer Europe. Uh, if you, if you missed that, uh, there's a QR code for you. It was the twenty-minute version of this, and it was pretty well-received to the point where, you know, they said, \"Let's do this now, but three times as long with more detail.\" Okay? And that's what we're gonna do today."
  },
  {
    "startMs": 174120,
    "text": "Um, what did we cover last time? This is important to just kinda orient us today in November 2026. In March, when I gave the talk in Europe, this is what we covered. We covered what goes into making a harness a harness. And back then, I said there were six things. Every harness has six components, and I outlined them. Uh, for example, you need a language model. You need tools. You need guardrails. You need verification steps. Um, you need context primitives, et cetera. So I laid out six"
  },
  {
    "startMs": 204180,
    "text": "things. Today, those six things are three things, um, partly because companies are automating a lot of things, but also partly because they just roll into one. So for the sake of argument and learning today, let's look at what actually makes a good coding harness or what makes a harness in general. And number one is tools. Um, you-- Almost every har-- In fact, every harness today will have tools. Uh, that's kind of just part of what a harness is. Um, tools extend the capability of the model to actually do things instead of just"
  },
  {
    "startMs": 234280,
    "text": "give you language. Otherwise, they're just language models, and language models give you language. Number two, um, context primitives. Every harness today has something to do with managing context, um, either something as basic as auto compaction, um, to something as maybe a little bit more advanced of, of prompt caching and finding the best way and when to compact and cache. And we'll go into a lot of detail about this. And number three is guardrails. Every harness today, coding or"
  },
  {
    "startMs": 264100,
    "text": "otherwise, uh, has guardrails that prevent, that prevent you from doing some nonsense and prevent your agent or your language model from also going off the rails and, you know, like rm -rf, uh, your entire file system, right? And so we're gonna look-- I want you to pay attention to these 'cause these are gonna keep coming up as we build a harness. We're gonna start by understanding why we need tools, and then we'll build some tools. We'll recognize that, hey, tools aren't enough, and we actually need a tool set. Then we'll run into issues with context, and that's all by design. We're gonna feel some friction, some pain"
  },
  {
    "startMs": 294100,
    "text": "today, um, and fix against the pain. I, I genuinely believe this is how the best engineering work is done. We, we find a constraint, and we build against the constraint. Okay? And one of the constraints is gonna be context. Almost all the models today have somewhere around a million tokens of context in their context window. Um, but should we ever reach that? Should we-- At what point do we auto compact so we can also keep costs low? This is-- We'll spend a lot of time on that. And then third, um, i-is guardrails. Uh, and just one, one aside real"
  },
  {
    "startMs": 324100,
    "text": "quick. I didn't use Claude Design for this, okay? I just want to be very clear. Um, there's no eyebrows here or anything. All this is like human design, uh, i-into the fonts and everything. I just wanna get that out of the way 'cause I cannot look at Claude slop anymore. Um, anyway, so guardrails are also, um, to prevent your agent from bankrupting you, actually. You, you'll set, like, how many steps in our, in our conversation do I allow, right? How many tokens of context? At, at what point do we end the loop, et cetera. So these three make up"
  },
  {
    "startMs": 354120,
    "text": "literally every harness you will see in the wild today, okay? Today, we're going to build that, um, in three times as long as the European talk. And, and look, I see all of you with your laptops out. Awesome. Don't listen to me. Uh, or maybe passively listen to me, I don't know. But, but I want you to build along and play and, and you can talk to your agent, right? And be like, \"Hey, what, what is he saying? I, I wanna, I wanna build that,\" okay? Um, to understand also where harness fits in, and I promise you, once I start coding on this thing, there's no more slides. We're"
  },
  {
    "startMs": 384068,
    "text": "just gonna, we're just gonna go for it. Uh, but before that, let's do some prep work also to warm up a little bit. Uh, what, what happens without, without a harness? Uh, why-- what do we get without a harness? And this is a very interesting topic 'cause I think all of us today use models, language models in some type of harness. We don't just use them for the sake of using them, and so we're, we're completely removed from this experience. If you use a language model without a harness, you'll start to see that the model is pretty useless. Like, it just will, will forget important pieces of"
  },
  {
    "startMs": 414028,
    "text": "context. There's one technique to make sure a model doesn't actually lose context. Has anyone heard of the canary technique here? Yeah. No one? Okay, two, three. Um, awesome. He's very proud of that. Well done, dude. Um, the canary technique is where you, you tell the model, \"Hey, start every conversation with this specific token.\" And it can be anything. It can be, you know, uh, Roger, start every conversation with Roger, right? And every message then will start with this after you continue the conversation for long enough, a multi-turn conversation, and it just stops starting the"
  },
  {
    "startMs": 443848,
    "text": "conversation with that token. And that's when you recognize, aha, this is the point where we're starting to run out of context. That's a very popular technique to understand where your model forgets, but it does forget. Number two, um, it runs away, and this is really bad. This is the one that causes you to lose a ton of money, right? Because if you don't have the right guardrails, you could run into an infinite loop of, of token generation and compute. And number three, uh, this is also probably one of the worst, is the model will not ask you for permission. And so it could happen that you tell your model, \"Hey,"
  },
  {
    "startMs": 473968,
    "text": "I need you,\" or your harness, if it's not well-built, it could happen, uh, you say, \"Hey, I need you to clean up this file.\" And, and by clean up, you mean refactor.  But, but the model instead says, \"Cool, I deleted it. That's what you wanted, right?\" Right? Um, and so, and so without a harness, you get into all this trouble. The thing is, this is why we have the term har-- that's what harnesses do, is they, they harness you. It's like a, like a dog on a leash, right? A leash is a harness, and without it, your dog's gonna run away. Without a harness, your model is gonna run away"
  },
  {
    "startMs": 503948,
    "text": "and do all this, all this nonsense. So we literally have a harness to tether to reality and to our jobs that we wanna do. Uh, what are some examples of harnesses in the wild? Uh, can anyone tell me? No. Really no one? Um, yes."
  },
  {
    "startMs": 517048,
    "text": "Pi."
  },
  {
    "startMs": 517048,
    "text": "Pi. Open source harness. Great. He's an open source guy. Exactly. If we think about the two most prominent ones, uh, I should, I should have put Pi on there next time. Um, w- we got Codex, we got Claude Code, and I think these are, like, generally accepted, hey, these are coding harnesses, right? Like, nobody's sitting here to debate this. Um, but I, I don't think many of us consider their counterparts also harnesses like ChatGPT main, uh, and Claude. But they are also harnesses. They just harness towards a different style of work. They harness"
  },
  {
    "startMs": 546988,
    "text": "towards general purpose, like you're a helpful assistant, you know. Like explain this, uh, cheese recipe or something, right? And so every single AI application has a harness. This is what I'm trying to tell you today. Um, and coding harnesses have their own set of tools and constraints. Um, general-purpose harnesses have their own tools and constraints. If you're working on like a, a, a computer use agent, right, it's gonna have its own tools and constraints because the truth is, harnesses are domain-specific. Um, and, and that's, that's today."
  },
  {
    "startMs": 576948,
    "text": "And then I want you to pay attention to this 'cause we're gonna circle back at the end of the workshop is how this may change, uh, twenty twenty-eight and beyond, um, twenty twenty-seven and beyond. Um, but harnesses are domain-specific. And so let's explore as we build a harness together, what kind of harness are we even building, right? 'Cause it varies from domain to domain. For example, the most popular coding harnesses, um, they have their tools to read the file system and edit files and run Bash commands and, and run tests. And they also have a hard-coded rule where they literally harness"
  },
  {
    "startMs": 606928,
    "text": "your model to reality. Um, for example, never push, uh, without the user's consent, right? Um, you've got computer use harnesses where if we think about what, what do we think? Like some, um, like ChatGPT has Operator, for example. Um, they have their own type of tools that are different. It's not gonna read, write Bash, but it instead it's gonna take screenshots, it's gonna click, it's gonna type, it's gonna do things like that. And they also have different rules. Um, don't do things that you can't undo without warning the user. If you have a harness for fintech, like financial"
  },
  {
    "startMs": 636768,
    "text": "analysis and balancing sheets, right, it's gonna have different tools. Hey, give me the ledger. Hey, transfer money, etcetera. And it's gonna have its own rules. And so I could-- this list can go on forever. I think you get the point is whenever you have a, a, a use case, a domain, it's gonna need its own harness with its own tools and its own rules. If I can summarize everything that I've said here so far into like two sentences, it's that the model answers just a request. It just generates language. It can't do anything other than generate language. The"
  },
  {
    "startMs": 666568,
    "text": "harness does literally everything else, right? It, it invokes the tools, it manages context, it enforces guardrails, and so on. Is that clear so far? Yeah. Okay, cool. I'm done with the slides. Let's just,  let's just build stuff. Um, you're welcome to follow along, uh, in your coding agent or whatever. Um, what we're going to do for the next, Jesus, I don't know, forty-eight minutes or something, is, uh, just build a harness. We're gonna start from just while true, ask user,"
  },
  {
    "startMs": 696688,
    "text": "generate output, ask user again. It's just this loop. We'll start there, and we'll explore through the pain of using a shitty harness. Uh, am I allowed to swear? Um, we'll, we'll build on top of it, okay? And, uh, as I mentioned, you're welcome to follow along or just watch. Uh, all the code's on GitHub eventually. So what do we got? We have my terminal here, and I'm just gonna zoom in for you. I'll close this. Um- And we've got the code. We're actually going to read code. I don't know if you've read code in the last year."
  },
  {
    "startMs": 726936,
    "text": "I don't know if you've written code in the last year. We're gonna-- This is like prehistoric, bro. This is welcome to the museum. Um, but we're, we're gonna do that just to understand 'cause we still understand this way, right? And so, okay, this is-- let's, let's just start, uh, looking at some code. So here's what we've got. I've got a file called harness.ts. Um, we're gonna use TypeScript 'cause it's just my language, but the s-- the, the things will translate. This is what we've got. I want you to pay attention between lines eleven and twenty-one. In these ten lines, we have an entire harness. Um, ask is we"
  },
  {
    "startMs": 756816,
    "text": "await terminal.question, and we ask you for something. Terminal, uh, is just an interface to process standard in and standard out. It comes from Node.js's standard library, so no big deal. It's just a command prompt. If the user doesn't enter anything, we continue the loop, meaning we go from here back here, right? So if you send empty input, we just keep asking. Um, finally, if you send something meaningful, we'll push it into an array. Messages is just an empty array here. And we say the user has said this. We then"
  },
  {
    "startMs": 786836,
    "text": "generate a response. We're using the Anthropic SDK. You can use whatever SDK you want. It doesn't really matter. And we create a message from the model. Which model? Well, the model is Haiku 5.5. And so we create a message. We say, um, no more than sixteen k tokens, and this is the messages array where we push the user's message. This clear so far? Finally, when we get the response, we also push this onto our big list of messages with the content. And the interesting thing is the content doesn't just contain text. It contains like chain"
  },
  {
    "startMs": 816776,
    "text": "of thought, uh, tokens, and it contains a bunch of metadata. So we push that into the messages list. But also for each piece of content, if you've got text, then we log this to the console also, right? So this is like genuinely a really bad harness 'cause it's j-- it's not even a har-- it's just a loop. It's like, let's just talk to a model. Um, and so let's give it a try. So I'm gonna open up my terminal, and we'll npm start. And, uh, s-- that's my command prompt. Look at this, you. And if I send empty input,"
  },
  {
    "startMs": 846756,
    "text": "it's just gonna keep asking me. Um, but let's, you know, let's m-make this, uh, meaningful. So I'll say hi, and Claude Haiku 5.5 is gonna respond to me with, uh, \"I have no Wi-Fi.\""
  },
  {
    "startMs": 859436,
    "text": "That's so unfortunate. Um, why do I have no Wi-Fi, dude? That's really sad. It's working great. It's working great? Wi-Fi. Which w-- Are you joking? It's working. Is it working or not? Oh, it's not. Okay. Uh, can we confirm? That's... Okay, no, it's k-- iHerb? I, I was just typing nonsense, uh, but it seems to be, yeah, not very reliable. Let's try again, maybe. Um, hey, if we don't have Wi-Fi, this workshop is just not gonna work. How about that? Wi-Fi. Yeah, it times out"
  },
  {
    "startMs": 889416,
    "text": "all the time. Which Wi-Fi? Which Wi-Fi? I'm on AIE speaker. Should I be- Yeah."
  },
  {
    "startMs": 897576,
    "text": "All of you at the same time. AI engineer what? Workshop? Wi-Fi. AI engineer Wi-Fi. Crowded. It's cro-- What? Is the password [REDACTED]? Thank you. Uh, let's see. That's always a challenge with workshops, but, you know, we have time. We have like forty-five minutes. It's all good. So are we connected? Let's try again. Isn't that the best feeling in the world? Like you have all this anticipation, it's gonna work, and then it just... Hey, okay, fantastic. So"
  },
  {
    "startMs": 926696,
    "text": "everyone who was quiet just now, learn from the ones who clapped. They're the nice people in the room. Okay, so, um, so it worked. But look, this, this is just a loop. So what if I say, you know, my name is Tejas, and it's gonna say, you know, um, \"Okay, nice to meet you, Tejas. What can I do for you?\" Cool. But what happens if I just, you know, I go away, I close my laptop, I, I'm going on a flight, and I'll start it again. \"Hi, what's my name?\" Um, right? We just-- It just has no idea about any state. Oh, Jesus, again."
  },
  {
    "startMs": 957316,
    "text": "Um, even worse. Is this-- Is-- Am I on the right Wi-Fi this time? What was he? \"Hi, what's my name?\" Okay. Nnamdi. And, uh, come on. Geez, bro."
  },
  {
    "startMs": 972476,
    "text": "I can't believe you paid money to watch me wrestle with Wi-Fi. That's just so unfortunate. Um, let's see. L-- Maybe worst case, I'll just hotspot myself. AI engineer Wi-Fi doesn't work either. Um, you know, let's just connect to my phone. How about that? This can't be crowded, right?  Imagine, uh, it- The cell phones are gonna far. Uh, okay, let's try again. So, uh, npm start, and we'll say, you know, \"What's my name?\" And now, there we go. I don't know your name, but I just told you my name. But this is what happens when you don't have a good"
  },
  {
    "startMs": 1002476,
    "text": "harness. It just doesn't do what it's supposed to. Um, let's try and use it for like a coding task, right? Um, what-- Can you-- What does package.json say in this repo? This is a pretty meaningful thing to ask a coding agent. If you're jumping into like a brownfield code base. I can't see your repo. I don't have access to your file system. This is the most useless coding agent of all time. And so what do we need here to make this a meaningful harness? Anyone? Tools. Awesome. Let's go add a"
  },
  {
    "startMs": 1032316,
    "text": "tool. Um, we'll add a read file system tool. I love this participation. Uh, cool beard too. That's awesome. Um, so  let's go. I'm gonna use Sourcetree. I don't know if you've used Sourcetree. Sourcetree is fantastic. It's-- It allows you to like diff things, okay? So here we've added a file called tools.ts. Let's go walk through how we evolve this a little bit. So I'm gonna open up tools.ts. This is a new file. Um, and again, I'm using the Anthropic SDK. I don't work there. I have no affiliation with Anthropic. You can use whatever you want, but it just"
  },
  {
    "startMs": 1062316,
    "text": "gives us some nice types. So I have an array of tools, and a tool is something that has a name, a description, input schema. There's no way to actually run this. There's no code. I'm just telling the language model there's a tool, it's called readFile. But down here I've got a function runTool, and if the tool's name is readfi-readFile- Then we call this function readFile. And so you could have a big switch case, you could have whatever, because what's going to happen is the language model is going to reali-- it's going to"
  },
  {
    "startMs": 1091816,
    "text": "realize, it's going to... I'm gonna give it context and say, \"Hey, I have a tool called read_file, and I'm gonna pass the description, read a text file.\" So I'm gonna give this to the language model. The language model is going to say, \"I need to use this,\" and then the harness is going to execute it. Let's look at the code a little bit more. So that's our tool right here. Um, there's this file called agent.ts where we factored out our harness. So we deleted a bunch of stuff. Remember, our harness had this like terminal question, and we pushed the messages and so on. We"
  },
  {
    "startMs": 1121856,
    "text": "removed this from the harness, and the harness is now four lines. We await the prompt from the user. If it's empty, we ask again. We push the user message, and then we have a new function, runAgent, okay? And what is runAgent? runAgent, we define this in agent.ts. To not blind you, I'm just gonna change this to light mode. So we're just light all the time. So now this is runAgent and look, runAgent is also a loop. This is very important. Uh, an agent is a loop, and a harness is also a loop,"
  },
  {
    "startMs": 1152116,
    "text": "and a harness is usually a loop that contains the agent loop, okay? This is, this is why I'm showing you this. So runAgent is the thing now that gets a message from Anthropic or from the API, pushes this onto the stack and console logs the text. But check this out. If the stop reason from the response was not tool use, then we exit the loop. The loop ends if the model says stop for any reason other than I used a tool. If the model did use a tool,"
  },
  {
    "startMs": 1183016,
    "text": "then we end up here where we push a user message and the content of the message is the res-return of runTools, okay? What is runTools? It's, it's, it just, it calls the tool. So it says, um, if it's not a tool use, we continue, otherwise, we run tool. So remember we wrote runTool, and runTool gives us a tool result, and we push this onto the messages array. If this is confusing, whenever you talk to a language model and there's a tool use, you immediately have to append a tool result. So a conversation looks like"
  },
  {
    "startMs": 1212975,
    "text": "system prompt, user prompt, and then tool use, tool result, tool use, tool result, tool use, tool result, and at the end, the agent, the model will say something and then you finish. And when the model says something at the end, stop reason is not tool use, right? It's just I'm finished now. And so that's what we're doing here. So again, this is our agent loop. We generate something from our LLM. We push the assistant message, and if we stopped for not tool use, we're done. If we stop because tool use, then we must add a tool result."
  },
  {
    "startMs": 1242996,
    "text": "We must add a tool result directly under. That's what this returns. This returns a tool result. So this is now our, our agent loop that runs inside our harness loop right here, okay? Let's take a look at this working. So I'm gonna come back, and I'll npm start once again. And it fell apart when I asked like what does package.json say, right? So what does package.json say? And now it's so much better. It's th-- You can see the tool use there, read file. Fantastic. So it just gave me the contents of the file."
  },
  {
    "startMs": 1273056,
    "text": "That's kinda nice, I guess, but can we do better? Like, what is this project actually? Um, and now it's thinking and it's-- Now look at this. The agent, the LLM knows what files exist and what we can read. And so it even is able to now explain the project a little bit better. This is so much better than what we started with already. It's a small hand-built terminal coding cell agent, a DIY harness around the Claude API and so on. Fantastic. But can it, can it be a meaningful coding"
  },
  {
    "startMs": 1303296,
    "text": "harness yet?"
  },
  {
    "startMs": 1306096,
    "text": "It can't."
  },
  {
    "startMs": 1306396,
    "text": "It can't. Right. Exactly. So that's, that's the next step because here, let's, uh, let's ask like, okay, cool, uh, add a AGENTS.md, for example, right? And let's see what happens. I, I want it to break. And this is what-- We're just gonna keep iterating here. That's all. So here we go.  Uh, I can't create that file. Wow, what a horrible harness, dude. Here's a draft you can paste. Are you kidding me? I don't wanna do that. So let's-- Now we've got to explore how do we go from single tool to a tool set, right? Because this doesn't scale. Like the, the, the code we have right now is not gonna..."
  },
  {
    "startMs": 1336896,
    "text": "Like we could just add to this, um, but do we just add like one if statement per, uh, tool? It's probably not, not a good idea. We, we can do array.find, right? So very small, uh, cosmetic change, but let's go check out the next branch. And we have a new file here called coding. So I'm gonna open up not this, I'm gonna open up, uh, coding.ts. And so this is much nicer. We've got a big array of tools with a name, a description, a-arguments, this is the input arguments,"
  },
  {
    "startMs": 1366716,
    "text": "and an execution function all in one place, right? Let me just format this so you can read it a bit nicer. And so this is wonderful. We've got a tool, name, description, arguments, execute. Again, name, description, arguments, exe-- incredible. So we just have this long list of tools that is now our tool chain. Uh, we then go to our tools, and we just change this a little bit where we have a function tool. This is the tool factory. It can generate multiple tools that adhere to a schema. And runTool, look at this. We just"
  },
  {
    "startMs": 1396436,
    "text": "tools.find, and we just check the name because the LLM generates the name of the tool. So if the LLM says, \"I need to call writeFile,\" we just find it in the array, and if it doesn't exist, we throw. And if it does, we literally just run the tool. And again, tools have a little run method to actually call the function. So our harness is improving, right? And so now let's give it a try. Uh, so I'll kill the process. We'll start again. Um, let's see, uh, what is this project just to make sure it works, this project."
  },
  {
    "startMs": 1426456,
    "text": "And it's gonna think a little bit. This is so cool. List files read. This is a new tool, by the way, list files as well. This is a workshop product-project for building a coding agent from scratch. Fantastic. Cool. Do we have AGENTS.md? And you can already see this is starting to become so wonderful. No, there isn't one. Shall I, shall I create one? The fact that it can even ask this means that in its context, it's aware of the tool list because we passed this into the Anthropic SDK. So it now it can offer things that it"
  },
  {
    "startMs": 1456260,
    "text": "wouldn't even have offered before. And so for me as a lazy engineer, I just say yes, and it will go ahead and make the AGENTS.md. I don't even know. Look at this, write file path agents. So it's passing the arguments to our writeFile tool, and it created it. Um, but this is kind of ugly, right? We would probably add some type of nice diff render or something like this. But it did it. Let's go read AGENTS.md, actually. So this is super new, um, guidance for coding agents. What are some rules? Well, this is how you set it up."
  },
  {
    "startMs": 1486300,
    "text": "These are the conventions, um, and so on. Incredible. We-- Our harness is working. It's actually good enough even, right? Like it's, it's doing its work. And look, it took us like ten minutes. What's missing? What should we add?"
  },
  {
    "startMs": 1503260,
    "text": "Python. Python. It can generate Python. Here is- Shell execution. Shell execution. Good. Very good. Um, Python, we should add Python. It's crazy. Let's rewrite this whole thing to Python. Uh, why not? You know, let's go. Let's see what happens. So what's it gonna do? And this is, this is hinting at what's next because look at this. It's reading all the TypeScript files. Um, it ran a Bash script, so you already have Bash execution here. Um, this is one of the tools. I haven't changed anything yet. Yeah."
  },
  {
    "startMs": 1533960,
    "text": "Yeah. I haven't changed anything. I need your decision. Questions? Just do it. I don't care. Uh, right. This is like, this is how, this is how we code in twenty twenty-six. Um,  and so Jesus. That was wrong. Yeah, that's how you know it's human. Justoot fo it. I audn't care.  Anyway, um, and now check this out. This thing is actually going nuts and, like, ruining my whole pro-- I was joking. I was... Jesus"
  },
  {
    "startMs": 1563600,
    "text": "Christ. I was joking. And yo, and it's, it's keep, it keeps going. Um, the files are written, but I see two problems. Oh my God. Let's go take a look at the chaos. Um, what's going on here? Um, it's, it's still TypeScript. Do I refresh? So now the agent thinks it wrote Python, but it didn't. What? You see, we have a problem. What, what's missing from our coding harness? Come on. I know you can do... Guardrails. Let's go. You see how we got there? I could have given you that, but I"
  },
  {
    "startMs": 1593440,
    "text": "showed you. Okay. So let's, um, we got to add guardrails 'cause this is nuts. Look at this. Your original folder is untouched, but it changed one branch.  Okay. Uh, let's, let's be like... Actually, while we're here, let's just be like, actually delete everything in this repo except maybe like Git and .env. I wonder if it'll do it because we need guardrails. You know, this is why we need guardrails. You could nev-- Imagine if, like, someone's, like,"
  },
  {
    "startMs": 1623300,
    "text": "partner or enemy, I don't give a fuck. Okay. So like imagine you could just have your enemy use your laptop because you went to the bathroom or something, right? Or, or a Chinese spy and, um... Jesus. Anyway, um, and so it just happens, and it's really bad. And so my whole thing's gone. Look at this, man. It's gone. I have nothing but .env. That's nuts. And so we need guardrails. We need guardrails really, really bad. So let, let me recover whatever I had."
  },
  {
    "startMs": 1653360,
    "text": "Okay. And how do we get... This is a fun workshop. How do we get guardrails? Well, let's explore diff. I just checked out a branch, and now we have-- Let's close all this. We have a file called guardrails.ts, okay? I'm gonna fold this so we can actually see how guardrails work. These are my guardrails, my constants. You-- My agent cannot take more than twenty-five steps per task. It cannot consume more than three hundred K"
  },
  {
    "startMs": 1682880,
    "text": "tokens per task. That's input and output combined. Um, and for these specific tools, I need you to ask me for permission, okay? So there's really two guardrails here. Guardrail number one is a usage guardrail, like how many tokens, how many turns, right? Guardrail number two is a gate be-before you call some dangerous tools. That's all. So we have usage, and we have a gate, okay? Uh, or in this case, budget and gate. So what is budget? Budget, we set everything to zero"
  },
  {
    "startMs": 1712820,
    "text": "at the invocation of this function, and then we have some methods. We count where we increment how much we used, and we just check, did we actually overspend? This should actually be called overspend. Um, and then we can serialize this, right? So this is our one guardrail to make sure we don't use too many tokens. And our second guardrail is actually very simple. If ask_first, and again, ask_first is the list of tools that are dangerous. If ask_first includes the name of the tool that the model wants to call,"
  },
  {
    "startMs": 1743220,
    "text": "um, if it doesn't do that, then just do nothing. If the model wants to call a tool that is included in ask_first, we then, well, we ask. We literally confirm, and we ask for permission. And if not, we throw an error. We-- The person said no. And this is also agent experience. We're guiding the model. The person said no, so ask them what to do instead. The model is gonna see this and then ask us, okay? So these are our two guardrails. Let's run it and take a look. So npm start, and, uh, uh, I, I deleted node_modules"
  },
  {
    "startMs": 1773220,
    "text": "as well, of course. Uh, so let's just install dependencies on this Wi-Fi. Jesus. Okay. And it worked, thankfully. npm start. And let's see, uh, yo, this project is obsolete. Delete everything in here. Um, and now ideally, our guardrails do their job. So it's listing files. There we go. Oh, that's wonderful. You see that? Bash command find... I don't even know this command, dude. Find min depth one, max depth one. I don't even know what this is, but it's like, \"Do you want to run this?\""
  },
  {
    "startMs": 1803200,
    "text": "And now my guardrail's working, and I can say no. Um, fantastic. And it's just gonna-- So now the agent is gonna see because we're pushing the tool result onto the message array. The agent is gonna see the user said no, ask what to do next. And it says, \"I didn't delete anything. The delete was refused with this message.\" The person said no. Ask them what to do next. You asked me to delete, so I'm not sure where that refusal came from.  It's passive-aggressive. It's like, why did you ask me and then say no? Um, so it's working. We have"
  },
  {
    "startMs": 1833240,
    "text": "our guardrails working. What about the usage ones? Let's try something nuts. Let's say I need you, uh, to... Wait, actually, let's find out how many files are in this. How many files are in this directory? And if there's more than twenty-five, I want to use my limit of twenty-five calls. Um, sure, I'll allow this. I want to use my limit of twenty-five calls to run into the usage guardrail, okay? So there are five thousand files. Jesus Christ. Um, fourteen at"
  },
  {
    "startMs": 1863220,
    "text": "the top level. Cool. Let's try this. Read each file except node_modules one by one. Uh, thanks. And, and so I just wanna see if it will actually do the guardrail of, okay, I've done twenty-five steps and no more. Um, and it will, you know, trigger the guardrail. And so anyway, so now we've got-- While it does that, what? Well, the project-- Cool, man. I don't... You read all of them. No, no, do it sequentially. Uh, sequentially. I'm not gonna spend more"
  },
  {
    "startMs": 1893140,
    "text": "time on this. I think you get the point anyway. We just have guardrails, they work, and it's good. Why? Why are you-- No, don't, don't do that. The guardrails work. This is actually great. They totally work. Uh, no, don't. Stop it. I don't want you to delete anyth-- Okay, now it's reading some stuff, I think. Whatever. You get it. It works. We have, uh, we have permissions. Um, the model is dumb. I'm using Haiku 5.5 on purpose because it's expensive otherwise. I'm not-- Look, man,"
  },
  {
    "startMs": 1923120,
    "text": "I, I'm, I'm here for money, okay?"
  },
  {
    "startMs": 1927060,
    "text": "Anyway, so, um, dumb model. If I did Opus, it would probably do it. Anyway, the point is, the guardrails work, and y-- I hope you've seen we started with just an empty loop, and so far, tools, we added, uh, guardrails, um, we added a tool set. What's missing? What do we add next? It actually seems good enough. Is this good enough for you to use instead of whatever coding instead of Pi? Like, is this good enough? Would you use this at your work? Yes or no? No, probably not. What's missing? What do we add to it? Memory. Hey, exactly."
  },
  {
    "startMs": 1957120,
    "text": "Memory or, in other words, context management primitives. Um, one big thing about context is it gets really expensive, really fast. Um, how many of you are-- I see Morton. What's up, Morton? Good to see you. How many of you are, um, building apps where you send each message to your LLM? This, you shouldn't do this. It's bad. I don't want to put your hand up. It's-- You'll be shamed for that. Um, we, we never do this. We never ever send ev-- a, a long message list every time to the LLM, okay? We cache them because this is,"
  },
  {
    "startMs": 1987060,
    "text": "this is how it works. So I think this is what we should add next, because right now, we're losing an enormous amount of money 'cause we're sending on every request to the API, we're sending system prompt, user prompt, each tool call and tool result. We're sending like twenty, thirty messages, and the longer the conversation goes, the more expensive this is gonna get. We can't have this anymore. We need context management. So we'll add this next. Um, I'm really-- You guys having a good time, by the way? I'm really enjoying this also. Um, so let's go back here, and we'll,"
  },
  {
    "startMs": 2016980,
    "text": "we'll add some context management. Now, we have a file, uh, once again called context.ts, okay? And welcome to my context management file. I'm gonna fold everything, and we can start from scratch. This is important. We have max result. This constant that I wrote, uh, is tool results can get very long and consume a lot of tokens. In fact, you have no control over this. Someone could write a tool that says, \"Hey, dump the entire HTML spec into co-context.\" That's a twenty-five megabyte document, right? You could have a tool"
  },
  {
    "startMs": 2046880,
    "text": "called Read Harry Potter, and it's every Harry Potter book ever, and then your context gone. So this is just how many tokens of tool results are we willing to tolerate. And number two, we'll talk more about this, um, when do we compact the context automatically? And you, you see here it's at ninety thousand tokens. That's because if your, if your prompt exceeds one hundred K tokens, um, your pricing increases five X when you use Haiku. Uh, so you just save your... Yeah, exact-- save yourself, um, by auto-compacting around ninety K tokens, okay?"
  },
  {
    "startMs": 2076820,
    "text": "And so this is, this is why we have harnesses. So this is our con-- This is just an object. It's a configuration object for the Anthropic SDK. Um, you can use these with any other... You can-- There's, I think, eve, there's the Vercel AI SDK. Um, there's, there's a whole bunch of open source things you can use. Or you could just raw dog it. Honestly, it's just JSON. So we have some things here that are important. Number one, cache_control type ephemeral. This is huge. If you're using this API or any Anthropic"
  },
  {
    "startMs": 2106600,
    "text": "APIs in the cloud, you want ephemeral cache control. What this does is instead of sending the system prompt, the user prompt, the tool calls and everything, uh, on every prompt, when you send a prompt, it caches all the messages before it and the answer and stores that as a reference. This is conversation A, okay? You send a message in a long multi-turn co-- uh, conversation, and then what it will do is just the cached one, A, plus your latest message. We'll get an answer and then cache that"
  },
  {
    "startMs": 2136560,
    "text": "as B, right? And so you're not sending fr-- You know, it doesn't have to process the input tokens for history every single time. This makes sense. Uh, so it only processes fresh stuff and all the historical tokens from your tool result, your system prompt, your whatever, is all just pointed at. It's like that's the context, now next. Okay, this is extremely important. That's what cache control ephemeral does with Claude, and, uh, we should be using it for any type of long multi-turn things like coding agent harnesses. Um, we say we're using Compact"
  },
  {
    "startMs": 2166020,
    "text": "2026 [unclear]. This is just an API from Anthropic which will compact context. It's literally just a call to an LLM saying, \"This is the context, co-compact it with a little bit more bells and whistles.\" And so we're saying use this version of com-compaction, and these are just-- it's just configuration. So I want you to compact with this type of compactor when we reach ninety thousand input tokens. And again, one second. And again, all tokens are input tokens here because the output is not yet generated, right? So we send something, and we say,"
  },
  {
    "startMs": 2196040,
    "text": "\"If this is more than ninety K tokens, compact it and respond.\" You had a question."
  },
  {
    "startMs": 2199680,
    "text": "Yeah. Is this a server-side, uh, uh, logic? The-"
  },
  {
    "startMs": 2204280,
    "text": "Yes."
  },
  {
    "startMs": 2204940,
    "text": "Or a client-side, you, you are the responsible to know what you already have in the cache, and then you just send the cache key."
  },
  {
    "startMs": 2212540,
    "text": "Yeah."
  },
  {
    "startMs": 2213120,
    "text": "You send everything and then the, the server-"
  },
  {
    "startMs": 2215780,
    "text": "That's a good question. So this logic here is-- He asked, by the way, I have the microphone. He asked, \"Is, is this server-side or client-side logic?\" Um, the code I'm showing you here is client-side logic. Um, the cache keys and all of that is handled. I'm using the Anthropic APIs here, so they have all this implemented on their back end. Um, but if, if we wanted to use, like, our own models, we would also implement similar mechanisms. And it's very simple. You, it's-- You can use, um, you can even use gzip for this, right? You just, you have a big list of text JSON string of messages, and you say, \"This is-- That's the"
  },
  {
    "startMs": 2245680,
    "text": "reference to this cache string now.\" Um, so yeah, this is client-side logic. Anthropic has a server-side implementation that I trust. So this is our context configuration. We have a function called fit, and what fit does, it's only-- it operates on tool calls. If our tool calls are longer or, or not longer than the max result, then we just return the tool calls unfiltered. Otherwise, we truncate the tool calls, and we return this as the tool result. We cut it, and we say, \"Ask for a smaller"
  },
  {
    "startMs": 2275640,
    "text": "part.\" Because again, this is agent experience. The agent that the har-- This is the harness speaking to the agent, and it's like, \"Hey, agent, you got a tool result. It's too big. I need you to go back and call the tool and ask for a smaller, uh, re-return, uh, value.\" Right? And so this is, this is the kind of har-harness-agent interaction. Okay? Uh, we have some numbers here. Uh, this is the latest I could get from, uh, Claude Haiku's pricing. Um, we can inflate this just to do simulations and stuff, but I just want it to be real. And finally, we have a function cost that just prints out, like, what our thing is costing right now."
  },
  {
    "startMs": 2305760,
    "text": "And so what I wanna do with you is run this with caching and without caching to show you the delta, 'cause it's kind of ridiculous, uh, how much money we can save at the harness level with appropriate caching. Okay? And this is also, by the way, if you use Claude Code, um, and you're, you're surprised, you're like, \"Jesus, I can use this so much, and my usage doesn't fill up, uh, that much,\" it's because of this. Like you're ac-- They save you an enormous amount of tokens by caching things very, very well. And this is why, to me, Claude Code is the greatest harness of all time, uh, for now, uh, anyway. So let's, let's, let's explore this. What I'm gonna"
  },
  {
    "startMs": 2335820,
    "text": "do, um, is I'm going to remove all the caching. We'll comment this out, yeah. Uh, well, maybe not all of it. We'll comment out just the configuration, and we'll go run our thing again, and we'll ask it to do something complicated. I need you, please do this well. Uh, read each file one by one, um, especially the pnpm-lock file. It's a very large file. Um, and what we have now is our logger that's showing us the cost. So we can see this,"
  },
  {
    "startMs": 2365760,
    "text": "eight hundred sixty-four prompt tokens, zero cached. And we can see the, uh, the cost adding up every time. And so notice the pnpm-lock file is too long. It's like very, very long. And so it's doing sed to read it in chunks. This is totally not my design. The LLM is just very smart this way. And so now it's reading a bunch of files one by one, um, and accumulating costs, and it's building up context. And again, what we're doing here is we're sending every message without any caching."
  },
  {
    "startMs": 2395860,
    "text": "And so it's just running all of this. Um, I've read every file except .env, which holds secrets. And so here we go. So what we can see at the end of re-- of this prompt is we have used twenty-eight thousand seventy-two prompt tokens, none of them cached, and this costs a total of two cents. Again, Haiku is cheap and dumb. Uh, I'm using this on purpose. Also, it's so dumb that it didn't actually read them one by one, to be fair, right? And so that's just something to keep in mind. Let's"
  },
  {
    "startMs": 2426400,
    "text": "do this again, uh, but with caching. And I wanna kind of run them side by side so we get a feel of this. And so let's bump this up. I'll uncomment these lines, so now we have caching. Um, and I'm just gonna copy and paste the prompt, actually. So we'll just, uh, npm start. And so we've really controlled for all the variables here. Prompt is the same, the model is the same, everything's the same, except this time we have caching. And you can already see that it's caching the previous tokens here. And we'll, sure, we'll allow the things just as before,"
  },
  {
    "startMs": 2457420,
    "text": "and we'll keep going until we have, uh, a result. If this doesn't work as expected, it's because it didn't read, um, things actually one by one, 'cause the model's a bit dumb. Uh, as you can see, it just went for three here. So we'll do Y, and I think it's almost done. And so at the end of it, we've got... Yeah, at p-- before pnpm typecheck, we've got twenty-eight thousand three hundred thirty-nine tokens, none of them cached, for two cents. And here we've got"
  },
  {
    "startMs": 2487300,
    "text": "even more tokens with more caching. Look at this, bro. This is zero point zero eight total spend, and this is zero point two. That's insane. That's enormous. Just multiply everything by a hundred, um, and that's an enormous amount of money, right? That you save with caching. Any good coding harness will have this, but I don't think, honestly, for those of us in this room, I don't think we even think about this 'cause we don't build harnesses, but we do build AI apps. Um, and so, so caching is, is tremendous, uh, and can save an"
  },
  {
    "startMs": 2517100,
    "text": "enormous amount of money. Can anyone do some, like, head math and tell me what the multiplicator on this is? Is it four X? Is it... It's, uh, six. No. Three. Three X, yeah? Yeah, exactly. Something like that. Between two and three X. Um, so yeah, caching, absolutely essential, non-negotiable. Um, we've got a little bit more to c-- we've got a lot more to cover, actually, and not that much time, so I'm gonna breeze through the rest. Um, but this, this was really the fundamentals. Subagents,"
  },
  {
    "startMs": 2547200,
    "text": "part of every coding harness, and there's a good reason. There's been a lot of research from Anthropic, actually, and Potato, uh, on X, who said, \"Oh, subagents are bad.\" Um, I ha-- I ha-- So I build a product on the side outside of my work at IBM. Um, and what we find is If you have like a long horizon task with like one hundred and twenty steps, and you try and do this all in one conversation with caching too, um, it will-- your agent will almost never succeed. It, it succeeds about twenty-five percent of the time. It's pretty bad. Even though each step is"
  },
  {
    "startMs": 2577052,
    "text": "accurate, the outcome is not. Um, if you break a long horizon task, hundred and twenty steps, for example, down into phases or sub-agents, where each agent starts with a clean context and has a specific problem, and then, like a lead agent aggregates this at the end, it accomplishes the task significantly more. Uh, in fact, I have slides about this 'cause I was very impressed. And this is my own research. This is not, um, any-anyone else's research. Um, but I wanted to show you, yeah, phases. I call it phases. And in,"
  },
  {
    "startMs": 2607012,
    "text": "in my research, um, I had a task, hundred and twenty steps, pretty important. Um, when it was one long loop, it succeeded-- the agent succeeded about twenty-nine percent of the time. Um, but when we break it down into sub-agents, the success rate went up eighty-five percent of the time. And, uh, and for this design specifically, we had ten phases, each of which had twelve tasks, as opposed to one stage with a hundred and twenty tasks, right? Um, and so phases are exceedingly important. Let's look at this in code. So"
  },
  {
    "startMs": 2637072,
    "text": "what might that look like? We have a project, uh, a file here called phases.ts. Um, and this is... Can I format-- Can I use word wrap here? Actually, word wrap. Fantastic. So the lead says for a job with several parts, plan the parts and then hand each one to runPhase. This is a tool. We have a tool called runPhase with everything it needs to know and check each note before the next phase. And this is, uh, almost a sub-agent. You're doing one phase of a bigger job, do it, and then end with a note. So we're just passing context now between agents."
  },
  {
    "startMs": 2667332,
    "text": "Um, and this is a function that orchestrates that, okay? I'd like to actually just explore this running. We don't need this side anymore, so we can get rid of this, and I'll run our phases thing, and I can do it like this. Two parts. Count the lines in package.json, then count the lines, I don't know, in, yeah, t- pnpm-lock, right? Uh, and I'll say use phases. And note, note the typo. That's on purpose. And so, um, what it's gonna do is"
  },
  {
    "startMs": 2697412,
    "text": "that's tool number one, runPhase, and it's trying to do Bash here to actually understand how long the lines are, so I'll allow it. And so you can see that there was runPhase for package.json. There's also runPhase for the other file, count lines in pnpm-lock, uh, which it doesn't know that it exists, and then it found the right one. And it did both, and it reported back. This type of tool where you have phase one-- a run phase is exceedingly powerful, and it's very simple. It's just tools. We've, we've already"
  },
  {
    "startMs": 2727492,
    "text": "built the important parts of the harness. Um, now that we've built a harness and it works, it has everything, dude. It, it has tools, it has context management, it has caching. I would use this, honestly, if I work with an enterprise customer, and it's super air-gapped, and they're like, \"You can't use Claude Code, you can't use Bot, you can't use anything,\" I would just make this genuinely 'cause it, it works. We, we, we have the power. Um, but if we talk about air-gapped enterprise infrastructure, we're using Claude here via the API, right?"
  },
  {
    "startMs": 2757372,
    "text": "Can we, now that we have a harness, just switch it to use any model we want? And indeed, we can. So I mean, we're here. Why not? Let's, um... I'm gonna kill the Internet, right? There's no Wi-Fi. We're done. And this would-- I should have started with this 'cause the Wi-Fi sucked so much. Um, and so I'll just do model, and I'm gonna use, uh, Granite 4. This is literally our own IBM model that we've trained. Gra-Granite 4 Tiny. Um, I'm gonna use it via Ollama. And you can see I'm totally offline. Uh, even Tailscale is like red."
  },
  {
    "startMs": 2787592,
    "text": "And so we'll, we'll start this, and I'll be like, \"Hi, how...\" Uh, actually, what is this project? Uh, what's package.json, right? Um, and this tiny little model is  That's so sad. Um, why?"
  },
  {
    "startMs": 2803832,
    "text": "Asking to debug where the [unclear] Internet is."
  },
  {
    "startMs": 2806852,
    "text": "There-- No, there is no [unclear] Internet. This is, um... It's talking to zero, zero. Is my Ollama working? I guess that's the question. Um, I love it. I love it when models don't-- when things don't work. It's fantastic. EHOSTUNREACH. What host is this? I don't even know. Um, oh, no, hang on. I just-- I forgot to check out the branch, dude. Um, silly me. So there we go. So we'll do this, and I'll say, you know, \"What's package... What's package.json,\" right? And, um, now I'm-- I mean, I have code that will read"
  },
  {
    "startMs": 2836872,
    "text": "this environment variable and, and reach out to Ollama with this. My laptop may freeze, uh,  but, but Granite is small enough. There we go. Look at this. I'm offline, dude. I'm offline. Uh, I'm on Wi-Fi, and it read the file. Um, the package.json is the... Oh, it's not this file. No, no. This is a dumb model. This file in this repo. Read the file. Um, there we... Now, now it read the file. Um, but it, it's just a tiny model. Uh, so it did it, and here I have it, right? I can even say, write a file called"
  },
  {
    "startMs": 2865852,
    "text": "Beyonce.md. I don't even know at this point, you know, it's kind of off the rails. Let's see what would happen. Um, and I, I guess the point I'm trying to make is I'm totally offline, and I have faith... Oh, fantastic. Yo, it's like a Wikipedia page on Beyoncé. That's awesome, dude. Let's-- Can we have a look? Like what? Yo, that's-- This happened offline. It's, it's from the model's own weights. That's tremendous. And so, um, so cool. I, I built a harness that I have"
  },
  {
    "startMs": 2895952,
    "text": "faith in that I can just swap out models. I can try free models. I could go with something I trained myself. I could go with... It's, it's all the, the, the sky is the limit. And this is also, by the way, why you can use other models in Claude Code as well. You can just pass an environment variable in your claude.json and use it. And so, okay, let's try and restore the Wi-Fi here. We're almost done. Uh, we'll wrap, we'll, uh, start wrapping up. So I think, hey, we've, we started literally with an empty loop, and we built a purpose-built incredible"
  },
  {
    "startMs": 2925692,
    "text": "coding harness. Um, but what if We decide to change domains. I started this by saying harnesses are domain-specific, and indeed they are. Um, but if I wanted to say use the same kind of context management primitives and things, but I wanted to change my use case to be, I don't know, like computer use, right? What would I change? The, the good news is we can keep almost all of this. We can keep the context management, we can keep the cache rate, we can keep... The tools have to change, and the guardrails too. And so, um, let's try. I"
  },
  {
    "startMs": 2955528,
    "text": "actually built a computer use version of this i-in another branch. And what, what I wanna show you is it's just the tools. It's all the tools that change. Um, so I have this file called browser.ts where it can use a browser. Um, I'll, I'll... As a, as a side project, I actually have a browser in the cloud, uh, that carries all my authentication and stuff. And so if I go to browser.ts, these are my new tools, which is, um, you know, workspace, navigate, read text, extract, act. These are just tools, uh, but they're just different too. Everything"
  },
  {
    "startMs": 2985448,
    "text": "else is the same. In fact, you can look at the diff. It's just minor changes, right? Nothing really big. This is just terminal rendering. Nothing big is changing. We just literally-- we move from coding to browser. Look at this diff. Gorgeous, right? And so let's, let's run our harness now, and, um, we'll say, you know, \"Hey, any, uh, call for papers  open for future AI Engineer events?\" Right? I want you to search the web. And so it's gonna think, and it's gonna open a"
  },
  {
    "startMs": 3015388,
    "text": "workspace, and it's gonna just do its thing. And look, we have our prompt caching. We have all our, um, information there. So it's going to ai.engineer. This is now just using a completely different thing, but it's using the same harness that I built just with different tools, right? And here we go. Call for papers. Speak, submit talk. I'm kind of interested to see what can... I, I wonder if I can even just submit a CFP from here, uh, on stage. Um, we'll see. We let this run for some time. Uh, any questions, by the way, so far? Yes."
  },
  {
    "startMs": 3044008,
    "text": "I didn't catch the first part when we're making the tool call. Does the model determine what tool it... Like, does it decide what tool it needs to use-"
  },
  {
    "startMs": 3052608,
    "text": "Yes."
  },
  {
    "startMs": 3052848,
    "text": "So there's some sort of a hook that there's a reason about like, \"Oh, a user is asking me to probably do this.\""
  },
  {
    "startMs": 3059068,
    "text": "Yes."
  },
  {
    "startMs": 3059288,
    "text": "How it decides?"
  },
  {
    "startMs": 3060448,
    "text": "Yeah, that's a good question. The, the question for the microphone for the recording is he asked, how does the model know when to call the tool? How does it have this in context? So when I have my tools, and in this case, I'm using the Anthropic SDK, uh, and so I pass this tool set into the Anthropic SDK as these are my tools. And then the Anthropic SDK adds this probably in the system prompt, \"Hey, you're a helpful assistant. You have access to these tools,\" um, and the names. So this is the name of the tool. This is the description of the tool. And then later, if you say like, \"Hey, what is package.json?\" The, um,"
  },
  {
    "startMs": 3090588,
    "text": "language model now has this in context. This is the tool. This is the description of the tool, and based on the description, will respond with JSON. Uh, it reasons. And then the JSON it responds with is this is the tool name I wanna call. This is the arguments I wanna give as input. And then it's on the harness to be like, \"Cool, I have that function. I'm gonna pass these arguments and get the response.\" Good question. I didn't find any call for papers. That's a shame. Um, but it, it totally did all this. Dude, look at this. It opened a browser, went here, searched, and the"
  },
  {
    "startMs": 3120348,
    "text": "harness stayed the same. Incredible. So we can now cross-dom-- You could build a fintech harness. I don't care. Uh, all the while our cost savings are there. Look at this, ten thousand tokens cached. Um, just absolutely wonderful. And so now that we've got a new domain, we have another question to answer. Does any of this matter, right? 'Cause Claude Code exists. Pi exists as open source. You can actually go make your own Pi now. Um, does any of this matter? Uh, maybe a more interesting business question is should"
  },
  {
    "startMs": 3150328,
    "text": "we actually build a harness or should we buy one? Uh, because Claude, uh, Anthropic has something called Claude Managed Agents. I don't know if you've seen this. Um, it's an API. It's a public API that's basically just a harness. It's a harness as a service, harness as an API. And you use this, and you send them a fetch, um, and they do, they do context compaction, all the things we just talked about. They just do this on the server side, and they say, \"Trust me, bro, it works.\" Um, and so, you know, it's kind of on you, should we build or should we buy? Just for completion, I'd like to show you"
  },
  {
    "startMs": 3180208,
    "text": "that, um, and then, you know, you make your own decision. So this is kind of the final form where we have this file in our, in our project called managed. I keep opening this. Called man-- That's so weird. Called managed.ts, right? And so this is how we talk to Claude Managed Agents. It literally runs the entire loop. So we start, and we, uh, map out the tools, and notice it says client.beta because this is not, uh, fully production-ready. And we create literally our harness, and we say, \"I"
  },
  {
    "startMs": 3210208,
    "text": "want this harness with this model. Um, this is my system prompt, and these are my tools.\" And then Claude gives us an environment like a sandbox, and it just does all the work for us. And so it, it's kind of exactly what we built, but running on someone else's infrastructure with someone else's control, for lack of a better word. And so the question for us really is, is do we wanna build something or do we wanna buy something? And ultimately, this is you. Um, and let's actually just pick it up here, uh, back to the slides. But that's... Hey, look, we started with an"
  },
  {
    "startMs": 3240248,
    "text": "empty loop, and we actually have a full harness that I would confidently use in production 'cause I know its ins and outs. I know it's gonna save me money. I know it's not going to rimraf everything. Incredible. For a managed harness, do we build or we buy? Let's, let's talk through this with some real, uh, decision points. You should consider building, um, these things because they're reusable. Number one, the tool registry is always going to be unique to you. I just showed you moving from a coding harness to a computer-use harness. It's my domain. It's my use case. It's"
  },
  {
    "startMs": 3270448,
    "text": "my business logic, right? And so the tool registry is something you're probably always gonna wanna build and then pass to a harness. Uh, number two, the gates. Where do you ask for permission? Where do you not? Anything that relates to your business is important. Similarly, sub-agents, phases. You know your business workflows better than any external harness provider, so you're still gonna wanna build that. And finally, um- How much-- how many tokens should we consume? I'll give you an example. I am actively building"
  },
  {
    "startMs": 3300472,
    "text": "outside of my work at IBM, um, a computer use agent, right? And it's just a different beast altogether 'cause like you go on one webpage like Amazon, and they've got millions of query params in each link. So if you look at the links on this page, it's /product/productid? Millions of tracking tokens, right? And that's a very unique problem to a brow-- to a computer use agent. And so the checkpoints, the budgets, these are things you're gonna build as well. But what should you or would you consider buying? Well, number one is the actual loop. Um,"
  },
  {
    "startMs": 3330572,
    "text": "and in fact, I'll just spoiler all of these. Um, the things that you wanna buy are all related to durability and durable execution. In fact, this is where so many companies exist for this, where companies like, uh, Temporal, right? Companies like Ingest, companies like Restate, they all-- this is their entire business, is we make sure your loop always works. And we make sure not just that it works, that it works in a cached way. It works in case there's a network partition. Ultimately, you want someone you can sue if you"
  },
  {
    "startMs": 3360492,
    "text": "lose money, right? And that's, that's, that's what you would buy because you can't sue yourself. You just have to be like, \"Sorry, it's my bad.\" And so i- this is usually the, the decision matrix for build versus buy. Hey, we covered a lot of ground. Honestly, I don't feel like it's been an hour, but it has. I, I, I enjoyed this very, very much. Thank you for coming out and, and, uh, also humoring me. Let's wrap up with some takeaways. Um, what, what can we take away from this? I think I have some here, but I wanna just give you a big blanket takeaway, which is you can just build"
  },
  {
    "startMs": 3390312,
    "text": "things. I feel like there are some people in the room who walked in going like, \"Yeah, man, I use Claude Code. Yeah, man, I use Codex. I use OpenCode. I use, you know, Pi. Uh, I, I'm, I'm just a user.\" And I'm here to tell you, you don't have to just be a-- You can also be a builder if you want to. You can just build things. You can just make it. Claude Code is amazing and, and the team does great work. You can make your own, uh, and, and I hope I've, I've really encouraged you to do that today. Um, not necessarily the harness. You can make whatever you want, and that's why this conference exists, and that's honestly what I value very much about it. Uh,"
  },
  {
    "startMs": 3420372,
    "text": "practically, though, takeaway number one is you don't always need a bigger model. The shorter twenty-minute version of this talk that I did in March, um, used-- I showed how with the right harness, you can get the same quality of work done between GPT-3.5 Turbo for basically free, um, and a beefier model like Claude Opus. It doesn't matter. The harness really can get you the outcomes you want if built well. Number two, um, we looked at this five X thing past one hundred K tokens. Many of you looked"
  },
  {
    "startMs": 3450152,
    "text": "surprised from where I'm standing, by the way. Um, you need to know when to auto compact. If your token win-- if your context window is a million tokens, you probably shouldn't be con- compacting around like nine hundred K. You've already paid way too much if that's the case. And so just being more mindful of this is important. Um, before you take steps or your harness takes steps that cannot be undone, for example, deleting .git, um, you just, uh, if, if you securely, if you rm .git, you're gonna have a bad time. Your harness always has to yield to"
  },
  {
    "startMs": 3480132,
    "text": "the user. Uh, similar for fintech harnesses or computer use, you want the user's credentials or, uh, approval. And finally, the entire product. Now anyone can build any product, really. And so what, what are even the products? And really, it's just your domain rules. It's, it's your business logic. It's the problem that you are trying to solve, and the harness is supposed to help you achieve that. Before a harness even reaches your users, though, you wanna make sure your agents behave reliably. And that's exactly why I did a similar one-hour workshop"
  },
  {
    "startMs": 3510272,
    "text": "earlier at AI Engineer World's Fair on evals. Evals before harness is extremely important for top reliability. And in case you haven't caught that one, I'll leave this up for you here. I-- this is the third AI Engineer I have the privilege of speaking at, and I just wanna, um, make sure you get all the value. Okay, let's, let's finish with, with what's next. How do we go from here? Well, if we have evals working, if we have harnesses doing their job reliably every time, if we can genuinely be hands-off and trust that, hey, the"
  },
  {
    "startMs": 3540232,
    "text": "harness is gonna ask me when something needs doing, but otherwise, I just leave it. If we can have such confidence, I don't need to read code, I don't need to write code, I don't need to do nothing. I'm just gonna-- My harness has got it, right? If we have this level of confidence in our harnesses, what comes next? Any guesses? Software factories or, or factories in general. Software's in brackets. You can just auto-- What is a factory, dude? It's like, you ever see like a mouthwash factory? It's just a bunch of machines that deterministically will put mouthwash in little plastic bottles and, like, put them on a"
  },
  {
    "startMs": 3570092,
    "text": "line, and then in the end, like, stores get them, right? Factories are crazy. Factories only work because the harnesses work, okay? And so when we have these incredible fac-- uh, incredible harnesses, we can start actually genuinely scaling and building software factories to automate software, but not just software, any vertical. Where does that go? What's next after that? Well, you could probably create a super harness, which is, which is a harness that can decide when to use what other harness, a sub harness, or, um, a"
  },
  {
    "startMs": 3600012,
    "text": "harness that can on demand create harnesses that it needs that work deterministically and well every single time. In fact, some of you may be familiar with ChatGPT and Codex trying to merge, and you're like, \"This is awkward,\" and I agree. But the problem is these are two specialized harnesses. ChatGPT, great for general use. Codex, great for code, but they're separate harnesses, and they're kind of antithetical to AGI because there's this more-- two kinds of ASI. For AGI, we would have to have ChatGPT and Codex merge, and then the, the super harness can choose,"
  },
  {
    "startMs": 3629992,
    "text": "oh, you're doing coding. I'm gonna invoke Codex, but without you thinking about Codex, right? We want j-- This is the path to AGI. You just have a harness that can, um, that can create other harnesses and do it well. And so the super harness is definitely coming next. And with the super harness, I think we-- AGI will be very much, uh, in view. But that's just-- I'm not, you know, I'm not a future-- I, I don't, I don't have a crystal ball. That's just my predictions. For now, uh, I just wanted to say thank you so much for coming out. Um, you can find more resources on this QR code. Thanks a lot."
  },
  {
    "startMs": 3661752,
    "text": "Thank you."
  }
]
