TL;DR: Claude Code mods run unsandboxed with the developer's own access, so a plugin can read secrets, rewrite tool calls and approve commands unless managed settings restrict what loads, according to Dam Secure. Plugin governance, not user trust, becomes the control point when code extensions can act with the same reach as the agent itself.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Dam Secure's blog post: Claude Code mods behave like trusted code inside the agent process, so teams must govern which mods can load, what they can access and how they are reviewed.
Why it matters: This matters because agent extensions can inherit machine access, create new exfiltration paths and bypass the assumptions behind ordinary developer trust models.
By the numbers:
- Ten days after launch, one community list already tracked 3,382 Claude Code mods.
Context
Claude Code mods are extension code that runs inside the agent process, not a separate browser-style add-on. That means the security question is not whether the developer trusts the output, but whether the extension deserves the same runtime reach as the agent itself.
When a plugin can read environment variables, start processes, make network calls and influence approvals, it becomes part of the access path, not a cosmetic feature. The governance gap is familiar from software supply chain risk: organisations often approve functionality before they decide who owns the loading policy, review gate and update cadence.
Key questions
Q: How should security teams govern AI plugins installed by employees across approved agent platforms?
A: Security teams should treat AI plugins as part of the enterprise software supply chain, not as harmless add-ons. Each plugin can change agent behavior, access data, and invoke tools. Governance should include discovery, marketplace provenance, endpoint coverage, and risk review so teams can see where plugins run and how far they have spread before exposure becomes widespread.
Q: Why do plugin ecosystems create supply chain risk in developer tools?
A: Plugin ecosystems create supply chain risk because they let third-party code run inside a developer tool with the same local trust and update path as the host application. A malicious or compromised plugin can read files, intercept commands, steal secrets from memory or configuration, and tamper with builds. Risk is highest when plugins lack signing, review, scope limits, or permission isolation.
Q: How does an in-process extension bypass sandbox and deny rules?
A: An in-process extension runs inside the host application’s own address space, so it can use the same libraries, data structures, and permissions as the core process. That placement can bypass sandbox boundaries and deny rules because the host cannot reliably separate extension actions from native ones, especially when the extension can call internal APIs or hook file, network, or UI operations.
Q: Could a trusted mod expose API keys and tokens on developer machines?
A: Yes. A trusted mod on a developer machine can expose API keys and tokens by reading local configuration files, environment variables, browser storage, clipboard contents, or process memory. If the mod runs with broad file or command access, it can also forward secrets to external services. Secret scanning, least privilege, and isolated profiles reduce that exposure.
Technical breakdown
Why Claude Code mods behave like in-process code
A Claude Code mod is JavaScript or TypeScript that executes inside Claude Code's own process, which is why it can observe events, rewrite tool calls and replace responses. It is not a detached integration and it is not limited to presenting UI. Because it shares the runtime, a mod can influence both behaviour and control flow before a user notices the change. That matters for governance because the extension is not merely consuming the agent, it is sitting on the same execution path as the agent itself. See the AI Coding Agents Security Guide.
Practical implication: Treat every mod as privileged runtime code and review its event handlers, not just its description.
How sandboxing and deny rules fail to contain mods
Claude Code's sandbox applies to Bash commands the agent runs, but a mod's own file, process and network calls are outside that boundary. Deny rules control Claude's tools, yet a mod can use its own APIs to read files or send data elsewhere. That creates a split control plane: policy can block the agent while the extension still acts on the same machine context. If the mod also answers permission checks, it can change a prompted action into an approved one without the normal review path. See the Claude Code Security Guide.
Practical implication: Assume tool deny rules are incomplete unless you also restrict which mods can load and what APIs they can call.
Why managed settings are the real loading policy
Managed settings decide whether user-installed mods, sideloaded mods and locally written mods are allowed to load. The built-in sec-default guard reduces the chance that user policy overrides organizational policy, but it does not decide which extensions are permitted in the first place. That is why the loading decision belongs in centrally managed configuration, not in developer preference. In practice, the loading policy is the control that separates a useful ecosystem from an unreviewed extension channel. See the AI IDE and Coding Agent Security Guide.
Practical implication: Centralise mod admission in managed settings and disable sideload paths that bypass the approved marketplace.
Threat narrative
Attacker objective: Steal secrets and shape agent behaviour through a plugin that inherits the developer's access.
- Entry occurs when a developer installs or loads a mod that appears useful but is not yet reviewed as trusted runtime code.
- Credential harvest happens when the mod reads environment variables, settings or files that contain API keys, tokens or other secrets.
- Exfiltration and impact follow when the mod sends collected data over HTTP or rewrites approvals and tool calls in ways that expand access and leak sensitive context.
Breaches seen in the wild
- LiteLLM PyPI package breach: LiteLLM PyPI supply chain attack, credentials stolen from users.
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
Claude Code mods create a runtime trust problem, not a cosmetic extension problem. Once a plugin runs inside the agent process, it inherits the machine context that the agent can reach. That means the control boundary is no longer the user interface, but the loading policy, the review workflow and the permission model around extensions. Teams that treat mods as productivity add-ons miss the fact that they are placing code on the access path.
Long-lived extension trust is the named failure mode here: mod sprawl without loading governance. Dam Secure's example shows a familiar governance assumption breaking down, namely that useful community code can be admitted first and risk-managed later. That pattern is the same one seen in other extension ecosystems when the install decision is separated from the review decision. The discipline required is closer to dependency governance than to feature enablement.
Secret exposure through mod APIs is a direct NHI governance issue. When a mod can read environment variables, it can reach the same API keys, tokens and configuration secrets that often underpin non-human identity access. AI coding agents security become part of the NHI surface because the agent and its extensions can operate on the same credentials. That makes credential scope, rotation and marketplace control part of identity governance, not just developer tooling hygiene.
Managed settings are the control point, but they are not the whole control story. Central policy can block sideloading and constrain which mods load, yet organisations still need a review gate for updates and a clear owner for the internal marketplace. Without that, a trusted mod can evolve into an unreviewed dependency just as quickly as any library. The practical conclusion is that extension governance must be owned, versioned and auditable.
From our research library:
- Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
- Read next: AI IDE and Coding Agent Security Guide
What this signals
Extension governance will become a standard part of AI developer platform hardening. As agentic IDEs and terminal assistants gain more plugin-like extensibility, teams will need a policy for admission, version pinning and revocation that looks much closer to dependency control than feature rollout. The shortest path is to make managed settings the only approved loading path and to review every update as though it were a new package.
Secret-bearing plugins are now part of the NHI perimeter. A mod that can read environment variables can reach the same credentials that service accounts and automation jobs rely on, so the boundary between developer tooling and identity governance is thinner than many programmes assume. That makes secrets hygiene, marketplace ownership and runtime monitoring part of one control story.
Mod sprawl is the new extension sprawl. When thousands of community plugins appear quickly, the likely failure is not just one malicious package but the accumulation of unaudited trust. The control response should focus on shrinking the set of allowed sources, pinning approved versions and monitoring for changes in what a loaded mod can access.
For practitioners
- Enforce managed-only mod loading Set managed settings so only built-in and organisation-approved mods can load, and block sideload flags that bypass the approved path.
- Review every mod like a dependency Validate the hooks and APIs a mod uses before approval, then re-review any update that changes file access, process calls, network access or permission handling.
- Pin approved versions in a controlled marketplace Keep approved mods in an internal marketplace or repository with required reviewers so a changed upstream release cannot load without another review.
- Test policy enforcement on a clean machine Run a blocked sideload attempt on a test system and confirm the guard refuses the mod before any hooks execute.
Key takeaways
- Claude Code mods are not lightweight add-ons. They are runtime code that can inherit the agent's access to files, processes, secrets and approvals.
- The main governance gap is unreviewed loading, because a useful plugin can become a credential and exfiltration path after installation or update.
- Managed settings, controlled marketplaces and dependency-style review are the controls that move mod risk back into policy.
Related NHI Mgmt Group resources: AI Coding Agents Security Guide · AI IDE and Coding Agent Security Guide · Claude Code Security Guide · LiteLLM PyPI package breach
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, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Mods can read environment variables and local files that often hold API keys and tokens. |
| NHI-07 — Long-Lived Secrets | Loaded mods can expose credentials that persist far beyond the original review point. | |
| Recommendation — Restrict mod loading paths and scan extension code for secret access before approval. Rotate developer and automation secrets more aggressively when plugin access expands the runtime surface. | ||
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | A mod can approve calls and rewrite tool actions using the agent's effective privilege. |
| Recommendation — Constrain extension authority so plugins cannot escalate or reframe privileged agent actions. | ||
| MITRE ATT&CK | TA0006;TA0010 — Credential Access; Exfiltration | The risk pattern combines secret access with outbound data transfer from the same runtime. |
| Recommendation — Map mod review to credential access and exfiltration paths in your detection content. | ||
| CIS Controls v8 | CIS-5 — Account Management | Mod governance affects who can exercise and approve machine-level access through the agent. |
| Recommendation — Apply account management controls to the identities and approvals that load or operate plugins. | ||
Key terms
- Claude Code Mod: A Claude Code mod is an extension package that runs inside the agent's process and can observe or alter agent behaviour. It is implemented with JavaScript or TypeScript handlers, and its security profile depends on the permissions and runtime access of the host agent.
- In-Process Extension: An in-process extension runs inside the synchronization server process itself. This makes execution more efficient and easier to observe during development, but a failure in the custom code can affect the host process and disrupt synchronization.
- Managed Settings: A persistent configuration layer that defines what an AI coding tool may do, what it must ask about, and what it cannot touch. For identity teams, this becomes the policy boundary that governs command execution, tool use, and exposure to sensitive paths.
- Software Supply Chain Risk: Software supply chain risk is the chance that code, build, deployment, or dependency paths are altered in ways that affect downstream systems. For AI code assistants, this risk rises when the tool can change source, trigger pipelines, or influence infrastructure definitions.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security and secrets management. It helps practitioners build the control language needed to govern agent tooling, access and lifecycle risk.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org