TL;DR: AI agent stacks centralised through MCP can move credentials out of developer laptops and into the platform database, creating a new secrets sprawl and auditability problem as enterprises connect hundreds or thousands of upstream services, according to 1Password. Runtime resolution keeps secrets in the vault until needed, but governance now hinges on the control point, not the agent alone.
At a glance
What this is: This is an analysis of how MCP gateways can become a new secrets sprawl point for AI agents when credentials move from developer machines into platform storage.
Why it matters: IAM and NHI teams need to treat the MCP gateway as a control point, because centralizing access without runtime secret resolution can expand blast radius, weaken auditability, and create a new governance gap for agent workloads.
Context
MCP gateways sit between AI agents and the tools, services, and data they call. In principle, that makes them a useful policy enforcement point; in practice, they can become a credential repository if raw secrets are copied into the platform instead of kept in a governed vault.
The identity issue is not just where the secret lives, but whether the control model preserves vault ownership, auditability, and least exposure as agent adoption scales. For teams building MCP-based AI access patterns, the governance question is whether runtime resolution replaces secret storage or simply relocates the sprawl.
This is fundamentally an NHI governance problem because each upstream service connection needs credentials that should remain traceable, revocable, and tightly scoped even when accessed by AI agents.
Key questions
Q: What breaks when MCP gateways store raw credentials instead of vault references?
A: The gateway stops being a policy layer and becomes an unmanaged secrets store. That breaks the single source of truth for ownership, rotation, and revocation, and it increases blast radius if the platform is compromised.
Q: Why does runtime secret resolution reduce risk in AI agent access flows?
A: Runtime resolution removes durable credential copies from the platform and limits exposure to the request window. That matters because AI agents may call many upstream systems, and each stored copy increases the number of places a secret can leak or be reused.
Q: How do teams know whether an MCP control plane is actually governing secrets?
A: Look for evidence that the platform stores references, not raw values, and that every fetch and rotation is logged with traceability. If the database contains credentials, governance is already partial rather than complete.
Q: How should security teams handle secrets in MCP gateways for AI agents?
A: Security teams should keep the raw secret in the vault and let the MCP gateway resolve only a reference at runtime. That reduces persistence, limits blast radius, and preserves the vault as the source of truth. The gateway should log fetch and rotation events, but never store or expose the credential value itself.
Technical breakdown
Why MCP gateways become a secrets control point
An MCP gateway proxies tool calls between an AI agent and upstream systems such as GitHub, Slack, Notion, or internal APIs. That proxy layer naturally sees the credential fields, which makes it attractive for policy enforcement, logging, and rotation handling. The failure mode appears when the gateway stores raw secrets in its database rather than acting as a reference-only layer. At that point, the platform becomes a second secrets store with broader blast radius than the original vault. The architectural issue is not centralisation by itself, but centralisation without preserving a single governed source of truth.
Practical implication: Keep the gateway as a resolver and policy layer, not a secrets repository.
Runtime resolution versus stored credentials
Runtime resolution means the platform stores only a reference, then fetches the live secret at connection time and injects it into the upstream request. This reduces persistence because the credential exists in memory only for the request window and never needs to be written to disk or replicated into the platform database. The security value comes from removing durable copies, not from hiding the secret behind a new abstraction. If the platform stores the raw value, you gain convenience but lose the vault boundary. In NHI terms, that is a control-plane design choice that directly changes exposure and revocation behaviour.
Practical implication: Use reference-based secret injection so the vault remains the system of record.
Why auditability breaks when secrets leave the vault
When secrets are copied into the MCP platform, the organisation often loses a clean record of which credential changed, who rotated it, and where it was used. Hash-based traceability can preserve evidence of a change without exposing the secret itself, but that only helps if the secret never becomes an unmanaged duplicate. The governance problem is not just compromise response. It is the inability to prove inventory, ownership, and rotation state across hundreds or thousands of upstream connections. In an agentic workflow, that uncertainty becomes operational debt very quickly.
Practical implication: Treat credential fetch and rotation logs as the audit spine for MCP-connected identities.
NHI Mgmt Group analysis
MCP gateways create an identity control-point problem, not just an integration problem. Once the gateway becomes the place where credentials are entered, resolved, and logged, it inherits the governance burden that used to sit in the vault. The field should stop describing this as simple platform consolidation, because the real issue is whether the control point preserves ownership and revocation semantics. Practitioners need to treat the gateway as part of the credential lifecycle, not a neutral transit layer.
Secrets sprawl has moved one layer closer to runtime. The old pattern scattered credentials across developer laptops and plaintext config files. The new pattern can scatter them across gateway databases and control-plane metadata unless the architecture enforces reference-only storage. That is a different form of risk because the exposure is now concentrated around the very component meant to improve governance.
Hash-based traceability is a useful pattern, but only when the vault remains authoritative. Logging the fact that a secret was fetched or rotated is not the same as governing the secret itself. If the platform can store the raw value, audit logs describe an already-broken model. The discipline here is to separate observability from custody and keep those functions from collapsing into the same layer.
Runtime secret resolution is the right named concept for this problem space. It captures the shift from durable credential storage to just-in-time retrieval at the moment of use. That shift matters because it preserves the vault boundary while still allowing AI agents to operate at scale. For identity programmes, the practical conclusion is that every MCP control plane should be evaluated on whether it resolves secrets or reproduces them.
MCP gateways are becoming the new test case for NHI governance maturity. Enterprises can centralise access for hundreds or thousands of upstream connections, but the programme still fails if each connection spawns another unmanaged credential copy. This is where NHI governance, secrets management, and auditability converge, and teams should measure the gateway by how little secret material it retains.
From our research library:
- 88% of organisations have embedded AI agents in their workflows, according to KPMG's 2026 report.
- Read next: AI Agent Identity Security Buyer's Guide
What this signals
Runtime secret resolution is the governance breakpoint for MCP-enabled AI access. The practical question is not whether AI agents can reach more tools, but whether the control plane stores secrets or merely resolves them for the duration of a request. Teams that cannot answer that question cleanly are already running a second secrets estate, even if the architecture looks centralized.
MCP secrets sprawl will surface as an ownership problem before it becomes a breach problem. Once hundreds or thousands of upstream connections depend on the same platform layer, inventory drift and revocation ambiguity become the first symptoms. Security teams should expect the governance burden to move from developer endpoints to control planes unless custody stays outside the platform.
For practitioners
- Keep the vault authoritative for MCP credentials Store only a secret reference in the gateway and resolve the live value at request time so the platform never becomes a second secrets store.
- Audit every secret fetch and rotation Log fetch events and rotation events with hash-based traceability so security teams can prove change without exposing the credential itself.
- Limit secret persistence to memory only Ensure the credential exists only for the duration of the upstream request and is never written to disk, cached in the database, or reused across sessions.
- Map every upstream server credential to an owner Build inventory for each GitHub, Slack, Notion, internal API, and similar connection so revocation and rotation have a clear accountable source.
Key takeaways
- MCP gateways can improve control over AI tool access while simultaneously creating a new secrets sprawl layer if raw credentials are stored in the platform.
- The governance risk is not only exposure but loss of a single authoritative record for ownership, rotation, and revocation across upstream services.
- Runtime resolution and vault-based custody are the controls that preserve least exposure without turning the gateway into a second secrets repository.
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 SP 800-53 Rev 5, NIST CSF 2.0 and CSA Cloud Controls Matrix set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The article centers on raw credentials moving into the gateway database. |
| NHI-05 — Overprivileged NHI | Each upstream MCP connection expands the blast radius if credentials are too broad. | |
| NHI-07 — Long-Lived Secrets | The article argues for runtime resolution over persistent credential storage. | |
| Recommendation — Keep MCP platforms from storing raw secrets and scan for leaked credential copies. Scope each MCP credential to the smallest upstream service permissions possible. Replace persistent MCP secrets with short-lived, on-demand credential resolution. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | The piece focuses on credential lifecycle, rotation, and revocation discipline. |
| Recommendation — Apply IA-5 to govern creation, storage, rotation, and revocation of MCP authenticators. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The gateway mediates access to upstream services and needs permission governance. |
| Recommendation — Use PR.AA-05 to control which MCP-connected identities can reach each upstream service. | ||
| CSA Cloud Controls Matrix | IAM — Identity and Access Management | The article is about cloud identity control at the gateway and vault boundary. |
| Recommendation — Use IAM cloud controls to keep MCP credential custody outside the control plane. | ||
| MITRE ATT&CK | TA0006 — Credential Access | Stored gateway secrets are a direct credential access target if the platform is compromised. |
| Recommendation — Map MCP secret storage to TA0006 and hunt for places credentials are persisted. | ||
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.
- Runtime secret resolution: Runtime secret resolution means a platform stores a reference to a credential and fetches the live value only when a request is executed. This reduces persistence and can limit exposure, but only if the resolved secret is not cached, copied into logs, or written to disk.
- Secrets Sprawl: The uncontrolled proliferation of sensitive credentials, API keys, tokens, passwords, certificates, across codebases, cloud environments, CI/CD pipelines, and configuration files. In 2024, over 50 million leaked secrets were found on the dark web.
- Hash-Based Traceability: An audit technique that records a cryptographic fingerprint of a credential event instead of the credential itself. It allows teams to prove that a fetch or rotation occurred without exposing the underlying secret, supporting safer logging and change evidence.
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.
Published by the NHIMG editorial team on June 10, 2026.
Updated on October 10, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org