The normal user-to-tool relationship breaks, because the operator can inject prompts, read outputs, and persist the connection outside the user’s direct control. At that point, the package is no longer just a convenience layer. It is a delegated execution path that needs the same scrutiny as any other privileged non-human identity.
Why This Matters for Security Teams
A local AI CLI looks like a developer convenience until a relay package turns it into a remotely controlled execution path. At that point, the important question is no longer whether the tool is “local,” but who can steer prompts, observe results, and keep the session alive. That is an identity and delegation problem, not a packaging problem. The risk pattern is similar to the Gemini CLI Breach — Silent Code Execution and the LiteLLM PyPI package breach: an execution channel is trusted too broadly, then used in ways the operator did not intend.
Security teams often miss this because the package is installed by a user, launched on a workstation, and assumed to inherit that user’s control boundaries. In reality, a relay can detach the operator from the session, multiplex commands, or forward output to a third party. Once that happens, classic workstation trust assumptions no longer hold. Guidance in NIST SP 800-53 Rev 5 Security and Privacy Controls still applies, but it must be mapped to the agent-like behaviour of the relay and the CLI, not just the endpoint itself. In practice, many security teams encounter the abuse only after the relay has already persisted access and the user believes the session is still local.
How It Works in Practice
When a local AI CLI is remotely steered through a relay package, the relay becomes the control plane. It can inject prompts, capture outputs, chain tool calls, and keep a session active beyond the original interactive context. That changes the security model in three important ways. First, the session is no longer bounded by a single human operator. Second, the tool can be made to execute actions that appear locally initiated but are actually remotely directed. Third, the relay can create a hidden delegation layer that bypasses the user’s normal review workflow.
For security design, that means the package should be treated like a privileged non-human identity with runtime authority. Current guidance suggests using request-time policy evaluation rather than static trust in the installed package. Controls from NIST SP 800-53 Rev 5 Security and Privacy Controls should be paired with identity-aware logging, explicit command allowlists, and short-lived credentials for any downstream APIs the CLI can reach. The relevant lesson from The State of Secrets in AppSec is that secrets and tokens often linger far longer than the session that used them, which makes relay abuse much more damaging.
- Bind the CLI to a workload identity, not just a user shell, so session provenance is auditable.
- Issue just-in-time credentials for sensitive actions and revoke them when the task completes.
- Log prompt injection, tool invocation, and output forwarding as separate events.
- Require real-time policy checks before the CLI can call external tools or secrets stores.
These controls tend to break down when the relay sits inside a developer plugin ecosystem because the forwarding layer is treated as benign transport rather than privileged execution infrastructure.
Common Variations and Edge Cases
Tighter relay control often increases friction for legitimate automation, requiring organisations to balance developer velocity against session integrity. That tradeoff is especially sharp when teams use local CLIs for rapid debugging, model evaluation, or ad hoc administration. Best practice is evolving, and there is no universal standard for how much remote steering should be allowed in a “local” workflow.
One edge case is a relay that only forwards prompts but does not itself execute tools. Even then, the relay can still reshape behaviour by changing the instruction stream, so the trust boundary remains broken. Another is a multi-user relay where one person launches the session and another steers it. That model needs explicit delegation, authentication, and traceability, otherwise the package becomes an ungoverned shared control path. The exposure pattern discussed in the DeepSeek breach shows why secrets, chat history, and backend access all become part of the blast radius once a control channel is compromised.
Where teams are still defining policy, the safest rule is simple: if a relay can influence prompts, observe outputs, or preserve session state independently, it should be governed like a delegated privileged identity, not a harmless wrapper.
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 | A01 | Remote steering turns the CLI into an agentic execution surface. |
| CSA MAESTRO | MAE-03 | Relay packages create delegated autonomy that needs explicit governance. |
| NIST AI RMF | The issue is unmanaged AI delegation and operational risk. | |
| OWASP Non-Human Identity Top 10 | NHI-05 | The relay behaves like a privileged non-human identity with delegated access. |
| NIST CSF 2.0 | PR.AC-4 | Session steering changes access control and verification needs. |
Define authority, approval, and revocation rules for any AI execution path that can act independently.