By NHI Mgmt Group Editorial TeamDomain: Agentic AI & NHIsSource: ObotPublished February 5, 2026

TL;DR: Securing an MCP gateway centers on centralized authentication, role-based access control, proxy enforcement, encrypted credential handling, and full audit logging, according to Obot. The deeper lesson is that MCP governance fails when access, secrets, and telemetry are treated as separate problems instead of one identity control plane.


At a glance

What this is: This is a security tutorial for deploying an MCP gateway, and its key finding is that scalable MCP use depends on centralised access control, credential management, and audit logging.

Why it matters: It matters because MCP expands AI agent and user access to enterprise systems, so IAM, PAM, and NHI teams need one control model for authentication, authorisation, secrets, and evidence.

👉 Read Obot's security guide for MCP gateway access control and audit logging


Context

MCP gateways turn AI tool access into an identity problem as much as a transport problem. When users, agents, and services can reach databases, CRMs, and cloud systems through the same protocol, the security model has to decide who may connect, what they may invoke, and how the activity is recorded.

For NHI and IAM teams, the weak point is usually not the protocol itself but the control plane around it. Secret sprawl, weak authorisation boundaries, and incomplete audit trails all become harder to manage once MCP sits between agents and production systems.

Obot’s tutorial is focused on that governance layer: authentication, role assignment, registry scoping, proxy enforcement, encrypted storage, and audit logging. The starting position is typical for teams trying to operationalise MCP safely, because the same failures show up wherever identity and access are decentralised.


Key questions

Q: How should teams govern private MCP servers without exposing them to the internet?

A: Use an outbound-only control path that lets the governance layer reach the server without opening inbound access. The key is to separate transport from authorization so tool calls are authenticated, policy-checked, and logged against the originating identity. If the server must be exposed to be governed, the security model has already failed.

Q: What breaks when MCP traffic bypasses a central proxy?

A: You lose policy enforcement, session isolation, and complete audit evidence in one move. Without a single proxy path, credentials can be reused across clients, requests may reach sensitive systems without validation, and investigators later lack the record needed to explain what happened. Central mediation is what turns MCP into a governable channel.

Q: How do security teams reduce credential sprawl in MCP deployments?

A: Keep secrets in encrypted storage, separate key management from the application database, and avoid distributing API keys or tokens across laptops, config files, and environment variables. MCP deployments need a managed secrets boundary because scattered credentials create hidden access paths that are hard to revoke and harder to audit.

Q: Who should be able to see sensitive MCP request and response bodies?

A: Only explicitly assigned auditors should see full request and response content. Admins and owners may need operational metadata, but they should not automatically inherit access to sensitive payloads. That separation preserves investigative value without turning every privileged operator into a full-content log reader.


Technical breakdown

How MCP authentication anchors access to enterprise identity

MCP access is only defensible when the gateway first binds a request to a real corporate identity, then maps that identity to approved groups and permissions. In practice, this means the gateway acts as the policy decision point while the identity provider remains the source of truth for authentication and group membership. That separation matters because raw connection URLs, local credentials, or client-side trust are not enough to establish who is asking for access. The useful design pattern here is federation plus central policy, not distributed trust at the edge.

Practical implication: require identity provider-backed authentication before any MCP server discovery or connection is allowed.

RBAC and registries define who can see which MCP servers

Role-based access control limits what an authenticated user can do, while MCP registries limit what they can even see. That distinction is important: RBAC governs actions, but registry scoping governs exposure and reduces accidental or opportunistic access to sensitive servers. The article’s role model also shows why read-only visibility and operational control should not be merged. An auditor, for example, needs different access than a power user or admin. For MCP, fine-grained visibility is part of the security boundary, not just a usability feature.

Practical implication: separate server visibility from server administration, and remove default broad groups where tight scoping is required.

Proxy enforcement and audit logging create the control and evidence layer

The MCP proxy sits in the path of every request so policy can be checked before the request reaches the target server. Because the proxy is also the audit point, it can isolate user sessions, filter requests, and record tool calls, prompts, and responses for later review. That architecture is what turns MCP from a convenience layer into a governed channel. Encryption and external key management then protect stored secrets, tokens, and session data so the gateway does not become a high-value credential repository. Without those layers, MCP becomes another unmanaged access path with weak forensics.

Practical implication: route all MCP traffic through a single proxy, encrypt stored secrets, and retain auditable request and response records.


Threat narrative

Attacker objective: The objective is to gain unauthorised access to enterprise tools and data through the MCP layer while limiting detection and attribution.

  1. Entry begins when a user or agent reaches an MCP server through a connection URL or exposed client path without sufficiently strong centralised authentication.
  2. Escalation occurs when credentials, tokens, or overbroad roles let the requester invoke sensitive tools, read data, or bypass intended registry boundaries.
  3. Impact follows when the requester can access enterprise systems, exfiltrate data, or act without traceable evidence because logging and role separation were incomplete.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Centralised identity for MCP is a governance requirement, not a deployment preference. MCP extends AI agent and human access to the same backend systems, so the gateway becomes a de facto identity boundary. When that boundary is not anchored in enterprise identity and group membership, authorisation fragments across clients, servers, and ad hoc credentials. Practitioners should treat the gateway as part of the IAM control plane, not as an isolated integration layer.

Registry scoping is the real control for MCP server exposure. RBAC alone does not stop users from discovering sensitive servers they should never see. The article’s registry model points to a deeper identity principle: visibility is itself privileged access, especially when MCP exposes internal tools, databases, and cloud services. Teams should recognise that broad default groups create unnecessary exposure even before a tool is invoked.

Credential sprawl becomes operational debt the moment MCP traffic leaves the proxy. API keys, OAuth tokens, and session material scattered across laptops, configs, and environment variables create a machine identity problem that traditional user-centric controls do not cleanly solve. Ephemeral MCP trust debt: once credentials are distributed outside governed storage and proxy mediation, the organisation inherits untracked access paths and weak revocation. The implication is that secrets placement and proxy path design must be managed as one control.

Audit logging is the difference between governable MCP and opaque MCP. The article correctly ties logging to compliance, but the broader issue is accountability: without complete request, response, and tool-call records, teams cannot reconstruct what an agent or user did inside a shared interface. That gap affects incident response, insider risk review, and developer troubleshooting alike. Practitioners should view audit completeness as a prerequisite for operating MCP at scale.

Obot’s model reflects a broader shift toward identity-aware AI tooling governance. The field is moving from point integrations toward control planes that can apply policy, isolate sessions, and preserve evidence across heterogeneous systems. That direction validates existing NHI governance approaches, but it also raises the bar for lifecycle management because every new gateway becomes another place where access, tokens, and audit responsibility must be owned end to end.

From our research:

  • The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities, according to The State of Secrets in AppSec.
  • Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap.
  • That gap is why NHI Lifecycle Management Guide matters when teams try to move from ad hoc secret handling to governed rotation and offboarding.

What this signals

MCP gateways will increasingly be judged by whether they can make access review, audit retention, and secret custody part of one operating model. If the proxy cannot prove who accessed what, when, and under which role, the organisation has not solved MCP security, only relocated it.

Proxy-mediated trust: the useful pattern is no longer just central authentication, but a gateway design that forces every request through a policy and evidence layer. That is the point at which MCP begins to look like governed identity infrastructure rather than another integration endpoint.


For practitioners

  • Bind MCP access to enterprise identity before server discovery Require identity provider-backed authentication and group mapping before any MCP client can enumerate or connect to approved servers. Keep local or URL-based access paths from becoming bypass channels.
  • Remove broad default server visibility Replace all-user exposure with registry-based scoping that maps users and groups to specific MCP servers. Eliminate default everyone-style access where the server catalog includes sensitive systems.
  • Route all tool traffic through a single policy proxy Force every MCP request through a proxy that can validate access, isolate sessions, filter unsafe calls, and log prompts, requests, and responses for later review.
  • Protect tokens and session material with external key management Store secrets, OAuth tokens, and session metadata only in encrypted form and separate cryptographic key control from the application database using an external KMS.
  • Define auditor access separately from operator access Grant read-only access to request and response bodies only to explicitly assigned auditors, and keep administrative roles from inheriting sensitive log visibility by default.

Key takeaways

  • MCP security fails when authentication, authorisation, secret handling, and logging are treated as separate controls instead of one identity boundary.
  • The article’s strongest governance message is that registry scoping and proxy enforcement matter as much as RBAC because visibility itself is privileged access.
  • Teams that want to operate MCP safely need encrypted secret custody, complete audit records, and explicit auditor separation before they scale usage.

Standards & Framework Alignment

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

OWASP Agentic AI Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10MCP gateways mediate agent tool use and access to enterprise systems.
OWASP Non-Human Identity Top 10NHI-03Credential sprawl and unmanaged secrets are central risks in the article.
NIST CSF 2.0PR.AC-4The article focuses on least-privilege access to MCP servers and tool calls.
NIST SP 800-53 Rev 5AC-6RBAC, registries, and proxy enforcement all support least privilege.
NIST Zero Trust (SP 800-207)Central proxying and continuous verification align with zero trust patterns.

Map MCP credentials and tokens to NHI-03 and keep them out of laptops, configs, and environment variables.


Key terms

  • MCP Gateway: The control layer that relays assistant intent to tools and data sources through the Model Context Protocol. In practice, it becomes a policy boundary, not just a transport layer. If it trusts model output too early, it can turn unverified reasoning into real-world execution or disclosure.
  • 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.
  • Audit Completeness: The degree to which a control plane records enough detail to reconstruct what happened, who did it, and what data or action was involved. For MCP, completeness means tool calls, prompts, responses, and identity context are available for investigation and compliance.
  • Credential Sprawl: Credential sprawl is the uncontrolled accumulation of machine secrets, keys, and tokens across systems, teams, and environments. It usually starts with a single use case and ends with overlapping permissions, unclear ownership, and a larger attack surface than the organisation expected.

What's in the full article

Obot's full blog post covers the operational detail this post intentionally leaves for the source:

  • Step-by-step role setup for Owner, Admin, Power User, Basic User, and Auditor access
  • Exact MCP registry configuration patterns for team-based server visibility
  • Proxy-layer request handling, including filtering and request, response logging
  • Encryption and external KMS integration details for stored credentials and session data

👉 Obot's full post covers role design, proxy enforcement, and credential protection details

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an identity security programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 20, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org