Subscribe to the Non-Human & AI Identity Journal

Why do static secrets create problems for MCP deployments?

Static secrets break lifecycle governance because they are hard to review, rotate, and revoke at the same cadence as enterprise access. They also make it difficult to prove who authorised a tool call after the fact. For MCP, that means security teams lose both control and evidence.

Why Static Secrets Become a Liability in MCP

static secret are a poor fit for MCP because the protocol is often used to connect autonomous tools to sensitive systems at runtime, not in a fixed human workflow. A token that lives too long can be copied, reused, or silently embedded in automation, which breaks the basic idea of time-bound authority. NHIMG research shows how quickly this becomes real: GitGuardian’s State of Secrets Sprawl 2026 found 24,008 unique secrets exposed in MCP configuration files in 2025 alone. That is a protocol-specific warning sign, not a theoretical one.

For practitioners, the real issue is governance. Static secrets are difficult to tie to a single task, a single intent, or a single approver. That makes them a weak foundation for OWASP Agentic AI Top 10 style risks, where agents can chain tools and expand impact faster than legacy access reviews can react. This is why NHIMG’s Ultimate Guide to NHIs — Static vs Dynamic Secrets treats long-lived credentials as an anti-pattern for dynamic workloads. In practice, many security teams discover the problem only after a tool credential has already been reused outside its original purpose, rather than through intentional control design.

What Good MCP Credential Design Looks Like

Current guidance suggests treating MCP access like a workload identity problem, not a shared-password problem. The strongest pattern is short-lived, task-scoped credentialing: issue a credential only when an approved request is made, bind it to the workload or agent identity, and revoke it automatically when the task ends. That aligns with zero standing privilege thinking and reduces the blast radius if an agent behaves unexpectedly.

In practice, this means three controls matter more than secret storage alone:

  • Use workload identity to prove what the agent is, rather than handing it a reusable static token.
  • Evaluate authorisation at request time, using context such as tool, destination, user intent, and risk.
  • Prefer JIT ephemeral secrets over persistent API keys, especially for high-impact tool calls.

This is consistent with the direction in OWASP Non-Human Identity Top 10 and with NHIMG’s Guide to the Secret Sprawl Challenge, which frames secret sprawl as an operational governance failure, not just a storage issue. For agentic deployments, policy engines such as OPA or Cedar are increasingly used to enforce intent-based authorisation, but there is no universal standard for this yet. These controls tend to break down when multiple agents share the same credential pool because attribution and revocation become ambiguous.

Where the Edge Cases and Failure Modes Show Up

Tighter secret controls often increase operational overhead, requiring organisations to balance safer access against deployment friction. That tradeoff is especially visible in MCP environments with many connectors, fast-changing tools, or human-in-the-loop exceptions.

Some environments still lean on static secrets for service stability, legacy integrations, or vendor constraints. That can be acceptable only when the secret is tightly scoped, heavily monitored, and paired with compensating controls such as network restrictions, strong auditing, and fast revocation workflows. Even then, current guidance suggests treating the secret as a temporary exception, not a durable design choice. The risk is higher in agentic systems because autonomous behaviour is inherently less predictable than human workflow. Once an agent can select tools, chain actions, or pivot across systems, a long-lived secret turns every mistake into a persistent access path. That is why NHIMG’s OWASP Agentic Applications guidance and the OWASP Top 10 for Agentic Applications 2026 both emphasise runtime control over static trust.

For MCP specifically, static secrets are weakest when tool calls are high-value, approval paths are unclear, or multiple automation layers can reuse the same credential. That is where identity, intent, and revocation must work together, and where static secrets usually fail first.

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 OWASP Agentic AI Top 10 address the attack and risk surface, while NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Addresses weak rotation and overlong NHI credential lifetime.
OWASP Agentic AI Top 10 Covers autonomous tool use and runtime authorisation risks.
NIST AI RMF Supports accountable governance for AI systems with changing behaviour.

Replace persistent MCP keys with short-lived NHI credentials and automate rotation and revocation.