Join our Newsletter — 33% off our NHI Course

Can AGENTS.md turn Kilo AI CLI into a shell path?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20225
Topic starter  

TL;DR: A malicious AGENTS.md can drive Kilo AI CLI into shell execution, with Mindgard highlighting how repository instructions can override user intent through the built-in execute_command path. Kilo AI CLI needs a hard separation between trusted input and terminal authority before ambient context can trigger commands.

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: 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.

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.

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.

Glossary terms: Instruction Injection, Execution surface, Delegated authority, Instruction Provenance

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 1 week ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20715
 

Instruction trust is now an execution control problem: the central failure here is not that a file exists, but that the system treats repository-authored instructions as a valid source of runtime authority. That collapses the distinction between documentation and command path, which is exactly where agentic tooling becomes dangerous. Security teams should govern which instruction sources can influence tool invocation, not just which binaries can run.

A question worth separating out:

Q: How should security teams govern AI coding assistants that can run terminal commands?

A: Treat command execution as a privileged workflow, not a convenience feature. Define which actions can run automatically, which require approval, and which are blocked outright. Then log the prompt, the command, the outcome, and the user context so reviewers can reconstruct what the assistant actually did during development.

👉 Read our full editorial: Instruction injection in AI CLI tooling can trigger shell execution


This post was modified 1 week ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.