← Back to Skills Marketplace
thebrierfox

Free Bash Safety Primer

by ~K¹yle Million · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
150
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install free-bash-safety-primer
Description
Understand the attack surface created when an OpenClaw agent executes shell commands autonomously. Covers obfuscation, injection, encoding attacks, and why C...
README (SKILL.md)

OpenClaw Bash Safety — Why Your Agent Is a Security Risk

What Autonomous Bash Execution Actually Means

When you give an OpenClaw agent access to the exec tool, you are giving an AI model the ability to run arbitrary shell commands on your machine — your files, your network, your credentials, your hardware.

Most operators understand this abstractly. Fewer understand what it means when the agent is running autonomously, 24/7, executing commands generated from tool outputs, web content, files it reads, and messages it receives.

Every one of those inputs is a potential injection vector.

Default OpenClaw has no validation layer between the model's decision to run a command and the shell that executes it. The model is the only check. And models can be manipulated.

The Categories of Attack That Exist

When an agent executes bash autonomously, the attack surface spans several distinct categories. Understanding the categories is more important than knowing specific exploits — exploits evolve, categories don't.

Command Obfuscation

Shell commands can be written in ways that hide their intent from a model evaluating them as text. Variable substitution, brace expansion, heredocs, and character encoding tricks can make a destructive command unrecognizable as dangerous without AST-level parsing.

A model reading ${dangerous_var} as a string sees a variable reference. The shell sees whatever is in that variable.

Substitution Injection

Backtick substitution, $() process substitution, and \x3C() process redirection allow commands to be constructed from the output of other commands. An agent building a shell command from external data — a filename, a URL response, a file it read — can have malicious commands injected into the construction.

This is the bash equivalent of SQL injection, and it's trivially achievable against agents that don't strip or validate command construction inputs.

Encoding and Unicode Attacks

Unicode homoglyphs, zero-width characters, right-to-left overrides, and multi-byte sequences can make a command look like one thing to a model's text processing while the shell interprets it differently.

A filename containing a right-to-left override can display as readme.txt while actually ending in .exe. A command containing Unicode homoglyphs for /etc/passwd looks like a benign path until it executes.

Shell-Specific Escape Vectors

Bash and Zsh have different dangerous builtins, different history mechanisms, and different expansion behaviors. A validation layer written for Bash doesn't necessarily catch Zsh-specific attacks. Production security covers both shells, separately, because the dangerous commands are not the same list.

Persistence and Escalation Vectors

These are the attacks that matter most for autonomous agents: commands that modify cron, init, or systemd entries; commands that install backdoors into shell profiles; commands that create persistent network listeners; commands that modify sudo configuration. An agent that runs one of these once, even accidentally, has a problem that survives reboots.

Why ClawHavoc Happened

In early 2026, 341 skills on ClawHub were found to contain malicious bash payloads — roughly 20% of the active skill library at the time.

The mechanism was straightforward: skills execute code in the agent's context. Skills that included setup scripts, configuration helpers, or initialization routines had those routines execute with full agent permissions when the skill was installed. No validation layer checked those scripts before execution.

ClawHavoc wasn't a sophisticated supply chain attack. It was an absence of validation. Any operator who installed affected skills and had exec access enabled was exposed.

The affected skills looked legitimate. They had reasonable descriptions, normal-looking metadata, and plausible functionality. The malicious payload was in the setup script — the part most operators never read.

Why Regex Validation Isn't Enough

The obvious fix is regex pattern matching: block commands that contain rm -rf, curl | bash, known exfiltration patterns. Most simple bash validators work this way.

The problem is that regex operates on text. Shell execution operates on parsed syntax trees. You can write a command that passes every reasonable regex check and still executes destructively once the shell expands variables, resolves aliases, and processes substitutions.

Production bash security requires validation at multiple levels:

  • Text level (catches obvious patterns)
  • Structural level (catches substitution and expansion tricks)
  • Semantic level (catches context-dependent risks like relative paths in privileged operations)
  • Shell-specific level (catches builtins and behaviors that differ between Bash and Zsh)

Each level catches a different class of attack. Skipping any one of them leaves a category of attack unblocked.

The Bottom Line

If your OpenClaw agent has exec access — and most useful configurations do — and it operates on any external input (messages, files, web content, tool outputs), you have an unvalidated shell execution surface.

This was acceptable when agents were supervised demos. It is not acceptable when they run autonomously.

ClawHavoc demonstrated that the threat is real and active. The question is whether you address it before or after something goes wrong on your machine.


The full 23-validator production security chain — validated through production Claude Code deployments — is available as the Bash Security Validator skill on Claw Mart:

https://www.shopclawmart.com/listings/bash-security-validator-production-openclaw-shell-safety-ded33491

Usage Guidance
This skill is informational and low-risk as shipped: it contains guidance about shell-related attack surfaces and does not include code, installers, or credential requests. Before installing or invoking any security-related skill, review the full SKILL.md (the provided content was truncated) and verify the author's reputation or source. Be cautious about any skill that (unlike this one) includes setup scripts or install steps—those are the common supply-chain vectors. Follow least-privilege: don't grant exec/tool access or install unreviewed skills on critical machines, and cross-check recommendations here against trusted security resources before adopting any validators or enforcement mechanisms mentioned by the author.
Capability Assessment
Purpose & Capability
Name and description match the SKILL.md content: a security primer about autonomous shell execution. The skill declares no binaries, env vars, or installs, which is appropriate for an informational guide.
Instruction Scope
SKILL.md is advisory text describing attack categories and mitigations; it does not instruct the agent to run shell commands, read files, or exfiltrate data. Note: the file is truncated at the end — users should inspect the full content before trusting any implied tooling or validators referenced.
Install Mechanism
No install spec and no code files are present, so nothing is written to disk or executed at install time. This is the lowest-risk install profile for a skill.
Credentials
The skill requests no environment variables, credentials, or config paths. There are no disproportionate or unexplained secret requests.
Persistence & Privilege
always:false and no install scripts mean the skill does not request permanent system presence. Model invocation is allowed (platform default) but the SKILL.md does not ask the agent to take persistent actions.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install free-bash-safety-primer
  3. After installation, invoke the skill by name or use /free-bash-safety-primer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Remove Anthropic attribution language
v1.0.0
- Initial release of the OpenClaw Bash Safety Primer, version 1.0.0. - Explains the security risks of autonomous Bash execution by OpenClaw agents. - Details key attack categories: command obfuscation, substitution injection, encoding attacks, shell-specific escapes, and persistence/escalation vectors. - Analyzes the causes and impact of the ClawHavoc incident that compromised 341 skills. - Clarifies why regex validation alone is inadequate and outlines requirements for robust shell security.
Metadata
Slug free-bash-safety-primer
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Free Bash Safety Primer?

Understand the attack surface created when an OpenClaw agent executes shell commands autonomously. Covers obfuscation, injection, encoding attacks, and why C... It is an AI Agent Skill for Claude Code / OpenClaw, with 150 downloads so far.

How do I install Free Bash Safety Primer?

Run "/install free-bash-safety-primer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Free Bash Safety Primer free?

Yes, Free Bash Safety Primer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Free Bash Safety Primer support?

Free Bash Safety Primer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Free Bash Safety Primer?

It is built and maintained by ~K¹yle Million (@thebrierfox); the current version is v1.0.1.

💬 Comments