Lecture 5 · COMS W4995 Agentic Engineering

Agent tools in pictures

Chapter seven

Tools in an organization

When a whole company connects agents to its systems, someone has to decide who may use which tool, as whom, and through which door; by the end you can say where that control lives and what it does not cover.

After this chapter you can

  1. Explain what a company gateway centralizes (identity, permissions, an audit log) and what it costs.
  2. Decide whether a given agent job should run as the user or as a service account with a narrow, declared scope.
  3. Read an admin control panel along its three axes (who, what, when it asks) and explain why approvals at different layers are separate checks.
  4. Explain why a listing in a registry is not a safety review, and say who in a company does the reviewing.

12 minutes to read5 sections6 quiz questions

Start reading →

Cloudflare describes a language model as “the most brilliant and enthusiastic junior hire you’ve ever had”, one that lacks “the years of judgment to know what they shouldn’t do”2. Its post then says that the current, decentralized approach to MCP “is like giving that junior hire a master key to every office and server room on their first day”2. If you are a single developer with one agent, you can manage this because you know which keys you have distributed. However, a company with hundreds of people, each connecting their own agents to Slack, GitHub, and the customer database, cannot. This chapter takes up the fourth question from the opening: who controls tools across a company, and through what single point?

Section 7.1

One gateway

Before and after a gateway. Left: four agents each connect directly to each of four services, sixteen separate connections, each with its own login and its own log. Right: the same four agents connect to one gateway, which holds identity, permissions and the audit log, and the gateway connects to the four services. Before: every agent to every service After: one gateway Agent Agent Agent Agent Slack GitHub CRM Data 16 connections, 16 logins, 16 logs (if any) Agent Agent Agent Agent Gateway identity permissions audit log Slack GitHub CRM Data one door, one place to decide, one log
Left, every agent connects to every service on its own, with its own login and its own log. Right, every call passes one gateway, which holds identity, permissions and the audit log in one place.

Look at the picture on the left. Four agents connect directly to four services. That means sixteen connections. Each connection has its own login, its own rules for what is allowed, and its own log, if it keeps one. If an auditor asks which customer records agents read last Tuesday, you would check each of those sixteen connections.

The picture on the right shows a gateway. This is a single entry point that all agents use to reach company tools. It does three jobs in one place: it identifies the caller, decides what the caller can access, and records what happened.

Sierra built one. By its own account, in July 2026, 89% of its employees actively used its internal gateway to connect agents to 45 services1. Its first rule is about what goes in, before any check runs: “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. We therefore spent a lot of time on tool design in the gateway, deciding what is safe to expose and when.”1 A gateway is where a company decides what its agents can see at all.

The gateway also monitors what comes back. Sierra keeps “a full audit log of data that was accessed about our customers” and blocks attempts to access sensitive data about more than one customer in the same session1. Determining which customer a piece of data belongs to is not a free operation. So, the check runs in three passes: a deterministic step lists potential customers, a fast model narrows them down, and a slower model makes the final decision on the customer and the data’s sensitivity1. The idea is to use the expensive model only when the cheaper steps cannot resolve the issue. Sometimes, looking across multiple customers is legitimate. Sierra allows this through a separate path, outside the agent’s session: “it happens out-of-band, requires explicit approval, and also gets added to the audit log”1.

Cloudflare offers a similar product. Its post says that a user connecting to an MCP Server Portal first signs in through the company’s identity provider (the single sign-on service that already knows every employee), and then “Cloudflare enforces which MCP Servers the user has access to, regardless of the underlying server’s authorization policies”2. Administrators “review and approve MCP servers” before users see them, and each user is shown only “the curated list of servers and tools they are authorized to use”2. Its post adds that request data “was scattered across every individual server” and that “Server Portals aggregate all MCP request logs into a single place”2. This is the vendor’s description of its own product, not an independent evaluation.

What does a gateway cost? Neither source provides a number, so we will reason about it. Someone must build and maintain it, and every connection now relies on it. Each additional check, like Sierra’s model passes, adds processing to calls involving sensitive data. And it only protects traffic that actually passes through it. Cloudflare’s launch post said so about its own portal, as a gap it planned to close: “Unless an MCP Server author enforces Authorization controls, users can still technically access MCPs outside of a Portal”2.

Check yourselfAn auditor asks which customers’ records your company’s agents read last week. Where would you look without a gateway, and where with one?

Without one, in every service’s own logs, if each service kept one. With one, in a single log. Sierra’s gateway keeps “a full audit log of data that was accessed about our customers”1.

Section 7.2

Two identities

Two identities side by side. Left, interactive work: a person asks in chat, the agent runs as that user and can reach only what that user can, and the person is present. Right, scheduled or shared work: a nightly or shared job, the agent runs as a service account with only the permissions that job needs, jobs that touch customer data declare their customers and tools before they run, and nobody is present. Interactive work Scheduled or shared work A person asks in chat "Open a pull request on my branch" A job runs on a schedule every night at 2 a.m., or shared by a team Runs as the user Runs as a service account Can reach what this person can, no more Approvals and audit trail are the person's A person is present Only the permissions this job needs Customer-data jobs: scope declared first Nobody is present The identity belongs to whoever is accountable for the work: the person, or the job.
Interactive work borrows the person’s identity and permissions. Scheduled or shared work runs under its own service account, limited to what that one job needs; jobs that touch customer data also declare their scope before they run.

Consider two jobs. First, an engineer asks an agent in chat to open a pull request. Second, a job runs every night at 2 a.m. and posts a summary of support tickets to a team channel. No one is at the keyboard for the second job. What identity should each job use?

Sierra’s answer is short: “Interactive work runs as the user. Scheduled or shared workflows run as service accounts with only the permissions they need.”1 A service account is an identity that belongs to a job, not a person. The reasoning follows from who is present. In chat, a person asked for the work and is watching it, so the agent can do exactly what that person could do, and no more. At 2 a.m. no person is there. If the job borrowed the account of whoever built it, it would carry that person’s full access, including everything the job never needed, and would keep it after that person changes teams. A service account fixes both: it has only the permissions the job needs, and it belongs to the job.

Sierra adds one more safeguard for automations that handle customer data: “pre-authorized workflows that explicitly declare which customers and tools they’re allowed to access before they ever run”1. The scope is written down before the job starts. A person can read it, rather than the agent deciding it while the job runs.

Identities also have to be removed. MCP has an extension for this, enterprise-managed authorization. It names the problem: when each employee authorizes each server on their own, “Offboarding requires revoking access across every service individually.”3 Under the extension, “the organization’s IT or security team manages access policies in one place”3. The client gets a special token from the company’s identity provider and exchanges it for an access token from the MCP server’s own authorization server3. Employees without permission get an error, and “the MCP client never receives a token for unauthorized servers”3. Revoking access at the identity provider takes effect “immediately across all MCP clients”3. That is what the specification describes. It says nothing about how many companies use it. Chapter 4’s section on MCP authorization covers how a single server checks a token; chapter 6’s section on whose keys follows the same question down to a single call.

Check yourselfYour team wants an agent to read every customer’s open tickets each Monday and post a summary to one channel. Should it run as the person who set it up, or as a service account? What should its scope be?

It should use a service account. No one is present when it runs, and it should not carry one person’s broader access. Give it read access to tickets and post access to that one channel. Declare this scope before it runs, as Sierra does for automations that handle customer data1.

Section 7.3

Admin controls and connectors

Three settings in ChatGPT's workspace controls, drawn as three gates in a row. Role access decides who can use an app. Actions decides what the app can do, including a policy for new actions added later: enable all, only new reads, or disable new. Permissions decides when ChatGPT asks before acting. Role access and the action setting decide whether an action can run; the permission setting decides whether ChatGPT asks first. Provider approval and OAuth scopes are further, separate checks. Role access Who which people can use the app Actions What which actions are on new actions later: all · only reads · none Permissions When it asks before acting, or not Who and What decide if it can run; Permissions decides if ChatGPT asks first. Provider approval, OAuth scopes and these settings are separate checks; one does not open another.
Three separate settings in ChatGPT’s workspace controls. Role access and the action setting decide whether an action can run at all; the permission setting decides whether ChatGPT asks first.

A gateway is one place for control. The other is the admin console of the agent host your company already uses, such as ChatGPT or Claude. OpenAI’s workspace controls for ChatGPT offer a clear example. They separate the question into three parts: “Role access controls who can use an app. Actions controls what the app can do. Permissions controls when ChatGPT asks before using an app.”4 Who can use it, what it can do, and when it asks. These three axes are set independently.

The second axis, what the app can do, includes a setting for future actions. Apps gain new actions over time. An admin might have approved an app before those new actions existed. Under “New actions”, the choices are “Enable all new actions, Only enable new read actions, Disable new actions”4. We recommend the middle option for most companies: new read actions arrive switched on, and new write actions stay off until an admin turns them on. “Disable new actions” applies only to actions added later; “it does not disable actions that were already enabled”4. The third axis, when ChatGPT asks, also has a limit. “Allow all actions” lets ChatGPT act without further prompts, but only for an individual app that supports it: the option “carries elevated risk and is not offered in the standard workspace-wide selector”4.

The most useful sentence on that page is this one: “Provider approval, OAuth scopes, and ChatGPT action settings are separate checks. Approving a provider scope does not automatically enable a new action, and changing a future-action policy does not remove existing provider consent.”4 This means there are several locks in a row. Opening one does not open the next, and closing one does not close the ones behind it. A common mistake is to think you have turned something off when you only changed one of these settings.

Anthropic’s connectors for Claude add the question of whose permissions a connector uses. “Claude inherits each person’s permissions from the connected service”5. If a user cannot open a file in the source system, the connector cannot access it either5. The exception is a shared credential: “Custom connectors that use a shared credential reach whatever that credential can access.”5 On Team and Enterprise plans, “everyone who uses the connector reaches the service with that same credential, so use one limited to what members should access”6. Custom connectors also access “arbitrary services that have not been verified by Anthropic”6. Per-user sign-in respects each person’s limits; a shared key gives everyone the key’s limits.

Hosts can also allowlist servers. In Windsurf’s legacy Cascade agent, users can add their own MCP servers by default, but “once you allowlist even a single MCP server, all non-allowlisted servers will be blocked” for the team7. Patterns are anchored to the whole string “to prevent partial matches”7. One entry changes the team from open to closed. This is a decision you should make intentionally.

Check yourselfAn admin approves a calendar provider’s OAuth scope for creating events. Will ChatGPT now create events in that workspace without asking?

Not necessarily. OpenAI’s page says provider approval, OAuth scopes and ChatGPT’s action settings “are separate checks”, and approving a provider scope “does not automatically enable a new action”4. The action setting and the permission setting still decide.

Section 7.4

Registries list; they do not vet

A server's path to your users, in four steps. A publisher submits metadata. The public MCP Registry runs format checks and can take servers down after the fact, but does not review behavior. Your company reviews what the server does, the one step marked. Only then does the server go on the allowlist or into the portal that users see. 1 · Publisher submits name, where it runs 2 · Registry format checks takedown later no behavior review 3 · Your company reviews what the server does 4 · Users allowlist or portal Listed means published and well-formed. Reviewed means someone looked at what it does. Skip step 3 and nobody reviewed it.
A server’s path to your users. The public registry checks format and removes spam after the fact. Reviewing what a server actually does happens later, inside your company, or not at all.

How many servers are available? In November 2025, in a post marking MCP’s first year, its maintainers wrote that over that year the number of active servers went “from just a few experimental ones to thousands”9. “Thousands” is their word, not a count you can check. No one reviews thousands of servers by hand within a company.

Chapter 4’s section on annotations and the registry explained what the official MCP Registry stores: metadata pointing to packages, with format checks and manual takedowns8. For a company, two more sentences on that page are important. First: “The metadata hosted by the MCP Registry is deliberately unopinionated. Downstream aggregators can provide curation or additional metadata such as community ratings.”8 The registry does not make judgments. Second: “The MCP Registry does not support private servers.”8 Your company’s internal servers will not be listed there at all.

So a company needs its own list. Microsoft announced in May 2025 the design of “an MCP server registry service, which allows anyone to implement public or private, up-to-date, centralized repositories for MCP server entries”10. That was an announced design. Windsurf’s documentation covers two agents: Devin Local, the default for new tabs, and the legacy Cascade agent7. For Devin Local, enterprise teams can replace the default Devin Desktop MCP marketplace with their own registry URLs, to control which servers their users see there7. Read the fine print: with several registries configured, users see “the union of all registries”7, so each added registry widens the list instead of narrowing it. And for the legacy Cascade agent, which has no marketplace, registries change nothing; the allowlist is the control7. Narrowing is the job of a list your company curates, an allowlist, or a portal like Cloudflare’s, where administrators approve servers before users see them2.

Check yourselfA teammate wants to add a server to your allowlist because it is in the official MCP Registry. What does that listing tell you, and what does it not tell you?

It tells you someone published metadata that passed format checks, and that maintainers can take a server down later8. It does not tell you anyone reviewed what the server does. The registry calls its metadata “deliberately unopinionated” and leaves curation to others8. That review is your company’s responsibility.

Before you go on

Close the book

  1. From memory, draw the ‘before’ and ‘after’ states of a gateway. Name the three jobs it gathers in one place and two of its costs.
  2. Imagine a company deploys your Studio tool server. What identity should an engineer’s chat session use when calling the server? What identity should a nightly job use? Write the nightly job’s declared scope in a single line.
  3. Explain to a teammate, in three sentences, why an approved OAuth scope, a listing in a registry, and an entry on an allowlist are three different checks.

Chapter seven · 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 1Your company puts one gateway in front of every tool its agents use. Which of these does the gateway let you do in one place?Select all that apply.
Answer and why
  • RightKnow who is calling each tool. Identity is one of the three jobs; Cloudflare’s portal signs users in with the company’s identity provider first2.
  • RightDecide which tools and data each caller may reach. Sierra decides in the gateway what is safe to expose1, and Cloudflare enforces which servers each user can reach2.
  • RightKeep one audit log of what agents accessed. Sierra keeps a full audit log of customer data that agents accessed1.
  • WrongGuarantee that a tool call ran exactly once. A gateway decides and records; it cannot tell you whether a timed-out call ran. That problem belongs to chapter 6.
  • WrongProtect connections that bypass the gateway. A gateway only sees the traffic that goes through it.
Question 2Sierra’s guard against looking at several customers’ sensitive data in one session runs in three passes. Which statements about that design are correct?Select all that apply.
Answer and why
  • RightA deterministic step lists candidate customers before any model runs. The first pass is deterministic and builds the candidate list1.
  • WrongA fast model makes the final decision on customer and sensitivity. The fast model only narrows the candidates; a slower model makes the final call1.
  • WrongCross-customer access is always blocked, with no exceptions. Sierra allows it out-of-band, with explicit approval, and logs it1.
  • WrongThe design guarantees that the guard never misses a case. Nothing in the design guarantees that: two of the three passes are models, and models can be wrong. The post is Sierra’s own account, not an audit.
  • WrongThe most capable model runs first, so that nothing slips past the cheaper steps. The order is the reverse: a deterministic step, then a fast model, then a slower model1.
Question 3For which of these jobs should the agent run as a service account rather than as the user?Select all that apply.
Answer and why
  • RightA nightly job that posts a summary of open incidents to a team channel. Scheduled work runs as a service account with only the permissions it needs1.
  • WrongAn engineer asking an agent in chat to open a pull request on their branch. Interactive work runs as the user, so the agent can do what that person can and no more1.
  • RightA workflow shared by the whole support team that tags incoming tickets. Shared workflows run as service accounts too, not as whoever built them1.
  • WrongA manager asking an agent in chat to draft a reply in their own inbox. A person asked for it and is present; it is interactive work1.
Question 4A colleague built a weekly automation that reads every customer’s billing data. It runs with the colleague’s own account, which has admin rights. What is wrong with this, and what fixes it?Select all that apply.
Answer and why
  • RightThe job carries admin rights it never needs. A service account should have only the permissions the job needs1.
  • RightIf the colleague changes teams, the job still runs with their access. The job borrows a person’s identity instead of having its own; a service account belongs to the job.
  • RightDeclare before it runs which customers and tools it may touch. Sierra requires pre-authorized workflows that declare customers and tools before they run1.
  • WrongNothing is wrong, because the colleague is trusted. Trust in the person does not narrow the job’s access, and nobody is present while it runs.
  • WrongFix it by adding a confirmation dialog to each run. Nobody is at the keyboard at run time to confirm; the scope has to be set in advance.
Question 5In ChatGPT’s workspace controls, an admin sets New actions to “Only enable new read actions”. A connected app later adds a delete action and a new search action. What follows?Select all that apply.
Answer and why
  • RightThe new delete action is not enabled automatically. Only new read actions are enabled under that setting4.
  • RightActions that were already enabled stay enabled. The New actions setting governs only actions added later; even “Disable new actions” “does not disable actions that were already enabled”4.
  • WrongApproving the provider’s OAuth scope for deletion would enable the delete action. Provider approval and action settings are separate checks; a scope does not enable an action4.
  • RightRole access still decides who can use the app at all. Role access, actions and permissions are three separate axes4.
  • WrongThe admin can turn on “Allow all actions” for the whole workspace from the standard selector. That option is not offered in the standard workspace-wide selector4.
Question 6A server appears in the official MCP Registry. What can you conclude from that alone?Select all that apply.
Answer and why
  • RightSomeone published metadata about it that passed the registry’s format checks. The registry hosts self-published metadata with character limits and validation8.
  • WrongSomeone reviewed what the server’s tools actually do. The registry calls its metadata deliberately unopinionated and leaves curation to downstream aggregators8.
  • WrongIt is safe to add to your company’s allowlist. The review before an allowlist or portal entry is the company’s job, as with Cloudflare’s admin approval2.
  • WrongIt is one of your company’s private internal servers. The registry does not support private servers8.
  • RightMaintainers could remove it later if it turns out to be spam or malicious. Maintainers can manually take down spam or malicious servers8.

Sources

  1. Building Sierra's MCP Gateway: An engineering iceberg. Sierra (Mihai Parparita). sierra.ai/blog/building-sierras-mcp-gateway-an-engineering-iceberg ↗
  2. Securing the AI Revolution: Introducing Cloudflare MCP Server Portals. Cloudflare. blog.cloudflare.com/zero-trust-mcp-server-portals ↗
  3. Enterprise-Managed Authorization (MCP extensions). Model Context Protocol (LF Projects, LLC). modelcontextprotocol.io/extensions/auth/enterprise-managed-authorization ↗
  4. Admin controls, security, and compliance for plugins and apps. OpenAI Help Center. help.openai.com/en/articles/11509118-admin-controls-security-and-compliance-for-plugins-and-apps ↗
  5. Use connectors to extend Claude's capabilities. Anthropic (Claude Help Center). support.claude.com/en/articles/11176164-use-connectors-to-extend-claude-s-capabilities ↗
  6. Get started with custom connectors using remote MCP. Anthropic (Claude Help Center). support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp ↗
  7. Cascade MCP Integration (Cascade MCP Configuration). Cognition (Windsurf / Devin Desktop). docs.windsurf.com/windsurf/cascade/mcp ↗
  8. The MCP Registry - Model Context Protocol. Model Context Protocol. modelcontextprotocol.io/registry/about ↗
  9. One Year of MCP: November 2025 Spec Release. MCP Core Maintainers. blog.modelcontextprotocol.io/posts/2025-11-25-first-mcp-anniversary ↗
  10. Microsoft Build 2025: The age of AI agents and building the open agentic web. Microsoft (Official Microsoft Blog). blogs.microsoft.com/blog/2025/05/19/microsoft-build-2025-the-age-of-ai-agents-and-building-the-open-agentic-web ↗