Urgent.News

What's breaking now, across thousands of outlets.

AI

AI Guardrails Belong in Your Task Runner: I Built a Tool to Stop Supply Chain Attacks

In August 2025, malicious versions of the npm packages for Nx, a popular build tool, were published. Their postinstall script, which runs on install, contained these lines: claude --dangerously-skip-permissions -p "<prompt>" gemini --yolo -p "<prompt>" q chat --trust-all-tools --no-interactive The malware looked for coding agents installed on the machine and called them with every confirmation…

In August 2025, compromised versions of the npm packages for Nx, a popular build tool, were released. Their postinstall script contained malicious code that, when executed, searched for sensitive files and information on the victim's machine and reported them to the attacker's GitHub account. Despite the agent having built-in guardrails, the actual execution of commands occurred through a task runner or a Continuous Integration (CI) system, rendering the agent's safeguards ineffective.

The author argues that guardrails should be integrated into the task runner, as it is the final component to execute the commands. Traditional tools like Make or Taskfile do not have visibility into the commands being executed, limiting their ability to apply guardrails effectively. By placing guardrails within the task runner, developers can specify which files, network destinations, ports, secrets, and environments a command is allowed to access.

This approach enables the task runner to enforce constraints on the commands before they are executed, enhancing security and preventing supply chain attacks.

The author demonstrates the concept using a tool called Lask, a task runner that allows developers to define security boundaries for each task. By specifying which files, volumes, outbound connections, inbound connections, secrets, and whether a command runs on the host or in a container, developers can create a secure environment for their tasks.

Lask containersizes each command execution in a Docker image defined by the developer, ensuring that the task runner has visibility into the command's behavior and can enforce the specified boundaries. This proactive approach to security prevents unauthorized access to sensitive information and mitigates the risk of supply chain attacks.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Sunday 15 November →