By NHI Mgmt Group Editorial TeamBased on terra: “MCP Security Testing: Validating AI's Newest Attack Surface” (August 24, 2026)

TL;DR: MCP is becoming the default connective layer between AI agents and enterprise systems, but terra argues that the protocol also expands the attack surface through tool poisoning, secret exposure, scope creep, and weak auditability. The governance problem is no longer just model risk; it is whether organisations can continuously validate the tools, permissions, and trust boundaries their agents invoke in production.


At a glance

What this is: This is an analysis of why MCP security testing is emerging as the control point for AI agent production use, because the protocol expands trust boundaries, permissions, and audit requirements at the same time.

Why it matters: It matters because IAM, PAM, and NHI teams now have to govern agent access at the protocol layer, not just the model layer, or they will miss the real production exposure.


Context

Model Context Protocol creates a standard way for AI agents to connect to tools, files, and APIs, but that convenience also turns each connection into a new governance boundary. The security problem is not the protocol itself, but the assumption that an agent can safely discover and invoke production tools without testing the trust relationship first.

For IAM and NHI programmes, the issue is that MCP shifts control from static integration review to continuous validation. Once agents can choose tools at runtime, security teams need assurance over authentication, tool scope, and logging at the server layer, not just over the model or application using it.

This post is about MCP security testing as a control point for AI agents, which is already typical of early-stage agentic adoption. The pattern is common, not exceptional: integration speed is outrunning security review in many environments.


Key questions

Q: What breaks when organizations do not inventory AI agents and MCP connections?

A: Security teams lose the ability to answer what exists, what it can reach, and who owns it. Without that baseline, policy, monitoring, and incident response all become incomplete. The result is blind spots where agents can act, connect, and expand their effective scope without clear governance.

Q: Why do AI agents and MCP integrations increase IAM risk?

A: AI agents and MCP integrations increase IAM risk because they multiply the number of tool connections, service accounts, and tokens that can carry execution authority. If those credentials are embedded in configs or copied across workflows, the trust boundary moves into places that are hard to review. That makes least privilege and short-lived access much more important.

Q: How do you know if MCP security controls are actually working?

A: You know MCP controls are working when untrusted endpoints are blocked, privileged tool calls are minimal, and audit logs show only approved commands and data flows. If teams cannot reconstruct which server asked for what, or if secrets appear in configuration files, the control set is not operating as intended.

Q: What is the difference between testing the model and testing the MCP server layer?

A: Model testing focuses on prompts, output safety, and reasoning behaviour. MCP server testing focuses on the trust boundary where the agent reaches tools, data, and actions in production. Both matter, but only server-layer testing tells you whether the agent can actually do something unsafe with valid access.


Technical breakdown

Why MCP changes the trust boundary for AI agents

MCP standardizes how an AI client connects to external servers that expose tools and actions, which makes the protocol highly reusable but also highly trust-sensitive. Unlike a conventional API integration, the model can select a tool at runtime based on context, which means the organisation is no longer testing a fixed call path. The real security question becomes whether the server enforces authentication, parameter limits, and scoped access independently of the agent’s reasoning. When those controls are absent, the protocol layer becomes a hidden privilege gateway rather than a neutral connector.

Practical implication: treat each MCP server as a separately governed trust boundary, not as a routine integration.

How tool poisoning and secret exposure happen in MCP

Tool poisoning occurs when a malicious or compromised tool description, output, or connector content introduces instructions the agent treats as trustworthy. Secret exposure follows the same pattern when long-lived credentials, debug traces, or shared context make tokens available to model memory or logs. Because MCP deployments often pass through multiple layers of orchestration, a weakness in one server can influence the agent’s behaviour toward another connected system. That creates a governance problem around content integrity as much as access control, especially where tool definitions change often and are not re-validated.

Practical implication: validate tool metadata, secret handling, and context scope together instead of reviewing them as separate issues.

Why continuous validation matters more than point-in-time review

MCP environments change faster than scheduled assessments can track. A server that was safe last month may have new tools, new credentials, or new dependencies today, which means the relevant security state is not stable enough for annual or quarterly assurance alone. The architecture also supports hidden risk categories such as shadow servers, weak telemetry, and privilege creep, all of which accumulate silently if the organisation only tests at deployment time. In practice, the test model has to match the rate of change in the protocol estate, not the cadence of the audit calendar.

Practical implication: move MCP review toward change-triggered and continuous testing so drift does not outrun governance.


Threat narrative

Attacker objective: The objective is to turn the agent’s legitimate MCP connections into an unreviewed path to production systems, data, or actions.

  1. Entry occurs when an AI agent is connected to an MCP server that exposes tools, files, or APIs with insufficient authentication or overly broad trust assumptions.
  2. Credential exposure or privilege abuse follows when the server relies on long-lived tokens, shared context, or loosely scoped permissions that the agent can reuse across tasks.
  3. Escalation happens when tool descriptions, cross-server interactions, or weak audit trails let a malicious instruction or hidden dependency influence subsequent actions.
  4. Impact is the agent invoking production actions, data access, or downstream API calls that the organisation did not validate well enough to control.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

MCP security testing is now a governance requirement, not a niche red-team exercise. Once MCP becomes the default connective layer for agents, the question is no longer whether the protocol is useful. The question is whether each server, tool definition, and credential path has been validated as part of the identity boundary. That changes MCP from an integration detail into a control point for AI agent governance, and practitioners should treat it that way.

Tool trust is the new privilege decision. Traditional access governance assumes a relatively stable target and a request that can be approved, logged, and reviewed. MCP breaks that assumption because the model selects tools at runtime and may chain them in ways the original approver never saw. The result is a control model that has to govern invocation context, not just account entitlement, and that is a material shift for IAM and NHI teams.

Ephemeral tool use creates ephemeral accountability gaps. The architecture can expose actions, data sources, and credentials inside a single task window, which means point-in-time reviews often arrive after the relevant privilege has already disappeared. That is why auditability, context isolation, and server-side enforcement matter more than a model-facing policy statement. Practitioners should read this as a lifecycle problem, not just a security testing problem.

Shadow MCP servers are the unmanaged NHI problem reappearing at the protocol layer. When teams can stand up connectors quickly, discovery and inventory become the first failure point, not the last. A programme that cannot enumerate MCP servers cannot credibly claim it understands its AI agent trust boundary. The practical conclusion is straightforward: inventory has to extend to the protocol estate or governance remains incomplete.

Continuous validation is becoming the only defensible assurance model for fast-changing agentic systems. The article’s deeper signal is that static review cadences are too slow for a server layer that can change tool scope, dependencies, and permissions between audits. That does not replace policy, but it does mean the policy has to be enforced by recurring validation if the organisation wants confidence in production operations.

From our research library:

What this signals

Protocol-layer governance is becoming the real dividing line for agentic AI programmes. Security teams that only assess model behaviour will miss the place where runtime authority is actually granted: the MCP server, not the chat window. The practical shift is toward validating tools, permissions, and context boundaries as part of the identity control plane.

Agentic identity programmes need a protocol inventory, not just an application inventory. Once MCP connectors can be added quickly, the estate can become opaque unless discovery extends to every server an agent can reach. The relevant control is visibility into the full tool surface, because undiscovered connectors behave like unmanaged identities.

Least privilege is harder to sustain when AI systems are granted more access than their human equivalents. 70% of organisations grant AI systems more access than they would give a human employee performing the exact same job, according to the 2026 Infrastructure Identity Survey. That gap matters most when the agent can invoke production tools directly through MCP.


For practitioners

  • Inventory every MCP server and connector Build a complete catalogue of MCP servers reachable by production agents, including shadow deployments, ownership, and business criticality.
  • Validate tool scope before production use Test whether each server enforces least-privilege permissions, parameter constraints, and session binding before an agent can invoke tools.
  • Scan for secret exposure paths Check tool descriptions, logs, debug output, and shared context windows for credentials that could be reused beyond the intended session.
  • Require change-triggered retesting Re-test servers whenever tool definitions, dependencies, or authentication settings change rather than waiting for a scheduled review cycle.
  • Separate agent reasoning from server trust Keep the model’s tool selection logic from becoming the security decision by enforcing server-side authentication and authorization controls.

Key takeaways

  • MCP turns the agent integration layer into a live governance boundary, which means tool scope, authentication, and auditability now matter as much as model behaviour.
  • Static review cycles are poorly matched to connector estates that change quickly, so discovery and retesting need to move closer to the change event.
  • The practical failure mode is not just unsafe output. It is ungoverned runtime access to tools, data, and actions that the organisation never fully validated.

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 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and CSA Cloud Controls Matrix set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article highlights tokens, logs, and context windows as MCP exposure paths.
NHI-05 — Overprivileged NHIThe core risk is agents gaining broader access than needed through MCP connectors.
NHI-07 — Long-Lived SecretsStatic credentials are called out as unsafe in MCP testing and validation.
Recommendation — Scan MCP servers for exposed secrets and eliminate long-lived credentials from tool paths. Scope MCP server permissions to the minimum access each agent task requires. Replace static MCP credentials with short-lived, narrowly scoped authentication.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article centers on validating who and what can invoke tools through MCP.
Recommendation — Review MCP entitlements regularly and confirm every tool call is authorized at the server layer.
MITRE ATT&CKTA0006;TA0008 — Credential Access; Lateral MovementSecret exposure and chained server interactions map to credential theft and movement paths.
Recommendation — Map MCP exposure findings to credential access and lateral movement techniques in threat hunting.
CSA Cloud Controls MatrixIAM — Identity and Access ManagementMCP security testing is fundamentally about governed access to connected systems.
Recommendation — Apply IAM controls to inventory, authorize, and review every MCP-connected identity and tool path.

Key terms

  • Model Context Protocol: Model Context Protocol is an open protocol that lets AI agents connect to tools and data sources. It expands what an agent can reach, so governance has to cover not only the model and its prompts, but also every system that can receive or return agent-driven data.
  • Tool Poisoning: Tool poisoning is an attack in which malicious instructions are hidden inside tool descriptions, examples, or schemas that an AI agent reads when deciding what to do. The danger is not only in the tool's code, but in the metadata that shapes the agent's behaviour and trust decisions.
  • Shadow MCP Server: An MCP server that exists in an environment without being fully visible, approved, or governed by the teams responsible for identity and access. In practice, it becomes a hidden trust path for tools, data, and credentials, especially when developers install it directly into agent workflows.
  • Agent Runtime: The agent runtime is the execution environment where an AI agent reads data, calls tools, and carries out actions. It matters because the runtime is where identity, policy, and filesystem boundaries either hold or fail. If those boundaries are weak, the agent becomes a high-privilege path into the environment.

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 building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 25, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org