The main failure is control drift. Once the agent leaves the bounded protocol and starts composing shell commands, the identity path becomes harder to scope, harder to audit, and easier to overuse. That is not automatically unsafe, but it means the governance model must cover the fallback path, not just the primary tool.
Why This Matters for Security Teams
Model Context Protocol can keep an agent inside a bounded, inspectable tool path. Shell access changes that equation immediately because the agent is no longer calling a narrow interface. It is constructing commands, chaining utilities, inheriting environment state, and potentially touching files, network paths, and local credentials that were never intended for autonomous use. That is why fallback paths are a governance problem, not just a technical convenience.
This is where many teams underestimate risk. A protocol-based control can look strong on paper while the escape hatch quietly bypasses the intended scope. NHIMG research on the State of MCP Server Security 2025 found that only 18% of MCP server deployments implement any form of access scoping for tool permissions, which means fallback paths are often even less controlled than the primary route. The practical lesson is consistent with the OWASP Top 10 for Agentic Applications 2026 and the NIST AI Risk Management Framework: autonomy expands the blast radius unless every execution path is governed.
In practice, many security teams only discover the control drift after an agent has already used shell fallback to reach data or commands that were never covered by the original authorization model.
How It Works in Practice
When an agent falls back from MCP to shell, the core issue is that the identity and authorization model becomes less explicit. MCP can expose a narrower contract: defined tools, scoped permissions, and a clearer audit boundary. Shell execution, by contrast, often relies on the surrounding OS user, inherited environment variables, local secrets, and whatever the agent can compose from available utilities. That means the governing question shifts from “what tool was called?” to “what did the agent assemble at runtime?”
Best practice is evolving toward layered controls rather than a single gate. Security teams usually need all of the following:
- Workload identity for the agent itself, so the system can prove what is executing, not just what credential it holds.
- Intent-based authorization at request time, so shell use is approved only for a specific task, path, or command class.
- Just-in-time, short-lived credentials rather than static secrets that survive beyond the task boundary.
- Command allowlisting, argument validation, and environment isolation for fallback shells.
- Centralized logging that ties MCP calls and shell commands into one trace for investigation.
That approach aligns with current guidance from the OWASP Non-Human Identity Top 10 and implementation patterns discussed in NHIMG’s Analysis of Claude Code Security. It also maps to the broader agentic risk picture in OWASP Agentic Applications Top 10, where tool chaining and privilege expansion are recurring failure modes. These controls tend to break down when the agent runs on a developer workstation with broad OS privileges because local context, cached credentials, and ad hoc scripts make fallback behavior hard to predict and harder to contain.
Common Variations and Edge Cases
Tighter fallback control often increases operational friction, requiring organisations to balance autonomy against developer convenience and incident response speed. There is no universal standard for this yet, especially in environments that mix MCP, shell, CI jobs, and internal automation.
One common edge case is a “safe” shell that is only used for read-only diagnostics. That can still create exposure if the agent can enumerate files, scrape tokens from logs, or pivot into adjacent services. Another is partial fallback, where an agent uses MCP for the primary action but shell for pre-checks, retries, or cleanup. Those paths are easy to miss in policy design because they look secondary, yet they often carry the same identity risk as the main task.
The best current guidance suggests treating every fallback as a separate execution surface with its own approval, logging, and revocation rules. That is especially important where shell commands can invoke package managers, build tools, or scripts that themselves launch networked actions. NHIMG cases such as Amazon Q AI Coding Agent Compromised and the Replit AI Tool Database Deletion show why “just let it use the shell” is not a trivial fallback decision. In high-trust environments, the safer pattern is to make fallback rare, explicit, and time-bounded rather than informal and persistent.
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, CSA MAESTRO and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | T10 | Shell fallback expands tool abuse and privilege chaining risk in agents. |
| CSA MAESTRO | MM-02 | MAESTRO addresses agent workflow boundaries and runtime control enforcement. |
| NIST AI RMF | GOVERN | Fallback paths require explicit governance, accountability, and traceability. |
| OWASP Non-Human Identity Top 10 | NHI-01 | Shell fallback often exposes overprivileged or long-lived non-human identities. |
| NIST CSF 2.0 | PR.AC-4 | Least privilege must extend to non-MCP execution paths and local command use. |
Define execution boundaries and monitor every agent path that can bypass the primary protocol.