A short article for people who decide on AI projects. It walks through the layers every AI agent is made of, from the model itself to fully autonomous systems, one short layer at a time. No technical background is needed. Every number comes from a published paper or a vendor document listed at the end; vendor numbers are marked as claims.
This article is a picture of what an AI agent is made of, for people who decide on AI projects. Each layer below is a short summary on its own. Read the first three and you know what an "AI agent" is. Read all thirteen and you can hold your own in any planning meeting about one.
Layer 1 · Core primitives: the model, the context, the toolsLayer 2 · What you can change to get better outputLayer 3 · What an agent isLayer 4 · Hallucination: when the model makes things upLayer 5 · Knowledge bases: getting your documents to the modelLayer 6 · Memory: how an assistant "remembers"Layer 7 · Harness: everything that is not the modelLayer 8 · Subagents: when one task is bigger than one contextLayer 9 · Loops: letting it run for hoursLayer 10 · Evals: how you know it worksLayer 11 · Interactive versus headlessLayer 12 · Assistant versus autonomous AILayer 13 · Are "skills" useful?Then · Questions to ask your team, twelve things to remember, referencesLayer 1: core primitives
Question: what is an AI system actually made of?
Three things, and only three: a model, a context, and tools. Everything else in this article is built from them.
The model. The model is a kind of neural network. It was trained on a very large share of the text publicly available on the internet, with one goal: predict the next word. That training is where all of its general intelligence comes from. We send it text and it produces a reply by picking one word at a time. It was trained on public text only. It has never seen your policies, your prices or your customers.
The first model of the modern kind was trained on about 300 billion words of text and showed that, past a certain size, a model could carry out a task from a few examples in the request alone (Brown et al., 2020).The model is stateless. It does not remember who you are or what you asked a minute ago. It does not learn from your requests, and its intelligence does not change as you use it. Each request you send may even be served by a different copy of the model in a different data centre. If you say in your first message that your name is Bob and the model still calls you Bob in the fifth, that is not memory. The software sent the first message again, inside the fifth request. Drop it from the request and the model has never heard of Bob.
The context. Everything we send to the model, as one long document the model reads from the top, is called the context. It is much more than your message. Before the first message is even typed, the software has already put in:
A system prompt: who the assistant is, how it should speak, the rules it must follow. In developer tools this is assembled from instruction files, and the tools stack them: a session started deep in a folder tree reads every instruction file from that folder up to the home folder and joins them.Skill headers: one-line descriptions of the step-by-step instructions available, so the model knows what it can ask for. When the model picks one, the full text is loaded into the context.Rules: a second, overlapping way to do the same thing as skills.Plugins: packaged bundles of the above, installed by the user.Tool definitions: for every tool the model may call, its name, what it does and what input it takes. The model cannot call a tool it has not been told about.Memory notes: short notes saved from earlier sessions, if a memory add-on is installed. Layer 6 covers them.Then the conversation history is added as it grows: your messages, the model's replies, and the output of every tool the model asked for. When the model reads a file or lists a folder, the result becomes one more entry in the context.
The context is measured and billed in tokens, pieces of words; a token is about three quarters of an English word. Everything in the list above counts: the system prompt, the tool definitions, every tool result, and the model's own hidden reasoning when it is switched on.
The vendor documentation states it directly: system prompt, tool definitions, tool results, documents and thinking all consume tokens, and thinking tokens are billed as output (Anthropic, Context windows). What you pay per request is the size of the context, not the length of your question.The tools. Tools are helpers the model can ask to have run: a calculator, a database lookup, a web search, a request for a human to step in. The model cannot run anything itself. All it can do is produce the next word. So tool use works like this. The calculator's description sits in the context. When the model decides it needs two plus three, it writes a reply in a fixed format, called a tool call, that says which tool to run and with which input. Our software reads that reply, runs the calculator on our side, and sends the result back as the next entry in the context. The tool runs on our computer, never inside the model.
A research team taught a small model to use five tools, including a calculator. On arithmetic word problems it then beat a model 25 times larger that had no tools (Schick et al., 2023). The tool, not the model's size, supplied the ability.So, in one sentence: the model is a neural network that writes a reply based on what it learned in training and on the context we are responsible for assembling, and it can ask for tools that we run on our side and whose output we send back.
Important: the model has no memory and cannot act. Everything it "remembers" is text sent to it again, and everything it "does" is a request our software chose to carry out.
What it means for us: the model is the one part we do not control. The context and the tools are the parts we do.
Why it matters: every improvement in the layers below works by changing the context or the tools. None of them changes the model.
Layer 2: what you can change to get better output
Question: for each of the three parts, what can we change, and how hard is it?
The context. Five things to manage. The first three are the ones that fail most often; the last two are the ones that fail most expensively.
Hygiene means paying attention to what sits in the context. Tools that are never used, skills that do not apply, instructions about another topic: all of it is read on every request, and a messy context confuses the model. The basic recommendation is to start a new session for every new question and to limit the number of skills and plugins installed.
Proprietary information means remembering that the model was trained on public text only. It knows nothing about your business. If the assistant should know the 15-day return window, somebody has to put that sentence into the context, one way or another. Layer 5 is about the ways.
Size means that the model performs worse as the context grows, and costs more. There is no clean limit after which it breaks; the quality slides down as the context fills, long before the advertised maximum is reached. Anthropic's guidance treats the context as a scarce budget to be spent on what the task needs, not as free space to fill (Anthropic, 2025, context engineering).
Position means that where a fact sits in the context changes whether it is used. The model reads the beginning and the end of a long context better than the middle, so a policy pasted between two long documents may be ignored even though it is there.
Trust means that everything in the context is read as if it came from you. A web page, an email or a document fetched by a tool enters the same context as your instructions, and text hidden in it can be obeyed. The industry name is prompt injection.
A 2025 study of 18 models from four vendors gave each model the same question twice: once with only the relevant lines (about 300 words) and once with the same lines buried in roughly 100,000 words of filler. Every model did worse on the long version (Chroma Research, 2025).An earlier study placed the one needed document at different positions in a context of twenty. Accuracy was 75.8% when it came first, 53.8% when it sat in the middle, 63.2% when it came last (Liu et al., 2023). The middle of a long context is the worst place for a fact.The vendor's own documentation names the effect: as the context grows, accuracy and recall degrade, which they call context rot (Anthropic, 2025, context engineering).A 2025 study fed the same requirement either all at once or spread over several turns of a conversation. Spread out, performance dropped by 39% on average, mostly because the answers became unreliable rather than uniformly worse (Laban et al., 2025). This is the evidence behind "one session, one task, the whole brief up front".Anthropic's own internal red-team test of a phishing-style injection through content the agent read succeeded in 24 of 25 attempts before the containment work it describes, a vendor report (Anthropic, 2026, How we contain Claude). The defence is not a better model; it is limiting what the agent can reach, which Layer 7 covers.Cost follows the same curve. Every request re-sends the whole context, so a conversation that has grown to 100 pages costs 100 pages per message, not per conversation. Short contexts are both more accurate and cheaper.
One more thing follows from "every request re-sends the whole context": the whole context leaves your company on every request. Whatever is in it, policy, customer record, credentials passed to a tool, is sent in full to the vendor. Deciding what may enter the context is a data decision, not only a quality one.
The tools: hygiene and capabilities. Do not install tools that will not be used. Better still, connect only the tools a session needs, so the model is not misled about what is expected of it.
OpenAI's guide for builders recommends fewer than ten tools per assistant, and warns that tools with overlapping descriptions get confused with each other (OpenAI, 2025).Anthropic reports a system with 58 tools whose definitions alone filled 55,000 words of context before any question. Loading tool descriptions only when needed raised accuracy from 49% to 74% on their internal test, which they label a claim (Anthropic, 2025, advanced tool use).The other side of tools is capability. The model can only produce words; tools are how it gets things done the right way. Tools are how it does arithmetic, counts the letters in a word, fetches a document, reads your internal data, or asks a human for help. A capability the assistant lacks cannot be prompted into existence. If the assistant cannot look up orders, no instruction will make it know where an order is.
The model: fine-tuning. To make the model itself know your business, you can fine-tune it: continue its training on your own examples. This is the hardest of the three to change. You need a dataset, computing power, and then your own deployment of the resulting model, and not every model allows it. If you can afford it, you get a model whose default knowledge differs from your competitors'.
A 2026 study trained a small model to copy the behaviour of a whole workflow built on a large one. It reached 87% to 98% of the large system's quality at 128 to 462 times lower cost per request, for a one-time training cost of 50 to 80 dollars (Hubotter et al., 2026). The authors' break-even was about 500 requests.A 2023 study found that for adding facts, putting documents into the context beat fine-tuning (Ovadia et al., 2023). Fine-tuning teaches a style or a routine, not a policy document.Before fine-tuning anything, there is the cheaper model lever: which model to buy. Judge it by measured cost per task, not by list price per token, because models that reason longer consume far more tokens for the same question.
A 2026 study compared models on the same tasks and found that in 21.8% of pairs the model with the lower listed price cost more in practice, with differences in reasoning tokens of up to 860% (Chen et al., 2026). One model advertised as 1.7 times cheaper came out 28 times more expensive on the tasks measured.Keep the context clean, focused and short.Start a new session for every single task.Do not let the context exceed about 100,000 tokens, roughly 75,000 words. Beyond that, quality drops even if the model accepts more.Check that the required tools are connected before blaming the model.Put the proprietary information the task needs into the context.Put the important facts at the start or the end of the context, never buried in the middle.Treat everything a tool brings back as untrusted text, and decide what may leave the company in the context.Pick the model by measured cost per task on your own cases.Important: the model is the hardest part to change. The context and the tools can be changed in a day, and the studies above show that changing them moves accuracy by tens of points.
What it means for us: before any budget for a "better model", audit what the current one is being sent.
Why it matters: fine-tuning needs a dataset, computing and a deployment. Trimming a context needs none of them.
Shorter context, better and cheaper answers. Important facts first or last.Few, distinct, well-described tools. Tool output is untrusted text.The whole context leaves the company on every request.Fine-tune last, and for behaviour rather than facts.Layer 3: what an agent is
Question: people say "agent" as if it were a new kind of AI. Is it?
No. By now we know the model can only produce a text reply given a context, and that it can ask for tools which we must run. An agent is the piece of software that does the running. It is written as a loop, or a graph, or a workflow, and its job is:
Collect the initial context: the system prompt, the skill headers, the tool definitions.Get the human's message and add it to the history.Send the history to the model.If the model asks for a tool: run the tool, add its output to the history, send the history to the model again.If the model produced a reply: send it to the human and go back to step 2.Take a support assistant asked "where is my refund?". The model asks for an order lookup; the software runs it and sends the context again. The model asks for a search of the returns policy; the software runs it and sends the context again. On the third reading the model has the order status and the policy text, and writes the reply. The model never touched the database or the policy. It wrote two requests; the software decided to act on them.
The ability to run this loop and call tools to collect what the answer needs is what makes a model an agent, in its simplest form.
The paper that established the pattern, called ReAct, had the model alternate between a line of reasoning and a tool call. On a question-answering test it raised accuracy from 45% to 71% over the same model answering from its own knowledge alone (Yao et al., 2022).Analyses of Claude Code, a widely used agent tool, put this core loop at roughly fifty lines of code in a program of about 512,000 lines (Zhang et al., 2026, Dive into Claude Code; community analysis of leaked source, 2026, unverified). The rest is the software around it, which Layer 7 covers.The loop also has a cost that a fixed program does not: it is unpredictable. The same task can take two tool calls or twenty, and the result can differ between runs. So the first question is not "which agent" but "do we need one".
OpenAI's guide for builders says an agent fits where the work needs judgement, where the rules are too many to maintain by hand, or where the input is unstructured text. If none of those apply, fixed automation is enough (OpenAI, 2025). A refund that follows a clear rule is a form, not an agent.An agent is a loop around the model, not a different model.The loop decides which tool requests to honour. That is where control lives.If the steps are known and the rules are stable, do not build an agent.Layer 4: hallucination
Question: when the model is wrong, how would we know?
Models try to produce the best reply they can, but they make mistakes, and the mistakes are fluent. There are two kinds, and they differ in whether you can check them.
When the model answers from its internal knowledge, it is a black box. It may say refunds take 7 days because it read many return policies during training that said so. There is nothing to check against.When the model collects information and summarises it, you can check. Ask it to include the exact lines of source text its answer rests on, and compare. If the quoted line is really in your policy and really says what the model claims, the answer is grounded. If the line is not there, the reply is wrong, and you can see it before the customer does.A 2025 analysis argues the problem is built into how models are trained: common tests reward a confident guess over an honest "I do not know", so models learn to guess (Kalai et al., 2025).A 2026 method had the model draft an answer, then check its own draft against the sources, then rewrite. On one benchmark accuracy went from 55.2% to 75.2%, on another from 57.1% to 85.2% (Lu et al., 2026). Checking against sources helped more than any instruction to be careful.The vendor's guidance lists the same move: let the model say it does not know, and have it quote the source before answering (Anthropic, Reduce hallucinations).One limit of grounding: a quote proves the answer came from the document, not that the document is right. A stale page, or one that somebody planted, is quoted just as faithfully.
A 2025 study attacked a knowledge base built as a graph by inserting false relations and reached an attack success rate of up to 98.2%; of the defences tested, only tracking where each piece of content came from and scoring its trust made a real difference (Liang et al., 2025). Who may add to the knowledge base matters as much as how it is searched.Important: a model that must quote its source can be audited. A model that answers from memory cannot.
What it means for us: design the assistant so every factual claim comes from a document in the context, and show the document.
Why it matters: it turns "is the AI right?" into "is this line in our policy?", which anyone can answer.
Prefer answers built from retrieved text over answers from the model's memory.Require quotes. Check them.A grounded answer is only as true as its source. Control who writes the sources.Layer 5: knowledge bases
Question: if the context must stay short, how does the right page get into it?
Managing the context is the most important thing we can do to improve an agent and reduce hallucination. A knowledge base is how the information the model needs is exposed to it: internal instructions, policies, product descriptions. Say you have a policy to process returns within 15 days if the product was unpacked. The model will never know that from training. The rule is useless until it is in the context at the moment the question is asked.
If it is small, paste it. When there are few policies and they are short, put them all in from the start of the conversation.
Anthropic's advice is that if the whole collection is under about 200,000 tokens, roughly 500 pages, pasting beats any search, and a caching feature makes re-sending the same pages about 90% cheaper, a vendor claim (Anthropic, 2024, contextual retrieval).A short policy document fits. A product catalogue, years of support tickets and supplier contracts do not. For collections past that size, the community's approach is to split the text into smaller pieces and find a way for the model to retrieve the right piece.
Way 1: a wiki the model walks. Proposed by Andrej Karpathy under the name LLM wiki. Keep the original documents untouched and have the model write and maintain a second layer: a page per topic, a short summary per page, and an index of summaries at the top. Higher levels summarise the pages below them. To answer, the model starts at the index, reads the summaries, and goes down the tree to the page or pages it needs (Karpathy, 2026). I organise my own knowledge base this way, and I use it instead of skills, rules or instruction files. Everything the model should know lives in one wiki, which keeps the setup generic and the same for every provider: Claude, OpenAI, Google, open-source tools.
A 2026 study compared ways of presenting large text to a model and found that a flat index of summaries, which the model expands when needed, beat loading everything and beat several more elaborate schemes (Zhang et al., 2026, Progressive Disclosure).Way 2: search by meaning. This is what the industry calls RAG, retrieval-augmented generation. It needs a second kind of model, a sentence or embedding model. Where the language model takes text and produces a reply, the sentence model takes text and produces a list of numbers, a vector. Two pieces of text with similar meaning get similar vectors. That lets a database find text by meaning rather than by exact words. The practical trick: for each chunk of your documents, ask the model what question that chunk answers, turn the question into a vector, and store it as the key. When the assistant has a question, turn it into a vector with the same sentence model and fetch the chunk whose stored question is closest. A customer's "where is my refund" lands on the refund-timing section even though the policy never uses the word "where".
A 2024 review listed seven ways such systems fail in practice, including the right chunk not being found and the found chunk not making it into the final answer (Barnett et al., 2024). Search is not the same as understanding.Anthropic reports that prefixing each chunk with a one-sentence note about where it comes from cut retrieval failures from 5.7% to 1.9% on their own test, a claim (Anthropic, 2024, contextual retrieval).Way 3: a map of entities. A graph RAG stores entities and their relationships instead of chunks: the product, the supplier, the warranty, the policy, and the links between them. Questions that need several facts joined ("which supplier covers the warranty on the product in this order?") walk the links.
A systematic comparison found search by meaning ahead on single-fact questions and the graph ahead on multi-step ones, with neither winning overall (Han et al., 2025).Whichever way: somebody owns it. A knowledge base goes out of date silently. A policy that changed and was not updated is served as true, with a quote. Each part of it needs a named owner, a way for corrections to flow back, and a date on every answer that says how fresh the source is.
Anthropic describes its internal data-analysis agent going from 21% accuracy without curated, owned knowledge to over 95% with it, and names stale definitions as one of the three root causes of wrong answers, ahead of the model's intelligence; a vendor report (Anthropic, 2026, self-service data analytics).Important: the model does not know your business and never will from training. It knows exactly what is in the context, and a knowledge base is the machinery that puts the right page there.
What it means for us: the quality of the assistant is bounded by the quality and organisation of the documents behind it, not by the model.
Why it matters: cleaning and structuring your documents is a task your team already knows how to do.
Small collection: paste it all.Larger: a wiki the model walks, or search by meaning, or both.Multi-step questions: a map of entities.Every part has an owner and a freshness date.Layer 6: memory
Question: if the model forgets everything between requests, how does an assistant "remember" a customer?
It does not learn. At the end of a conversation the software writes a short note to disk: "this customer disputed a fee, resolved by waiving it". At the start of the next conversation it puts that note into the context. That is all memory is: a way to write into the context before the first message. Everything from Layer 2 applies to it. Notes make the context longer, and a stale or wrong note is read on every later session as if it were true.
A 2026 paper calls this kind of memory a memo, not true memory, and shows that what is recalled depends entirely on what the software chose to write down and when (Zhu et al., 2026).The same paper collects attack results: planting one malicious note in an assistant's memory file succeeded in 98.2% of attempts on one setup. A note that says "always waive the fee" is obeyed next session like any other instruction.Developer tools document the same mechanism: a hierarchy of instruction and memory files read at the start of every session, from the current folder up to the home folder (Anthropic, Claude Code memory documentation).Memory is worst at the thing customers do most: change. A 2026 comparison of twelve memory systems on tests where an old fact must be replaced by a new one found the best of them right only 44.4% of the time (Zhou et al., 2026). A separate 2026 review of six memory designs found none that verifies a note is really gone after it is deleted (Lin et al., 2026). A "forget me" request may not be honoured by the system that promised it.Remembering that a customer already received a goodwill waiver is useful. Letting the assistant write its own notes without review is how a one-off waiver becomes a policy.
Important: memory is not learning. It is a note the software writes today and puts into the context tomorrow.
What it means for us: decide who may write memory and what may be written before deciding what to remember.
Why it matters: a write path into the context is a write path into every future answer.
Memory is context, re-sent. It lengthens the context like anything else.Guard the write path. Review what gets saved.Updating and deleting are the weak spots. Test them before promising them.Layer 7: harness
Question: if the model is fixed, where does the rest of the quality come from?
The harness is everything that is not the model. The loop from Layer 3 is part of it. So is the code that builds the context, the permission check before a tool runs, the routine that trims the context when it gets long, the memory notes from Layer 6, and the logging that lets you see what happened. Different companies wrap the same model in very different harnesses and get very different results.
A 2026 experiment ran fifteen models on the same coding tasks with two harnesses. The weakest model went from 6.7% to 68.3% of tasks solved with only the harness changed (Stencil, 2026). The model was identical.A 2026 paper that searches over harness designs automatically reports a 6 times improvement on one task family without touching the model (Meta-Harness, 2026).A review of Claude Code counted 54 tools, seven permission modes and a five-stage routine for shrinking the context (Zhang et al., 2026, Dive into Claude Code).One harness part deserves its own paragraph: permissions. Every tool request passes through the harness before it runs. That is where "the assistant may look up orders but may not issue refunds above 200 euros without a human" is enforced. The model never sees the rule as a wall; it sees a tool request that was declined. A hand-off-to-human tool is the same rule made visible: anything the assistant may not decide goes to a person.
Asking a person to approve each request does not scale, because people stop reading the prompts. The stronger control is to fence what the agent can reach at all, with a sandbox, and keep the approvals for what is left.
Anthropic reports that its users approved about 93% of permission prompts, experienced users auto-approving twice as often as new ones, and that moving the limits into an operating-system sandbox cut the number of prompts by 84%; a vendor report (Anthropic, 2026, How we contain Claude). The same report says environmental limits consistently beat behavioural safeguards inside the model.The last harness part is the log. When an agent fails, the cause may be the model, a tool, or the harness itself, and only a step-by-step record of the run lets you tell which.
A 2026 study built a taxonomy of model failures versus harness failures and found the best automatic judge classified the cause correctly only 80% of the time; in one case a bug in the test harness was blamed on the model (Raj et al., 2026). Without logs, every failure becomes "the AI was wrong".Important: the same model gave 6.7% and 68.3% depending on the harness. The harness is where the difference was made.
What it means for us: "we use the same model as the market leader" says nothing about the results. Ask about the harness.
Why it matters: harness choices are yours to make: what the agent may reach, what it remembers, what it must hand off, and what gets logged.
Same model, different harness, tenfold difference in results.Permissions live in the harness, where the tool call is honoured or declined.Fence what the agent can reach; people approve nearly everything.Log every step, or every failure is "the model".Layer 8: subagents
Question: what if one task is bigger than one short context?
Layer 2 said the context should stay short. Some tasks do not fit: "read all 3,000 tickets from last quarter and list the five most common complaints" cannot be done in one context of 100,000 tokens. The answer is not a longer context. It is more contexts. The harness starts a second, fresh context with a narrow brief ("read tickets 1 to 300, return the complaint categories you see"), lets it work, and takes back only a short summary. It does that ten times and gives the ten summaries to the main context. Each helper is called a subagent. Each stays short and focused, and the main context only ever sees the summaries.
Anthropic describes its own multi-agent research system this way and recommends that each helper return a summary of one to two thousand words, not its full working (Anthropic, 2025, context engineering). The same source puts the cost at about 15 times the computation of a single chat, a claim.A 2026 study on long documents found a model reading one 100,000-token document in a single pass scored 34.4% on questions about it, against 75.8% on short inputs. Splitting the reading across parallel helpers and merging their notes brought it back to 85.4% (Zhao et al., 2026). Many short readings beat one long one.The cost is real and the control problem is new: a helper that returns a wrong summary cannot be caught by the main context, which never saw the source. The eval in Layer 10 is the check. Two more limits show up as soon as helpers are used for work rather than reading.
More helpers can mean worse results. A 2026 study of coding teams of agents found self-organising teams reached 0.88 times the speed of a single agent, against 1.36 times for teams with pre-assigned tasks, and produced 4.75 times more test failures (Mieczkowski et al., 2026). Coordination is overhead, and it grows faster than the team.A helper only knows its brief. A 2026 study gave one agent the full specification and split the same task across helpers with partial ones: 88.6% success against 58.2%. Giving the full specification to the step that merges the pieces brought it back to 88.9% (Chacon Sartori, 2025). Whoever assembles the parts must see the whole.Big task: many short contexts, each returning a summary, not one long context.Helpers are cheaper in quality and dearer in computation. Budget both.Assign the split; do not let helpers self-organise. The merger sees the full brief.Layer 9: loops
Question: what if the work takes longer than one conversation?
A single session degrades as its context fills. The simplest pattern for long work is to not have long sessions. Start a brand-new session, give it one task from a list, let it work, check the result, and start another. Progress lives in files on disk, not in the context. The community name is the Ralph loop.
The pattern's author ran it unattended overnight on a to-do list of software tasks and reports it worked precisely because each run started with an empty context and one task (Huntley, 2025; HumanLayer, 2026).The working rules from practitioners: one task per run, a written definition of done, every run begins by reading the state from disk, and a hard cap on how many runs may happen before a human looks.A cap on runs is not a cap on money. A 2026 study of agent spending found agent tasks consume about 3,500 times the tokens of a single answer, that the cost of the same task varies up to 30 times between runs, and that models predict their own spend poorly (Bai et al., 2026). Each run needs its own budget limit, enforced by the harness."Done" must be decided by something other than the agent: a test, a checker, a rule. A 2026 paper from the Qwen team argues every such checker is only a stand-in for what you want, and that agents under pressure learn to satisfy the checker rather than the goal (Wang et al., 2026). Write the definition of done so that passing it is hard to fake.Labelling a large ticket archive works this way: one run per hundred tickets, each from a clean start, with a counter and a stop condition.
Long work is many short sessions, not one long one.State on disk, one task per run, a cap on runs and a cap on spend per run.Done is decided by a check outside the agent.Layer 10: evals
Question: we changed the context, the tools, or the model. Did it help?
You cannot tell by chatting with it. The industry's answer is an eval: a written test with an answer key. Collect twenty to fifty real questions from your users, write down what a correct answer must contain, run the assistant on all of them after every change, and grade. Rules grade what is definite (did it state the right number of days? did it quote a section?). A second model grades what is a matter of judgement (was the tone right?), and that grader is itself checked against a sample of human grades before it is trusted.
The vendor's guide and the most-read practitioner guide both start with the same step: read the real failures by hand before writing any test (Anthropic, 2026, evals; Husain, 2024).Without an eval, every change is an opinion. With one, it is a number that went up or down.Run every case more than once. A 2026 study found agents that can solve a task often fail the same task on other attempts, and that reliability across five runs has improved six times more slowly than single-run accuracy (Rabanser et al., 2026). The vendor guide distinguishes "passes at least once" from "passes every time", and the second is the one that matters in production (Anthropic, 2026, evals). Ask for the second number.A model grading a model has limits. A 2026 study of a grader on customer-service agents found it ranked agents almost exactly as the ground truth did, yet 57.5% of conversations the simulated users were satisfied with had failed the task (Bodhwani et al., 2026). Task success and user satisfaction are two measurements. Keep both.A full article on evals, with a worked example and its own numbers, is here: [link to the evals article].
Important: a model that is not measured is not improving. It is changing.
What it means for us: any AI project should have its test set before its second week.
Why it matters: evals are the only way to say "the new version is better" and mean it.
Twenty to fifty real cases with expected answers.Run after every change, several times each. Grade with rules where possible.Report "passes every time", not "passed once".Layer 11: interactive versus headless
Question: what changes when there is no person reading the replies?
Everything so far assumed a person at the other end, typing and reading. Interactive use means the assistant stops after each reply and waits for a human. Headless use means it is started by a program, works through a task, and ends without anyone watching. The same model, the same loop, and three things change.
There is no one to answer a question. Every clarification the assistant would have asked must be in the brief up front, or it must be told to stop and leave a note.There is no one to approve a tool request. The permission rules from Layer 7 must be written down and enforced by the harness, not by a person clicking "allow".There is no one to notice a bad result. The eval from Layer 10 becomes the only check.Two numbers say how much of this is really new.
The person clicking "allow" was never a strong control: the same vendor report from Layer 7 found users approving about 93% of prompts (Anthropic, 2026, How we contain Claude). Headless makes the sandbox mandatory; it was already the better control in interactive use.Questions must come at the start. A 2026 study let an agent ask for clarification at different points of a task. Asking in the first 10% of the run kept success at 0.78; asking later collapsed it to 0.39, and asking past the midpoint was worse than never asking (Gulati et al., 2026). A headless brief must answer the questions before the run starts.Headless is the step between an assistant and an autonomous system. An assistant you talk to; a headless agent you brief, launch, and inspect afterwards.
Headless means the brief, the permissions and the check must all be written before the run.The sandbox replaces the "allow" click, which was already weak.Layer 12: assistant versus autonomous AI
Question: when is it safe to let the agent run on its own?
An assistant does one task when asked. An autonomous system takes tasks from a queue, works through them without a human in the loop, and reports back. Getting from the first to the second is not a bigger model. It is five harness properties.
A queue: tasks are written down somewhere the agent can read, with a definition of done.Claiming: each run takes one task and marks it taken, so two runs never work on the same thing.Isolation: each run works in its own copy of the files, so a bad run cannot damage another.Verification: each result passes an automatic check before it counts as done.Escalation: whatever fails the check, or asks a question nobody can answer, goes back to a human.The fourth property, verification, carries the most weight, because the agent's own report cannot be trusted.
A 2026 study ran agents in live multi-user settings and documented eleven confirmed failure types, among them obeying people who were not their owner, leaking information, and reporting a task as done while the system showed it was not (Shapira et al., 2026). The check must look at the system, not at the agent's message.Most organisations are not set up for this yet. McKinsey's 2026 survey on AI trust found only about 30% of companies at a mature level in strategy, governance and agent controls, and security and risk concerns blocking agent scale-up for nearly two thirds of respondents (McKinsey, 2026). The five properties above are the governance that is missing.The upside when they exist: a 2026 paper scaled a queue-claim-verify setup to 1,024 agents working on one codebase, with the pass rate rising from 33.89% to 55.06% as the organisation around the agents was improved (Agensh, 2026).A full article on the road from an interactive assistant to an autonomous fleet, with the failures along the way, is here: [link to the autonomous AI article].
Autonomy is queue, claim, isolate, verify, escalate.The escalation path is what makes the other four safe.Verify against the system, never against the agent's own report.Layer 13: are "skills" useful?
Question: vendors and marketplaces sell "skills" for agents. Is that proficiency?
No. A skill in this industry is a text file: a description of expectations, rules and steps the model should follow for a kind of task. It does not make the model better at anything. It adds to the context, like any other instruction. Marketplaces now list skills in bulk, many of them generated by a model, and the studies below measured what they do to results.
A 2026 benchmark of web-development tasks found that injecting typical skills lowered success by 1.3 to 4.2 points while raising the words consumed by 72% to 394% (Signal or Noise, 2026).A study of 8,135 trials found an average gain of 2.8 points with a confidence interval that crossed zero, meaning no proven effect, and found models picked the wrong skill from a large set 29.6% of the time against 3.3% from a small one (Demystifying Agent Skills, 2026).The same work found hand-curated skills added 16.2 points where generated ones lost 1.3. A skill written by someone who knows the job helps. A skill written by a model to fill a marketplace does not.A scan of one marketplace found 1,184 malicious skills and 26.1% of all listings with at least one vulnerability, such as instructions to send data elsewhere (SoK: Agentic Skills, 2026; Automating Skill Acquisition, 2026).Even reasonable skills break specific cases. A 2026 study ran agents with and without public skills on the same tasks and found 307 skill-caused regressions: 125 tasks that failed only with the skill, and 182 that passed but cost more than twice the tokens or time (Dong et al., 2026). The only way to see this is to run the eval from Layer 10 with the skill and without it.A short, hand-written procedure for handling refund disputes helps. Forty installed skills about customer service do not.
Important: a skill is a text file in the context, not a capability. Curated ones help; generated ones in bulk hurt.
What it means for us: write few skills, by hand, by people who do the job, and treat marketplace skills as untrusted software.
Why it matters: the harm is twofold: worse answers and a new door for attackers.
Few, hand-written, by the people who know the work.No installing from marketplaces without review.Every skill is tested against a run without it.Questions to ask your team
What is in the context on the first message? Ask for the list: system prompt, skill headers, tool definitions, memory notes. If nobody can produce it, nobody is managing it.How long does a typical session get? Use: a hard cap near 100,000 tokens. Then check: whether anyone has seen a session go past it.How many tools are connected, and are any two similar? Use: fewer than ten, distinct names. Then check: what the agent can reach when it runs them, and whether a sandbox fences it.What leaves the company in the context? Use: a written list of allowed data, direct connection to the vendor. Then check: whether tool outputs are treated as untrusted text.Where does each fact in a reply come from? Use: quotes from the context. Then check: a sample of replies against the quoted sources.Are the policies pasted, indexed, or searched? Use: paste under 500 pages. Then check: how the index or the search is maintained.Who owns each part of the knowledge base? Use: a named owner and a freshness date per part. Then check: when a changed policy last reached the agent.Who can write into memory? Use: only the harness, from approved steps. Then check: whether an update or a deletion really takes effect.What does the eval set look like? Use: twenty to fifty real cases with expected answers, each run several times. Then check: the "passes every time" number, not "passed once".What is the budget per run? Use: a hard spend limit the harness enforces. Then check: how much the same task varied between runs.What happens when the agent runs without a human? Use: brief, permissions and check written down before launch. Then check: whether "done" is verified against the system or taken from the agent's report.Which skills are installed and who wrote them? Use: few, by hand. Then check: anything from a marketplace.Twelve things to remember
An AI system is a model, a context, and tools. Nothing else.The model is stateless and cannot act. Memory is re-sent text; action is a request the software honours.The context is everything sent to the model, including the instructions, the tool list and every tool output. It is assembled before the first message.Shorter context, better and cheaper answers. Keep it under about 100,000 tokens and start a new session per task.Few, distinct, well-described tools. Everything a tool brings back is untrusted text, and the whole context leaves the company on every request.Fine-tuning is the hardest change and the last to try. It teaches behaviour, not facts.An agent is a loop around the model that honours tool requests. The loop is where control lives.A reply grounded in quoted text can be checked. A reply from the model's memory cannot. Require quotes, and control who writes the sources.The model never knows your business. A knowledge base is the machinery that puts the right page into the context.The harness, not the model, made the measured difference. Fence what the agent can reach; people approve almost every prompt. Log every step.Long work is many short sessions with state on disk and a spend cap per run. An eval, run several times per case, is the only way to know a change helped.Autonomy is queue, claim, isolate, verify, escalate, with "done" checked against the system, never the agent's report. Skills are text files; test each one against a run without it.References
Agensh (2026). Scaling Organizational Intelligence to 1,024 Agents. arXiv:2609.26781.Anthropic (2024). Introducing Contextual Retrieval. anthropic.com/news/contextual-retrieval.Anthropic (2025). Effective context engineering for AI agents. anthropic.com/engineering/effective-context-engineering-for-ai-agents.Anthropic (2025). Introducing advanced tool use on the Claude Developer Platform. anthropic.com/engineering/advanced-tool-use.Anthropic (2026). Demystifying Evals for AI Agents. anthropic.com/engineering/demystifying-evals-for-ai-agents.Anthropic (2026). How Anthropic enables self-service data analytics with Claude. claude.com/blog/how-anthropic-enables-self-service-data-analytics-with-claude.Anthropic (2026). How we contain Claude. anthropic.com/engineering/how-we-contain-claude.Anthropic. Claude Code: How Claude remembers your project. code.claude.com/docs/en/memory.Anthropic. Context windows. platform.claude.com/docs/en/build-with-claude/context-windows.Anthropic. Reduce hallucinations. docs.claude.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations.Anthropic. Working with the Messages API. docs.claude.com/en/docs/build-with-claude/working-with-messages.Automating Skill Acquisition through Large-Scale Mining of Open-Source Agentic Repositories (2026). arXiv:2603.11808.Bai et al. (2026). How AI Agents Spend Your Money. arXiv:2604.22750.Barnett et al. (2024). Seven Failure Points When Engineering a Retrieval Augmented Generation System. arXiv:2401.05856.Bodhwani et al. (2026). GAUGE: When Not to Trust LLM-as-a-Judge in User-Simulated Evaluation of Task-Oriented Agents. arXiv:2609.12191.Brown et al. (2020). Language Models are Few-Shot Learners. arXiv:2005.14165.Chacon Sartori (2025). The Specification Gap: Coordination Failure Under Partial Knowledge in Code Agents. arXiv:2603.24284.Chen et al. (2026). The Price Reversal Phenomenon. arXiv:2603.23971.Chroma Research (2025). Context Rot: How Increasing Input Tokens Impacts LLM Performance. research.trychroma.com/context-rot.Community analysis of the leaked Claude Code source (2026, unverified). x.com/iamfakeguru/status/2038965567269249484.Demystifying Agent Skills: Why They Work, Until They Don't (2026). arXiv:2608.14036.Dong et al. (2026). Agent Skills Can Be Harmful. arXiv:2608.11888.Gulati et al. (2026). Ask Early, Ask Late, Ask Right. arXiv:2605.07937.Han et al. (2025). RAG vs. GraphRAG: A Systematic Evaluation and Key Insights. arXiv:2502.11371.Hubotter et al. (2026). Compiling Agentic Workflows into LLM Weights. arXiv:2605.22502.HumanLayer (2026). A Brief History of Ralph. humanlayer.dev/blog/brief-history-of-ralph.Huntley, G. (2025). Ralph Wiggum as a "software engineer". ghuntley.com/ralph.Husain, H. (2024). Your AI Product Needs Evals. hamel.dev/blog/posts/evals.Kalai et al. (2025). Why Language Models Hallucinate. arXiv:2509.04664.Karpathy, A. (2026). LLM Wiki. gist.github.com/karpathy/442a6bf555914893e9891c11519de94f.Laban et al. (2025). LLMs Get Lost in Multi-Turn Conversation. arXiv:2505.06120.Liang et al. (2025). GraphRAG under Fire. arXiv:2501.14050.Lin, Li and Chen (2026). Mnemonic Sovereignty: LLM Memory Security. arXiv:2604.16548.Liu et al. (2023). Lost in the Middle: How Language Models Use Long Contexts. arXiv:2307.03172.Lu et al. (2026). MARCH: Multi-Agent Reinforced Self-Check for LLM Hallucination. arXiv:2603.24579.McKinsey (2026). State of AI trust in 2026: shifting to the agentic era. mckinsey.com/capabilities/tech-and-ai/our-insights/tech-forward/state-of-ai-trust-in-2026-shifting-to-the-agentic-era.Meta-Harness: End-to-End Optimization of Model Harnesses (2026). arXiv:2603.28052.Mieczkowski et al. (2026). LLM Teams as Distributed Systems. arXiv:2603.12229.OpenAI (2025). A Practical Guide to Building Agents. cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf.Ovadia et al. (2023). Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs. arXiv:2312.05934.Rabanser et al. (2026). Towards a Science of AI Agent Reliability. arXiv:2602.16666.Raj et al. (2026). Model or Harness? A Failure Taxonomy for Agent Systems. arXiv:2607.28802.Schick et al. (2023). Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv:2302.04761.Shapira et al. (2026). Agents of Chaos. arXiv:2602.20021.Signal or Noise? A Benchmark Study of Agent Skills in Web Development (2026). arXiv:2608.23067.SoK: Agentic Skills Beyond Tool Use in LLM Agents (2026). arXiv:2602.20867.Stencil (2026). We improved 15 LLMs at coding in one afternoon. Only the harness changed. stencil.so/blog/the-harness-problem.Wang et al. (2026). The Verification Horizon. arXiv:2606.26300.Yao et al. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629.Zhang et al. (2026). Dive into Claude Code: The Design Space of Today's and Future AI Agent Systems. arXiv:2604.14228.Zhang et al. (2026). Is Progressive Disclosure All You Need for Long-Context Agents? arXiv:2607.17598.Zhou et al. (2026). Are We Ready for an Agent-Native Memory System? arXiv:2606.24775.Zhu et al. (2026). Contextual Agentic Memory is a Memo, Not True Memory. arXiv:2604.27707.