Threat explainer

Unsafe command execution

How prompt injection and malicious tools cause AI agents to run dangerous shell commands.

  1. AI tools can run shell commands. Sometimes they run the wrong ones.

  2. Unsafe command execution happens when an agent runs rm -rf, curl to external endpoints, git push to unknown remotes, or installs packages based on injected instructions rather than user intent.

  3. HOL Guard turns these moments into private receipts first, then public lessons only after redaction and moderation.

Harness setup guides

Protect the coding tools your team already uses without forcing everyone to become a security expert.

Redacted warnings

Real protection moments, scrubbed for safety before becoming public learning pages.

Safe labs

Practice attack patterns with static simulations. Nothing dangerous executes.

Questions

What is unsafe command execution by AI coding agents?

Unsafe command execution is the point where an agent turns a mistaken, poisoned, or overbroad plan into a shell action with destructive or irreversible consequences. Coverage statements here are limited to the current HOL Guard support contract and do not imply universal model or harness protection.

Does HOL Guard prevent unsafe shell commands?

Partially, and only at supported local action boundaries. HOL Guard is local-first runtime control on the developer machine for shell, secrets/file reads, MCP server change, and plugin/skill install. It can require approval before supported shell actions. It does not cover commands executed outside the supported harness path, and it does not guarantee semantic safety of every command a human explicitly approves.

Does HOL Guard replace EDR or OS sandboxing?

No. HOL Guard complements rather than replaces EDR, endpoint antivirus, OS sandboxes, or a complete command-control program. Coverage is harness- and event-specific. Unsupported or partial surfaces are not claimed as protected.

Does a catalog or plugin scan mean agents cannot run dangerous commands?

No. A scan is not a safety guarantee and cannot intercept runtime shell actions. The current public catalog scanner is registry-broker-fallback static scoring, not a live exploit test. About 205 catalog plugins are not Registry Broker agent counts. Runtime benchmark fixtures are modeled, not live attack measurements.

Threat dossier · P1

Unsafe shell and destructive commands dossier

A coding agent can move from natural-language context to terminal execution without a separate human translating the instruction.

Direct answer

What is unsafe shell and destructive commands?

Unsafe command execution is the point where an agent turns a mistaken, poisoned, or overbroad plan into a shell action with destructive or irreversible consequences.

Coverage statements below are limited to the current HOL Guard support contract and do not imply universal model or harness protection.

Copied text includes the canonical source and review date.
Reviewed Reviewer: HOL Guard EngineeringReview cadence: 30 days

Representative attack path

Defensive model only. This sequence omits weaponized payloads and is not attributed to a specific incident unless a source explicitly says so.

  1. Step 1

    Context or planning produces a risky command.

  2. Step 2

    Agent requests shell execution.

  3. Step 3

    Command reaches files, repositories, networks, or credentials.

  4. Step 4

    Irreversible state change or data exposure occurs.

Coverage boundary

What this control can cover

  • Supported pre-command policy and approval boundaries.
  • Explicit policy for destructive or high-risk command classes.

What it does not prove or prevent

  • Commands executed outside the supported harness path.
  • Semantic safety of every command a human explicitly approves.

Policy pattern

Policy pattern for unsafe shell and destructive commands

Keep untrusted context or overbroad autonomy from becoming unconditional execution authority on supported action surfaces.

Use when: A coding agent can move from natural-language context to terminal execution without a separate human translating the instruction.

Decision pattern

  1. Identify the trust boundary and consequential action class.
  2. Apply least privilege and the narrowest supported policy.
  3. Require review for sensitive or ambiguous actions.
  4. Preserve only redacted, versioned evidence needed to reproduce the decision.

Limitations

  • Commands executed outside the supported harness path.
  • Semantic safety of every command a human explicitly approves.

If you suspect prompt injection

  1. Step 1

    Response 1

    Stop execution and preserve the redacted requested action.

  2. Step 2

    Response 2

    Assess filesystem/repository/network state for changes.

  3. Step 3

    Response 3

    Restore from known-good state where required.

  4. Step 4

    Response 4

    Update policy for the root risky action class.

Sources and mappings

Neighboring threat classes that share attack paths or trust boundaries with this dossier.

Last reviewed . This dossier separates sourced threat definitions from modeled attack paths and evidence-bounded product coverage.

Author: HOL Guard Research

Reviewer: HOL Guard Engineering

Change log

  • 2026-08-09: Published canonical threat dossier with attack path, coverage/non-coverage, response procedure, and sources.

Report a correction