By NHI Mgmt Group Editorial TeamBased on Stacklok: “MCP vs CLI Tools: Why Security Changes the Answer” (April 28, 2026)

TL;DR: CLI can be token-efficient for local, single-user agent workflows, but Stacklok argues that the real deciding factor is credential exposure and multi-user governance. In enterprise settings, MCP changes the security model by keeping downstream credentials server-side instead of placing them in the agent execution environment.


At a glance

What this is: This analysis compares MCP, CLI, and agent Skills for agent workflows and concludes that credential placement, not token cost, is the decisive security boundary.

Why it matters: IAM and NHI teams need to judge where secrets reside, how tool use is attributed, and whether an agent is operating under single-user or multi-user governance.

By the numbers:

  • CLI tools consume fewer tokens than unfiltered MCP server use, with benchmarks showing roughly $3.20 per 10,000 operations for GitHub tasks versus $55.20 for MCP.
  • Five MCP servers with 20 tools each injects approximately 80,000 tokens of schema before any task begins.
  • Stacklok’s MCP Optimizer reduces per-request token consumption by 60-85% compared to eager loading.
  • GitHub’s MCP server with 43 tools injects 17,600 tokens of schema before the agent begins.

Context

MCP versus CLI is not just a tooling preference. The security question is where downstream credentials reside, because that determines whether an agent operates inside the same trust boundary as the user or behind a server-side control plane.

In single-user workflows, CLI access can be acceptable because the agent inherits one person’s permissions and the blast radius is bounded. In multi-user enterprise settings, that assumption breaks, and the credential model becomes the primary governance issue rather than a secondary implementation detail.

Agent Skills sit on a different layer again: they describe procedure, not access. That distinction matters because teams often debate workflow knowledge and tool access as if they were the same design choice.


Key questions

Q: What breaks when an AI agent uses CLI tools in a multi-user enterprise workflow?

A: The credential model breaks first. A CLI-backed agent typically inherits the launching user’s session, which is workable for one developer but weak for shared or regulated environments. Once multiple people depend on the same workflow, attribution, revocation, and least privilege become hard to prove or enforce.

Q: Why do MCP architectures reduce credential exposure risk for agents?

A: MCP moves downstream authentication to the server side, so the agent calls a typed tool interface instead of holding the target system’s secret. That keeps credentials out of the agent execution environment and makes per-user authorisation and revocation more practical. The result is a cleaner governance boundary for shared or regulated workflows.

Q: How should organisations decide between CLI and MCP for agent automation?

A: Use CLI when the agent is acting as a single developer and the credentials are intentionally that person’s own. Use MCP when the workflow is shared, customer-facing, or production-bound, because the ability to scope, log, and revoke access becomes more important than raw token efficiency.

Q: What is the difference between agent skills and MCP?

A: Agent skills provide the procedure, meaning how an agent should do a task. MCP provides the connection to tools and data, meaning what the agent can reach. They work together, but they solve different problems. Skills govern behaviour, while MCP governs access to external capabilities and should be controlled separately.


Technical breakdown

Why CLI convenience changes the credential boundary

CLI-based agents execute with the invoking user’s session and inherit whatever that session can reach, including cloud keys, database passwords, API tokens, and local config files. The agent may not transmit those secrets directly to the model, but it does operate in an environment where they are present and usable by any code with the same runtime access. That makes the execution host part of the trust boundary. In a solo workflow, this can be workable because the agent is effectively acting as the user. In enterprise deployments, the same pattern expands the credential surface across users, systems, and logs in ways that are difficult to govern cleanly.

Practical implication: Treat CLI as a credential-sharing model, not just a command interface, whenever an agent acts beyond a single developer's own access.

How MCP changes tool authentication and auditability

MCP moves downstream authentication to the server side. The agent sends a typed tool call, the MCP server authenticates to the target system with stored credentials, and the result comes back without exposing the downstream secret to the agent context or inference endpoint. That changes the control model from credential inheritance to credential abstraction. The important governance effect is per-user attribution: in a properly designed remote MCP flow, each user authorises access independently and each tool invocation can be traced to that identity. That is a materially different audit and revocation model than shared CLI access or ad hoc proxying.

Practical implication: Prefer MCP when tool access must be individually attributable, revocable, and separated from the agent runtime.

Why token efficiency is a secondary control variable

The article frames a real trade-off: CLI can be cheaper and easier to debug, while naive MCP can incur schema bloat through eager tool loading. But token cost is not the deciding security variable. Progressive disclosure, on-demand tool discovery, and optimiser layers reduce MCP overhead without changing the underlying property that matters most, which is where credentials are held. That means the architecture question should start with governance and only then examine cost. If a workflow becomes unsafe because credentials move into the agent execution environment, a lower token count does not make it safer.

Practical implication: Use token efficiency as a tuning factor after you have decided whether the access model is safe for the deployment context.


NHI Mgmt Group analysis

Credential placement, not tool syntax, is the real security control in agent workflows. The article shows that the same agent can be acceptable or unacceptable depending on whether downstream credentials sit in the host environment or on the MCP server. That means the control boundary is architectural, not cosmetic. For identity teams, the decisive question is whether tool access is inheriting a human session or being governed as a separate service boundary.

Multi-user agent governance collapses when CLI access is stretched beyond one identity. A single developer using their own shell can tolerate inherited permissions because accountability is direct. Once the same pattern serves multiple people or customers, the model breaks into shared credentials, bespoke credential injection, or weak attribution. That is a classic governance failure: the access path outgrows the identity model that justified it.

Agent Skills sharpen the distinction between procedure and authorisation. Skills can tell an agent what to do, but they do not solve who may do it or where the credentials live. This separation matters because organisations often overestimate what workflow knowledge can control. The practitioner conclusion is simple: procedural guidance cannot compensate for a misplaced access boundary.

Multi-user governance demands per-user attribution at the tool layer, not after the fact. The article’s strongest enterprise argument is that remote tool use needs independent authorisation and revocation per user, especially where audit and compliance matter. That is why delegated access, not shared runtime identity, is the governance primitive. Teams should evaluate agent architectures on whether the identity trail survives the handoff from human intent to tool execution.

Schema cost is a usability constraint, but credential exposure is the programme-defining risk. Token inflation can make MCP feel heavier than CLI, yet the article makes clear that optimisers and progressive disclosure can reduce that overhead. What cannot be optimised away is the difference between secrets in an agent runtime and secrets held behind a server-side control plane. The implication for the field is that cost arguments cannot be allowed to override identity governance.

From our research library:

  • 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.
  • AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers, according to the State of Secrets Sprawl 2026.
  • Read next: MCP Security Guide

What this signals

Credential surface is the deciding variable: once an agent serves more than one person, the question is no longer whether CLI is efficient but whether the access path can be isolated, attributed, and revoked per user. That is why server-side credential handling is the more durable governance pattern for enterprise agents.

Token savings are only meaningful after boundary design is correct: schema bloat, eager loading, and tool discovery can be tuned, but they do not change the fact that credentials in the agent runtime expand the attack and audit surface. Teams should optimise cost only after they have fixed the identity model.

The practical takeaway for programmes that span human IAM and NHI governance is to separate workflow knowledge from authorisation. Skills can encode procedure, but the access layer still has to decide who or what may act, under which identity, and with what revocation path.


For practitioners

  • Define the agent's identity boundary Document whether the agent acts as one user, one team, or many users, and map that answer to the credential model before choosing CLI or MCP.
  • Keep downstream credentials server-side Route access to remote systems through MCP-style server-side credentials when the agent must touch shared services, regulated data, or customer-owned environments.
  • Separate procedure from access Use Skills for workflow guidance, but do not treat them as an access control layer or a substitute for tool authorisation.
  • Require per-user auditability Reject multi-user agent deployments that cannot produce individual attribution for each tool invocation and revocation for each user.
  • Measure token cost after governance fit Compare schema overhead, on-demand discovery, and debugging transparency only after the access model is proven safe for the deployment context.

Key takeaways

  • CLI can be acceptable for a single developer’s own workflow, but it becomes a governance problem once the same agent serves multiple identities.
  • MCP shifts downstream authentication behind a server-side boundary, which materially reduces credential exposure in shared or regulated deployments.
  • Workflow guidance and access control are different layers, so Skills can improve execution without solving authorisation or auditability.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10, MITRE ATT&CK and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04 — Insecure AuthenticationThe article centers on where agent credentials live and how they are authenticated.
NHI-05 — Overprivileged NHICLI inheritance can expand agent permissions beyond the minimum required for shared workflows.
NHI-07 — Long-Lived SecretsCLI workflows often expose persistent keys and passwords in shells, files, and environments.
Recommendation — Move agent access to server-side authentication so downstream credentials never sit in the runtime. Limit agent permissions to the smallest server-side scope needed for each tool invocation. Replace long-lived secrets in agent runtimes with short-lived, server-held credentials.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is fundamentally about how agent access is granted, scoped, and attributed.
Recommendation — Align agent tool access with explicit entitlements and per-user authorisation controls.
MITRE ATT&CKTA0006 — Credential AccessThe main security concern is exposure of downstream credentials in the execution environment.
Recommendation — Hunt for credential exposure paths in agent runtimes and reduce opportunities for credential access.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseAgent workflows can misuse inherited identity and over-broad privilege across tools.
Recommendation — Constrain agent privilege inheritance so tool use cannot outgrow the authorisation boundary.

Key terms

  • Credential Surface: The credential surface is the set of places where secrets, tokens, keys, or session material can be exposed, copied, or reused during execution. For agents, that includes environment variables, local files, logs, memory, and any service that proxies access on the agent's behalf.
  • Server-side Credential Abstraction: Server-side credential abstraction means the agent can request a tool action without ever holding the downstream system’s secret. The server authenticates on the agent’s behalf, which reduces exposure in the execution environment and creates a clearer audit and revocation boundary.
  • Per-user attribution: The ability to trace an action back to the specific identity that initiated it, even when a proxy or server executes the request. This is essential in shared tool environments because it preserves accountability, supports investigation, and prevents shared credentials from hiding the true actor.
  • Progressive Disclosure Pipeline: A review design that reveals information in stages instead of giving one system full context at once. In security operations, it reduces overreach and makes each decision step easier to audit. For AI review, it also limits prompt injection because later stages see only the evidence they need.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org