TL;DR: Kilo AI CLI can be pushed into arbitrary shell execution when malicious repository instructions in AGENTS.md are treated as authoritative, according to Mindgard, allowing ambient context to override user intent and invoke execute_command. The control problem is not classic code injection but trust boundaries inside agent reasoning and tool use.
Editorial analysis by NHI Mgmt Group, based on content published by Mindgard: “Agent Instructions As Execution Paths: Arbitrary Command Execution in AI CLI Tooling”.
Key questions
Q: What fails when AI CLI tools treat repository instructions as authoritative?
A: The failure is the loss of a hard boundary between passive context and active execution.
Q: Why do agentic developer tools increase command execution risk?
A: They increase risk because the tool can infer intent from ambient context and then act with the user's privileges.
Q: What are the signs that an AI assistant is too close to execution?
A: Warning signs include repository files changing tool behaviour, commands being issued from context the user did not explicitly authorise, and assistant actions that feel like side effects of opening a project rather than deliberate requests.
Practitioner guidance
- Harden repository instruction trust Treat AGENTS.md and similar files as governed inputs.
- Separate reasoning from execution Require explicit authorisation before any agent-issued shell action, especially when the action originates from repository context rather than a direct user request.
- Inventory all agent tool paths Document every function that can move an AI assistant from interpretation to execution, including command runners, file writers and network-capable tools.
Bottom line: The core problem is not a malformed command but a broken trust boundary between repository text and executable action.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →