Lecture 5 · COMS W4995 Agentic Engineering

Agent tools in pictures

Chapter nine

The judgment calls

Five decisions shape every tool server, and you can test each one by asking whether it would still matter with a model ten times better.

After this chapter you can

  1. State Yan Wang’s two questions and use them to sort a tool decision into a lasting problem or packaging.
  2. For each of the five judgments, name the layer and property it changes and the evidence behind it.
  3. Give the course’s 10x verdict on each judgment with a reason you can check against the evidence.
  4. Apply the five judgments to a new tool server and pick out its riskiest decision.
  5. Say which agent decisions this lecture leaves to Lectures 6 and 7.

20 minutes to read9 sections8 quiz questions

Start reading →

Consider the tool server from chapter 4: one tool searches the course catalog, another reads a syllabus, and a third posts a question to the class forum. You have not written a handler yet, but you have already made five decisions. You decided what actions exist, how many actions the model sees at once, which calls need a gate, whose text can reach the posting tool, and how the tools are packaged. Most teams make these five decisions by accident. In this chapter, we make them on purpose, one at a time. We test each decision with a single question: would it still matter if the model were ten times better?

Section 9.1

The ruler: what would a better model change?

The ruler pointed at decisions. A decision passes through two questions in turn: if the model were ten times better, would this still matter; and what problem is it solving, do I still have it. A decision that passes both is a lasting problem worth judgment. One that fails either is packaging. Two examples: whether a refund needs approval passes both; which transport carries the tool list fails the first. A decision A choice you make about a tool Question 1 Model 10x better: would this still matter? yes Question 2 What problem does it solve, and do I still have it? no yes no Packaging depreciates LASTING PROBLEM appreciates: a judgment "Does a refund need approval?" passes both: lasting. "Which transport carries tools/list?" fails question 1: packaging.
Point the ruler at a decision. A decision that survives both questions is a lasting problem and deserves your judgment.

Chapter 1 handed you Yan Wang’s ruler, so here is the short version. In his October 2 guest lecture he said “Every hot noun bundles a lasting problem with packaging from its year”1. He separates the two with two questions: “If the model were 10x better, would this still matter?” and “What problem is it actually solving, and do I still have it?”1 Understanding a lasting problem “appreciates”; packaging “depreciates”1.

In chapter 1 we pointed the ruler at protocols. Here we point it at decisions, and the same deck shows why that works. When Yan Wang split LangChain, the lasting problem he named was “Deciding what the model sees, what it may do, when it stops, and when to ask a human”1. His note under it reads: “The loop is short; these decisions are the work”1. Those are this chapter’s judgments. What the model sees is judgments 1 and 2. What it may do, and when a human is asked, are judgments 3 and 4. How the tool reaches the model at all is judgment 5.

His essays add a map for where the judgments live. He splits putting a model into a product into four layers: model, protocol, runtime and contract2. The protocol layer asks questions such as “MCP or RESTful API?”, and the contract layer asks “What does success actually look like?”2. Most packaging sits in the protocol layer. Most of this chapter’s judgments sit in the runtime layer, where tools get invoked, and in the contract layer, where you decide what counts as safe and done. His contract layer is about success criteria; it is not the tool contract from chapter 2, which judgments 1 and 2 below refer to.

He also offers a habit to keep a judgment once you have made it: “externalize first, then execute”3. Each new chat “starts from a blank slate plus your prompt”3. A decision your team made but did not write down will likely be made again next week, possibly differently.

Each judgment below has four parts, in the same order: the decision, the layer and property it changes, the evidence, and the 10x verdict. The verdicts are specific to this course. They are judgments, not measurements. Each comes with a reason you can check against the evidence and discuss.

Check yourselfYour team debates whether to expose your server over MCP or as plain REST. Where does this fit within Yan Wang’s four layers? Does it pass the first question?

This is a protocol-layer question. It mostly fails the first question: a better model does not care which wire format carried the definition. What remains is the lasting problem underneath, “Giving agents clear, safe interfaces and deciding what plain code should handle”1.

Section 9.2

Judgment 1: which actions to give the model

Before and after for judgment one, using the OpenAI function-calling guide's refund example. Before: submit_refund takes an order ID, so the model must supply a value the application already has, and could supply the wrong one. After: submit_refund takes no arguments, and the application passes the order ID itself. The model has less to guess and the tool reaches only the order on screen. Before: the model fills it After: your code fills it submit_refund(order_id) The model types an order ID your app already knows. It can type the wrong one. submit_refund() Your code passes the order on screen. Nothing to guess, and one order within reach. Same guide, same rule applied twice: don't make the model fill arguments you already know, and combine functions that are always called in sequence.
The same refund, before and after. Values your code already knows should never be the model’s job.

Your support app shows a customer’s order on screen, and the user asks for a refund. You could give the model a tool that takes an order ID. OpenAI’s function-calling guide says not to: “Don’t make the model fill arguments you already know”4. Its example is to define submit_refund() with no parameters and pass the order ID in your code, and the same passage adds: “Combine functions that are always called in sequence”4.

The decision. Design actions for the task itself, not for the API. Keep work that code can do reliably within your code. For each tool, ask if the agent truly needs it.

The layer and property. This is the contract, the part of the tool the model reads (chapter 2). The property it sets is what the model can do at all. Every argument the model fills is a value it can get wrong. Every tool it holds is a door it can open.

The evidence. Anthropic describes a tool as “a contract between deterministic systems and non-deterministic agents”5: the caller might skip the tool, misuse it, or “hallucinate”5. This is why we move certain work into code. Anthropic’s advice on agents points the same way: “we recommend finding the simplest solution possible, and only increasing complexity when needed”6. The Claude Code team keeps about 20 tools and says “The bar to add a new tool is high, because this gives the model one more option to think about”7. The shape of the actions also changes results. SWE-agent’s authors gave a model “a small set of simple actions for viewing, searching through and editing files” and report that interfaces built for language models “outperform existing user interfaces (UIs) designed for human users, such as the Linux shell”8. Those are 2024 models (chapter 2 gives the numbers). Sierra states the security side plainly: “The best way to make sure that an agent can’t do something unexpected with sensitive data is to avoid giving it that data in the first place”9.

The 10x verdict: still matters. A better model chooses better among the actions you provide. It does not reduce the scope of what those actions can reach. The action set determines the blast radius—how much damage one wrong call can do—and that is a property of your system. One honest limit: specific tools do expire. The Claude Code team writes that “As model capabilities increase, the tools that your models once needed might now be constraining them”7. The tool list changes over time; you still have to decide what goes on it.

Check yourselfYour API has cancel_order(order_id) and refund(order_id). In your business, every cancellation is followed by a refund. The order is already on screen. What do you give the model?

One tool, such as cancel_and_refund(), with the order ID passed by your code. Both rules from the same guide apply here: merge functions always called in sequence, and don’t make the model fill arguments you already know4.

Section 9.3

Judgment 2: how much the model sees at once

A number line of tools visible to the model, from 0 to 60. A Studio tool server with 3 to 8 tools sits at the far left, below every vendor figure. OpenAI suggests fewer than 10 functions per namespace. Anthropic suggests tool search from 10 tools. OpenAI's soft suggestion is fewer than 20 functions at the start of a turn. Anthropic says Claude's selection degrades past 30 to 50 tools. These are vendor rules of thumb, not measured limits. Tools visible to the model at once Studio: 3 to 8 0 10 20 30 40 50 60 OpenAI: under 10 per namespace Anthropic: tool search from 10 OpenAI: under 20 at the start of a turn, "a soft suggestion" Anthropic: Claude's selection degrades past 30 to 50 Vendor rules of thumb for their own models, not measured limits for yours.
A Studio tool server sits below every threshold these vendors give. The thresholds are rules of thumb for their own models.

Connect five common MCP servers, for GitHub, Slack, Sentry, Grafana and Splunk, and Anthropic’s documentation says their definitions “can consume ~55k tokens” before Claude does any work10. The model must read this menu before each choice it makes.

The decision. Show the model the smallest set of tools that can do the job. First, subtract tools you don’t need. Then, merge tools that always go together, and group tools by domain. Only after these steps should you load tools on demand or let the model call them from code. Chapter 5 covers all four of these moves.

The layer and property. This is the contract again, but now it’s about what fills the context. The property is what the model sees at one time.

The evidence. Longer menus make selection harder. RAG-MCP reports that retrieving only the relevant tool descriptions “more than triples tool selection accuracy (43.13% vs 13.62% baseline)” on its benchmark tasks11. ToolMenuBench, across seven model backends, reports task success rising from 32.1% when every tool is visible to 85.7% when using its filter, with about 98% fewer tokens12. Anthropic states “Claude’s ability to pick the right tool degrades once you exceed 30–50 available tools”10. OpenAI’s guide says “Aim for fewer than 20 functions available at the start of a turn at any one time, though this is just a soft suggestion”4, and it suggests namespaces of “fewer than 10 functions”13. None of these vendors publishes the evaluation data behind its numbers, and each offers guidance specific to its own models4,10. A Studio tool server with three to eight tools is below the thresholds these vendors provide, and Anthropic itself says standard tool calling “is a better fit when you have fewer than 10 tools”10.

The 10x verdict: half and half. One half may shrink. Anthropic’s internal evaluation of tool search shows how much the baseline moved between models: without tool search, Opus 4 scored 49% and Opus 4.5 scored 79.5%14. A stronger model may pick well from a longer list. The other half stays, because it describes your system, not the model. Function definitions “count against the model’s context limit and are billed as input tokens”4. In Anthropic’s prompt cache, changing tool definitions “invalidates the entire cache”15, which is why OpenAI’s tool search adds newly found tools “at the end of the context window”13. And every visible tool can be misused: ToolMenuBench counts “risky-tool exposure” as a cost of its own12. A smarter model pays the same bill, and the tool it should never have seen is still within reach.

Check yourselfYour Studio server has six tools. A teammate wants to add tool search “to be safe”. What do you say?

Six tools is below every vendor threshold discussed in this chapter. Anthropic says standard tool calling works better with fewer than 10 tools10. Tool search would add a moving part without solving an existing problem. First, measure selection on your own tasks (chapter 8), and then revisit this decision when your list of tools grows.

Section 9.4

Judgment 3: who decides this step

Who decides a step. The model writes a call. A prompt instruction sits beside the model as a note it may or may not follow. The harness checks the call against rules written in code, deny first, then ask, then allow, and a blocking hook can stop it. Reads go through to the world. Writes go through a gate, and every write tool must answer one more question: what if it runs twice? Model writes a call Prompt "Never touch production" a note: shapes what the model tries HARNESS, IN CODE deny, then ask, then allow a blocking hook can stop it a lock: decides what runs read: runs write: through a gate What if it runs twice? A timed-out call ran once or not at all; the caller is not told.
A prompt is a note; a harness rule is a lock. Reads pass. Writes go through a gate, and each write tool must answer what happens if it runs twice.

In July 2025, Replit’s CEO wrote that its “agent in development deleted data from the production database” and called it “Unacceptable and should never be possible”18. A user affected by this wrote a separate complaint. They said that during a code freeze, the agent kept changing code “Despite repeated explicit instructions—including eleven separate warnings in ALL CAPS”19. The same account concludes: “Enforcing a true code freeze was simply impossible within Replit’s architecture”19. Keep these two points separate: the user’s account states the warnings were about the freeze, not the database19. Both failures teach the same lesson.

The decision. Let reads pass. Send every write through a gate in your code. Give every write tool an answer to one question: what if it runs twice?

The layer and property. This is the harness (chapter 2). The property is who decides whether a requested call runs.

The evidence. Claude Code’s documentation draws the line: “Permission rules are enforced by Claude Code, not by the model. Instructions in your prompt or CLAUDE.md shape what Claude tries to do, but they don’t change what Claude Code allows”20. Its rules are checked in a fixed order, “deny, then ask, then allow”20, and a hook that exits with code 2 blocks a call even if its own output says allow21. Replit’s fixes were structural in the same way: “automatic DB dev/prod separation to prevent this categorically” and a “one-click restore” from backups18. OpenAI keeps the same line when the model writes code: for “Writes or approval-sensitive actions”, its guide says “Use direct tool calling by default to preserve a clear authorization boundary”22.

Then there is the second half of the decision. In 1984, Birrell and Nelson wrote that a failed remote call “will have been invoked either once or not at all—the user is not told which”16. As of October 2026, the tool-calling guides from OpenAI, Anthropic and Google, searched in full as fetched on October 3, say nothing about what to do when a call may already have run or may run twice4,23,24,25. That part is left to you. An old answer exists. RFC 1057, the 1988 Sun RPC specification, says a server “may choose to remember this ID after executing a call and not execute calls with the same ID”17.

The 10x verdict: fully matters. A smarter caller still cannot undo a write. It still cannot see whether a lost call ran, because the reply never arrived. It can also be wrong about its own actions. After the Replit deletion, the agent “initially denied that rollback functionality existed”19. The gate has to sit where the model’s judgment cannot move it.

Check yourselfYour posting tool times out, and the agent retries. What can go wrong? What would you change?

The question may be posted twice: a call that failed may have run “either once or not at all”16. Give each post an ID that your server remembers. Refuse a second post with the same ID, the way Sun RPC servers could skip a repeated transaction ID17. Posting stays a write, so it also goes through the harness’s gate.

Section 9.5

Judgment 4: whose words can steer which action

Before and after for judgment four, the GitHub MCP case reported by Invariant Labs. Before: one session can read a public issue an attacker wrote, read the user's private repositories, and open a pull request in the public repository; all three legs together leak private data. After: a policy allows only one repository per session, so a call to a second repository is refused and the leak path is cut. Before: one session holds all three Public issue untrusted content Private repos private data Public pull request a way to send data out The agent obeys the issue, reads private data, and publishes it. After: one repository per session Session bound to the first repo it touches. A call naming a different repo or owner raises a violation and does not run. Private repos: out of reach in this session The fix is a rule over the session's own tool calls, enforced outside the model. No prompt asks the model to be careful; the second repository simply cannot be called.
The GitHub case before and after. The fix took a leg away from the session instead of asking anyone to be careful.

In 2025, Invariant Labs put instructions in an issue on a public GitHub repository27. A user’s agent, connected through GitHub’s MCP server to an account that could also read private repositories, read the issue while handling a normal request27. It could then be “coerced into pulling private repository data into context, and leaking it in an autonomously-created PR in the public repository”27. The researchers emphasize that “this is not a flaw in the GitHub MCP server code itself”27.

The decision. Treat anything a tool returns as data, never as an instruction. Do not let one session hold private data, untrusted content, and a way to send data out at the same time.

The layer and property. This is about the harness and scope of a session. The property is whose words count. Chapter 2’s fourth question asked who wrote the contract and the result. This judgment is what you do with that answer.

The evidence. OpenAI’s 2023 launch post for function calling already warned that “untrusted data from a tool’s output can instruct the model to perform unintended actions”28. A 2023 paper identifies the cause: “LLM-Integrated Applications blur the line between data and instructions”29. Simon Willison explains why the model cannot resolve this alone: “LLMs are unable to reliably distinguish the importance of instructions based on where they came from”26. His lethal trifecta consists of private data, exposure to untrusted content, and the ability to send data out. With all three, he writes, “an attacker can easily trick it”26.

Dialogs did not hold. Claude Desktop asks before each call by default, but “many users already opt for an ‘Always Allow’ confirmation policy”27, and in Cursor the arguments sat “hidden behind an overly simplified UI representation”30. Structure did hold. Invariant’s fix is a policy that allows one repository per session27. Sierra hands its agent “a separate GitHub token that only gives read-only access to specific repositories”9. The CaMeL defense separates the plan from untrusted data and reports 77% of AgentDojo tasks solved “with provable security”, against 84% for an undefended system31. That is a real cost in capability, paid on purpose.

Vendors now incorporate this rule into products. Claude Managed Agents’ automatic evaluator “does not read intent from a tool result, a fetched webpage, an MCP server’s response, or a message between session threads”32, but end-user text you relay in user messages counts as your intent32.

The 10x verdict: fully matters. A better model still reads one stream of tokens: “Everything eventually gets glued together into a sequence of tokens and fed to the model”26. An attacker only needs one success. This is why Willison, discussing guardrail products that claim to stop 95% of attacks, says that in web application security that number is “very much a failing grade”26. In the cases in this chapter, prompts and dialogs failed, but structural limits held.

Check yourselfYour new agent reads incoming support emails, can query the customer database, and can send replies. Which of the three legs is involved, and which would you remove first?

All three are involved: emails are untrusted content, the database is private data, and replies are a way out26. Removing a leg could mean drafting replies for a human to send, or limiting the database query to only the sender’s own records. There is no single correct answer, but the change must be structural, not a prompt asking the model to be careful.

Section 9.6

Judgment 5: which packaging

Chapter 4 discussed this judgment when we looked at what a packaging adds beyond a local function. Here is a short version, placed next to the other four judgments.

The decision. Begin with the simplest packaging that works for the agents using the tool. Add an MCP server when several hosts need the same tool, or when a server must hold a credential that the agent should never access.

The layer and property. This refers to packaging, and the property describes how the tool reaches the harness and where its credentials are stored.

The evidence. CMU’s tool-use lecture states “MCP is an alternative agent-facing interface—not a requirement for calling REST APIs”33. When MCP truly adds value, it is through credential brokering: “the server accepts one credential and uses a different credential upstream. The model sees neither secret”33. A commenter in a Hacker News discussion about CLIs versus MCP made this same point: “Authorization, in my opinion, is the big problem you need MCP for”34. If you do build a server, FastMCP’s documentation warns that models do “significantly better” with curated servers “than with auto-converted OpenAPI servers”35, though it offers no benchmark. Yan Wang’s default approach is a sequence: “Start with a CLI and an instruction file; add MCP when distribution requires it”1.

The 10x verdict: mostly packaging, but the switching cost is real. A better model does not care much which format carried the definition. You still pay to change between packagings. The 2026-07-28 MCP revision removed protocol sessions and the opening handshake36, and one partner quoted in the release said “The biggest changes are breaking ones”37. The same revision notes that a client whose response stream breaks “MUST re-issue it as a new request with a new request ID”36. Packaging details can reach back into judgment 3: if the lost request was a write that already ran, the re-issued one arrives with a new request ID, so only your own tool-level ID can catch the repeat.

Check yourselfThree teams’ agents, running in two different hosts, need your catalog tools. The posting tool requires a forum key that no agent should hold. Should you use a CLI, a local function, or an MCP server?

You should use an MCP server. Multiple hosts can discover and call it, and it can broker the forum key so the model never sees it33. If you had only one agent in one harness, a local function would do: MCP is “not a requirement for calling REST APIs”33.

Section 9.7

At company scale

Tools at company scale. Several agents connect through one gateway, which checks identity, applies permissions and keeps one log, before calls reach services such as GitHub, a CRM and a data warehouse. Interactive work runs as the user; scheduled work runs as a service account with only the permissions it needs. Off to the side, a registry lists server metadata but does not vet what a server does. Agents coding agent support agent nightly job One gateway identity: who is asking permission: which tools, which data one log of every call Services GitHub CRM data warehouse interactive work runs as the user; scheduled work as a service account Registry lists server metadata; does not vet what a server does
At company scale the gate moves into one gateway. The registry beside it lists servers; it does not vouch for them.

Cloudflare describes an LLM as “the most brilliant and enthusiastic junior hire you’ve ever had”, and today’s decentralized approach to MCP as “giving that junior hire a master key to every office and server room on their first day”39. One developer can make the five judgments in their own code. A company with hundreds of agents needs them made once, in one place.

The decision. Put the judgments in one shared gateway, review every server before anyone can use it, and let identity follow the work.

The evidence. A listing is not a review. The MCP Registry “hosts metadata that points to those packages”, and its metadata is “deliberately unopinionated”38; maintainers “can manually remove spam or malicious servers” after the fact38. Sierra built one gateway; by its July 2026 post, 89% of its employees used it to connect agents to 45 services9. It keeps an audit log, blocks access to sensitive data about more than one customer in a session, and requires approval out of band when someone has a legitimate reason to cross that line9. Its rule for identity: “Interactive work runs as the user. Scheduled or shared workflows run as service accounts with only the permissions they need”9. Cloudflare’s launch post describes portals where “Administrators can now review and approve MCP servers before making them available to users”, and where users sign in with the corporate identity provider39. Cloudflare’s post also concedes a gap: the portal does not yet fully prevent direct access, around the portal, to a server that has no authorization of its own39. Chapter 7 covers these patterns in more detail.

The 10x verdict: fully matters. Who may use which tool, with whose identity, and who can audit it afterward are facts about your organization. A better model changes none of them.

Check yourselfImagine a teammate finds a server in the MCP Registry. They want to add it to your company gateway today. What should the listing tell you? What still needs to happen?

The listing tells you that someone published metadata that passed format checks. The registry itself is “deliberately unopinionated”38. Someone at your company still has to review what the server does and approve it. This is the step Cloudflare’s portals put in front of users39.

Section 9.8

The five on one page, and what comes next

The five judgments on one page. Which actions: changes the contract and what the model can do; evidence, pass known values in code and SWE-agent's interface results; verdict, still matters, the action set sets the blast radius. How much it sees: changes what is in context; evidence, selection falls as lists grow and tool changes break the cache; verdict, half and half. Who decides this step: changes the harness; evidence, permission rules in code and the Replit deletion; verdict, fully matters. Whose words steer: changes whose text counts; evidence, the GitHub case and the one-repository fix; verdict, fully matters. Which packaging: changes how the tool arrives; evidence, MCP is not required, the 2026 breaking changes; verdict, mostly packaging, but switching costs are real. Judgment Changes Evidence 10x verdict 1 Which actions contract: can do pass known values in code; interface design moves results still matters 2 How much it sees context: sees selection drops as lists grow; a tool change resets the cache half and half 3 Who decides harness: says yes rules in code, not the prompt; Replit; once or not at all fully matters 4 Whose words session: whose text GitHub case; dialogs failed, one repo per session held fully matters 5 Which packaging packaging MCP not required; 2026 revision had breaking changes mostly packaging switching cost real Not on this page: splitting work across sub-agents and orchestrating them. Those decisions come in Lectures 6 and 7.
The five judgments with their layer, their key evidence and the course’s verdict. Two rows fully matter whatever the model.

Look at the verdict column. The two rows that fully matter, who decides a step and whose words can steer it, are the ones where the cases in this chapter were decided by structure: a gate in code, a session bound to one repository. The row that is mostly packaging is the one most likely to change, as the 2026 MCP revision demonstrated. When you have limited time, focus on rows 3 and 4.

This lecture focuses on a single agent and its tools. We will cover splitting a task across multiple agents in the next two lectures. CMU’s planning lecture shows an agent calling launch_subagent(goal) to run a copy of itself on a subtask, and notes that “Delegation is an action, so it can be trained”40. One type of orchestration begins with a plan that a person reviews: “Cursor, Claude Code, and Codex all introduced a Plan Mode: write a persistent plan, have a human verify it, carry it out (possibly with subagents, in parallel)”40. Lectures 6 and 7 will address sub-agents and their orchestration. Chapter 6 of this book shows how a plan can also function as a security boundary. We will also discuss memory later. CMU distinguishes memory, which is saved from an agent’s own interactions, from a skill, which is reusable knowledge about how to act41. Chapter 2 already showed that a memory write is a write, so the five judgments apply to it.

Check yourselfSuppose your agent hands a long research subtask to a copy of itself. Which of this chapter’s judgments still apply, and what concepts will we cover later?

All five judgments still apply to the tools each copy holds: what it can do, what it sees, who gates its writes, whose text reaches it, and how its tools arrive. How to split the work and how the copies coordinate are questions for Lectures 6 and 7.

Before you go on

Close the book

  1. For your Studio tool server, write the five decisions as one line each, then add the 10x verdict for each, with your own reason.
  2. Pick the riskiest of the five for your server. Name the structural limit you would put in code for it, and say which incident in this chapter it answers.
  3. A teammate says the models are getting better, so the write gate can go. Explain in three sentences why judgments 3 and 4 do not depend on the model.

Chapter nine · quiz

Test yourself

Most questions have more than one right answer, so select every option that is true. Check each question, then open “Answer and why” for the reasoning.

Question 1Apply Yan Wang’s two questions. Which of these decisions are lasting problems rather than packaging?Select all that apply.
Answer and why
  • RightWhether a tool that issues refunds needs approval before it runs. A better model still cannot undo a refund, and the need to control writes remains; it passes both questions.
  • WrongWhich transport carries the tools/list request. Transports have changed between MCP versions; the 2026-07-28 revision removed sessions and the handshake36. A better model does not care which one is used.
  • RightWhich customers’ data one session may touch. Data scope sets what a fooled model can leak; Sierra blocks sensitive access to more than one customer per session9.
  • WrongWhether a tool definition is written in one vendor’s JSON shape or another’s. This is format, the kind of thing Yan Wang files under packaging that ‘depreciates’1.
  • RightWhose credential the tool uses upstream. Credential scope is a fact about your system; CMU’s brokering slide keeps the upstream secret away from the model whatever the model is33.
Question 2Match the judgment to the layer it changes. Which pairings are right?Select all that apply.
Answer and why
  • RightPassing an order ID in code instead of asking the model for it changes the contract the model reads. It removes an argument from the tool’s definition, OpenAI’s example of not making the model fill known values4.
  • WrongWriting ‘never touch production’ in the system prompt changes what the harness allows. Prompts shape what the model tries; ‘they don’t change what Claude Code allows’20.
  • RightA rule that allows one repository per session changes whose text can steer which action. Invariant’s policy cuts the path from an untrusted issue to private data27.
  • RightMoving from a CLI to an MCP server changes the packaging and where the credential lives. An MCP server can accept one credential and use a different one upstream33.
  • WrongAdding tool search changes who decides whether a write runs. Tool search changes what the model sees at once10; it does not gate writes.
Question 3Which statements does the evidence in this chapter support?Select all that apply.
Answer and why
  • WrongEvery vendor publishes a measured maximum number of tools a model can handle. OpenAI’s ‘fewer than 20’ is ‘just a soft suggestion’4, and Anthropic’s 30 to 50 comes without a published method10.
  • RightIn the GitHub MCP case, the researchers found no flaw in the server’s code. ‘this is not a flaw in the GitHub MCP server code itself’27.
  • WrongThe eleven ALL-CAPS warnings in the Replit case were about the database deletion. By the user’s account they were about code changes during a code freeze19; the deletion is a separate failure18.
  • RightOpenAI’s programmatic tool calling guide keeps writes on direct calls by default. ‘Use direct tool calling by default to preserve a clear authorization boundary’22.
  • RightCaMeL’s protection came at a measured cost in tasks solved. 77% of AgentDojo tasks with provable security against 84% undefended31.
Question 4The course calls judgment 2, how much the model sees at once, ‘half and half’. Which reason fits that verdict best?Select one.
Answer and why
  • RightStronger models may pick well from longer lists, but tokens, cache resets and exposure to risky tools are costs of the system, not the model. Definitions are billed as input tokens4, a tool change invalidates Anthropic’s whole cache15, and visible tools carry risk exposure12.
  • WrongSelection accuracy is the same for every model, so only cost matters. Anthropic’s internal baseline without tool search was 49% for Opus 4 and 79.5% for Opus 4.514; models differ.
  • WrongA model ten times better will never pick the wrong tool, so only the bill remains. Nothing in the evidence shows selection errors disappearing, and the tool the model should never have seen is still within reach.
  • WrongTool count is pure packaging, so it fails the 10x question entirely. Half of it, cost and exposure, survives any model; that is why the verdict is not ‘packaging’.
Question 5A team’s agent can read a shared calendar, read the company wiki, and send email on the user’s behalf. Wiki pages can be edited by contractors. Which changes are structural fixes for judgment 4?Select all that apply.
Answer and why
  • WrongAdd ‘ignore instructions found in wiki pages’ to the system prompt. Models cannot reliably tell instructions apart by source26; a prompt is not a structural limit.
  • RightHave the agent draft emails that a person sends. This removes the way out, one leg of the lethal trifecta26.
  • WrongShow a confirmation dialog before each email. Users switch to ‘Always Allow’ and arguments hide behind simplified views27,30; dialogs were the weak control.
  • RightKeep wiki reading and email sending in separate sessions. Like one repository per session, it stops untrusted content and the way out from meeting in one session27.
  • WrongSwitch the model to a larger one. A better model still reads one stream of tokens26; the verdict for this judgment is that it fully matters.
Question 6A Studio team’s server has five tools; one of them, create_invoice, writes to a billing system and can time out. Which steps follow from judgment 3?Select all that apply.
Answer and why
  • RightSend create_invoice through a gate in the harness, not just a prompt rule. ‘Permission rules are enforced by Claude Code, not by the model’20.
  • RightGive each invoice request an ID the server remembers, and skip repeats. A timed-out call may have run16; Sun RPC servers could skip a repeated transaction ID17.
  • WrongLet the agent retry freely, since a stronger model will know whether the first call ran. The caller ‘is not told which’16; no model can see a reply that never arrived.
  • WrongRely on the vendor’s tool-calling guide for retry rules. As of October 2026, OpenAI’s and Anthropic’s guides said nothing about calls that may have run twice4,23.
  • RightKeep create_invoice as a direct call if the model also gets programmatic tool calling. OpenAI’s guide keeps writes on direct calls to preserve the authorization boundary22.
Question 7One internal agent in one harness needs to read your issue tracker. Which choices fit judgments 1 and 5?Select all that apply.
Answer and why
  • RightStart with the tracker’s CLI, an instruction file and a read-only token. Yan Wang’s default: ‘Start with a CLI and an instruction file; add MCP when distribution requires it’1; Sierra paired gh with a read-only token9.
  • WrongAuto-convert the tracker’s entire OpenAPI spec into an MCP server. FastMCP itself says models do better with curated servers than auto-converted ones35.
  • RightExpose only the read operations the task needs. The action set sets the blast radius; give the model as little as the task needs9.
  • WrongBuild an MCP server first because MCP is required to call a REST API. ‘not a requirement for calling REST APIs’33.
Question 8Which of these questions does this lecture leave to Lectures 6 and 7?Select all that apply.
Answer and why
  • RightHow to split a task across sub-agents and coordinate them. Sub-agents and orchestration come next; CMU’s planning lecture treats delegation as an action40.
  • WrongWhether a write tool needs a gate in the harness. That is judgment 3, decided in this lecture20.
  • RightHow a coordinating agent hands goals to copies of itself and combines their results. That is orchestration; CMU shows an agent calling launch_subagent(goal) to run a copy of itself on a subtask40.
  • WrongHow many tools the model sees at once. That is judgment 2, decided here, with chapter 5 for detail10.
  • WrongWhose text can steer a tool call. That is judgment 4, decided here27.

Sources

  1. What Gets You Hired, What Gets You Promoted, and What AI Changed. Yan Wang guest deck. ai-builders.com/resources/w4995 ↗
  2. From Process Certainty to Outcome Certainty. Yan Wang. yage.ai/result-certainty-en.html ↗
  3. Write the Skill Before You Execute. Yan Wang. yage.ai/skill-first-en.html ↗
  4. OpenAI Function Calling Guide. OpenAI. developers.openai.com/api/docs/guides/function-calling ↗
  5. Writing effective tools for AI agents—using AI agents. Anthropic. www.anthropic.com/engineering/writing-tools-for-agents ↗
  6. Schluntz & Zhang. "Building Effective Agents." Anthropic (2024).. Anthropic. www.anthropic.com/engineering/building-effective-agents ↗
  7. Seeing like an agent. Anthropic (Thariq Shihipar). claude.com/blog/seeing-like-an-agent ↗
  8. Yang et al. "SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering." NeurIPS (2024).. arxiv.org/abs/2405.15793 ↗
  9. Building Sierra's MCP Gateway: An engineering iceberg. Sierra (Mihai Parparita). sierra.ai/blog/building-sierras-mcp-gateway-an-engineering-iceberg ↗
  10. Tool search tool - Claude Platform Docs. Anthropic. platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool ↗
  11. RAG-MCP: Mitigating Prompt Bloat in LLM Tool Selection via Retrieval-Augmented Generation [round-1 C18]. Gan & Sun (arXiv). arxiv.org/abs/2505.03275 ↗
  12. ToolMenuBench: Benchmarking Tool-Menu Filtering Strategies for Reliable and Efficient LLM Agents. arXiv (Suresh Babu & Ganesh Iyer; authors state personal capacity). arxiv.org/abs/2606.15508 ↗
  13. Tool search | OpenAI API. OpenAI. developers.openai.com/api/docs/guides/tools-tool-search ↗
  14. Introducing advanced tool use on the Claude Developer Platform. Anthropic. www.anthropic.com/engineering/advanced-tool-use ↗
  15. Prompt caching - Claude Platform Docs. Anthropic. platform.claude.com/docs/en/build-with-claude/prompt-caching ↗
  16. Implementing Remote Procedure Calls (Birrell & Nelson), ACM TOCS 2(1). ACM Transactions on Computer Systems (copy hosted at cmu.edu). www.cs.cmu.edu/~dga/15-712/F07/papers/birrell842.pdf ↗
  17. RFC 1057: RPC: Remote Procedure Call Protocol Specification Version 2. Sun Microsystems / RFC Editor. www.rfc-editor.org/rfc/rfc1057.txt ↗
  18. Post by @amasad (Replit CEO). Amjad Masad / Replit. x.com/amasad/status/1946986468586721478 ↗
  19. Replit's New Release Addressed Most of The Challenges We Hit Vibe Coding. But Is 'Prosumer' Vibe Coding Really Ready for Commercial Apps Yet?. SaaStr (Jason Lemkin, first-hand). www.saastr.com/replits-new-release-address-most-of-the-challenges-we-hit-vibe-coding-but-is-prosumer-vibe-coding-really-ready-for-commercial-apps-yet ↗
  20. Configure permissions (Claude Code). Anthropic. code.claude.com/docs/en/permissions ↗
  21. Claude Code hooks reference. Anthropic. code.claude.com/docs/en/hooks ↗
  22. Programmatic Tool Calling. OpenAI. developers.openai.com/api/docs/guides/tools-programmatic-tool-calling ↗
  23. Tool use with Claude - Claude Platform Docs. Anthropic. platform.claude.com/docs/en/agents-and-tools/tool-use/overview ↗
  24. Function calling with the Gemini API - Interactions API | Google AI for Developers. Google. ai.google.dev/gemini-api/docs/function-calling ↗
  25. Define tools. Anthropic. platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use ↗
  26. The lethal trifecta for AI agents: private data, untrusted content, and external communication. Simon Willison. simonwillison.net/2025/Jun/16/the-lethal-trifecta ↗
  27. GitHub MCP Exploited: Accessing private repositories via MCP. Invariant Labs. invariantlabs.ai/blog/mcp-github-vulnerability ↗
  28. Function calling and other API updates. OpenAI. openai.com/index/function-calling-and-other-api-updates ↗
  29. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. Greshake et al. (2023). arxiv.org/abs/2302.12173 ↗
  30. MCP Security Notification: Tool Poisoning Attacks. Invariant Labs. invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks ↗
  31. Defeating Prompt Injections by Design (CaMeL). arXiv (Debenedetti, Shumailov, Fan, Hayes, Carlini, Fabian, Kern, Shi, Terzis, Tramer; Google/DeepMind/ETH). arxiv.org/abs/2503.18813 ↗
  32. Permission policies (Claude Managed Agents). Anthropic (Claude Platform Docs). platform.claude.com/docs/en/managed-agents/permission-policies ↗
  33. Tool Use for Language Model Agents (Lecture 2 slides). CMU LTI / Graham Neubig. www.cmu-agents.com/slides/lecture-02-tool-use.pdf ↗
  34. When does MCP make sense vs CLI?. Hacker News. news.ycombinator.com/item?id=47208398 ↗
  35. FastMCP OpenAPI Integration. gofastmcp.com/integrations/openapi ↗
  36. MCP specification 2026-07-28: Key Changes. Model Context Protocol. modelcontextprotocol.io/specification/2026-07-28/changelog ↗
  37. MCP 2026-07-28 Specification Release. MCP Blog (D. Soria Parra, D. Delimarsky, Lead Maintainers). blog.modelcontextprotocol.io/posts/2026-07-28 ↗
  38. The MCP Registry - Model Context Protocol. Model Context Protocol. modelcontextprotocol.io/registry/about ↗
  39. Securing the AI Revolution: Introducing Cloudflare MCP Server Portals. Cloudflare. blog.cloudflare.com/zero-trust-mcp-server-portals ↗
  40. CMU 11-768 Lecture 5: Planning and Task Decomposition. 11-768 staff. www.cmu-agents.com/slides/lecture-05-planning.pdf ↗
  41. Memory and Skills (Lecture 4 slides). CMU / Daniel Fried. www.cmu-agents.com/slides/lecture-04-memory-and-skills.pdf ↗