AI Safety
LM Studio's AI command safety judge faces credibility test when it approves risky actions
An automated system designed to catch dangerous shell commands sometimes greenlights risky operations when they seem necessary to complete user requests.
The New Stack
LM Studio developed a two-tier safety system for its Bionic AI coding agent to prevent malicious or dangerous shell commands from running. Yet the second layer—a dedicated AI reviewer—occasionally fails its core job by approving commands it shouldn't, revealing tension between safety and usability in agent-based systems.
How Bionic's safety layers work#
The system starts with the Shell Judge, which translates commands into abstract syntax trees to understand their structure rather than just scanning for dangerous keywords. A seemingly harmless command like git diff $base becomes risky if the variable resolves to something like --output=/some/file, potentially writing data to the filesystem in unexpected ways.
According to LM Studio's blog post, this first layer handles as many as 82% of commands without requiring additional AI analysis. The Shell Judge tracks values across multiple chained commands and tests against more than 11,600 edge cases that capture how individual command-line tools interpret their arguments in non-obvious ways.
The approver problem#
When the Shell Judge cannot make a determination, the command escalates to the Shell Reviewer—a separate AI model that evaluates the request in context. Here the system encounters a fundamental problem: the AI reviewer sometimes prioritizes completing the user's stated goal over enforcing security boundaries.
LM Studio discovered that simply asking the reviewer whether a command should run led to approval of risky actions when they appeared necessary for task completion. The team recalibrated the system so the reviewer rates commands across multiple dimensions—risk level, user authorization, and correctness—without being told what thresholds must be met to approve.
Remaining vulnerabilities#
The approach still carries blind spots. The Shell Reviewer examines assistant messages to understand authorization context, creating a potential injection point if Bionic's own reasoning has already been compromised by malicious input. While LM Studio filters tool results to prevent instructions hidden in web content or files from reaching the reviewer, compromised agent messages could still smuggle in harmful directives.
The Shell Judge itself makes assumptions that don't always hold: it trusts that executables like git haven't been tampered with and doesn't account for malicious configuration files that could alter command behavior. As demonstrated by recent supply chain attacks, legitimate-looking provenance signals can mask malicious payloads buried in dependencies.

