Back to skill

Security audit

claw-mechanic

Security checks for vulnerabilities and agentic risk

Overview

This skill is an OpenClaw troubleshooting guide with broad admin repair instructions, but its sensitive actions are disclosed, scoped, and tied to user-directed host maintenance.

Install only if you want an agent to help administer an OpenClaw host. Expect it to run diagnostics and, with your direction, potentially change config, plugins, cron jobs, service state, or model routes. Review proposed repairs before approving changes on production systems, and keep the artifact's own guidance on backups, narrow scope, and not exposing secrets in force.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (13)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 10)May include surrounding context.

md
t-specific detail. For subsystem-specific signatures and command details, read [references/failure-map.md](references/failure-map.md) only when the symptom touc

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/failure-map.md (reported line 11)May include surrounding context.

md
# Claw Mechanic Failure Map

Use this reference when the quick workflow points at a specific subsystem. Keep output evidence short and exact.

## Docs To Check

- CLI overview: `https://docs.openclaw.ai/cli`
- Doctor: `https://docs.openclaw.ai/doctor`
- Plugins: `https://docs.openclaw.ai/cli/plugins`
- Cron: `https://docs.openclaw.ai/cli/cron`
- Models: `https://docs.openclaw.ai/cli/models`
- Secrets: `https://docs.openclaw.ai/cli/secrets`
- Exec approvals: `https://docs.openclaw.ai/tools/exec-approvals`
- Gateway APIs/config: `https://docs.openclaw.ai/gateway/configuration`
- Channel behavior: check the relevant OpenClaw channel docs under `https://docs.openclaw.ai/channels/`

Docs source order:
- Record `openclaw --version` first so version drift is visible.
- Prefer installed package docs when exact installed behavior matters; use current `https://docs.openclaw.ai` for live docs and generated/API pages.
- If using a downloaded `llm

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/failure-map.md (reported line 143)May include surrounding context.

md
Fix pattern:
- Relaunch loop from a submitted job: let the current run finish (watch its log for its completion line), then `launchctl remove <label>` immediately so launchd cannot relaunch it. Killing a doctor mid-maintenance is a last resort.
- Never use `launchctl submit` for one-shot work.
- To run a CLI command that needs keychain-backed SecretRefs from SSH, run it as a one-shot LaunchAgent in the user's GUI domain, where the keychain is unlocked: a plist with `RunAtLoad=true`, `KeepAlive=false`, `LaunchOnlyOnce=true`, and `StandardOutPath` set to a log; `launchctl bootstrap gui/$(id -u) <plist>`; poll for an exit marker in the log with a deadline (never an unbounded wait); then `launchctl bootout` and delete the plist, even on timeout, and confirm `launchctl list` no longer shows the label. OpenClaw resolves its own secret and the value never passes through the operator. Never extract keychain items or export tokens into env to work around the boundary.
- Prefer that route over handing commands back to the user when the user asked you to do the work; tell them afterwards what ran and that the job was removed.
- `plugins update` on recent builds applies live ("Applied plugin updates in Gateway generation N"); restart only if the output or doctor says it is required.
- A local-mode Mac app cannot resolve exec/keychain SecretRefs and connects without a token. Fix by entering the gateway token in the app's own connection settings (the user does this) or by changing the secret provider; both are the user's decision.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
90% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · references/failure-map.md (reported line 255)May include surrounding context.

md
Fix pattern:
- Verify all agents, not just `main`.
- Confirm provider, model, vector dimensions, semantic availability, and FTS.
- For context-engine plugins, ensure summary/expansion models are allowed by plugin `llm`/`subagent` override policy.
- If generated low-value sessions are noisy, use the plugin's documented ignore/stateless session patterns when supported, and keep productive channel sessions enabled.
- If plugin-owned state is already polluted, back up the plugin database/state first, prefer archiving or retiring generated active rows over deleting raw history, then restart and verify no new warnings.
- `openclaw sessions cleanup` repairs OpenClaw session stores/transcripts; do not assume it cleans plugin-owned context databases.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/root-failure-taxonomy.md (reported line 199)May include surrounding context.

md
Mechanic move: keep noncritical broken backends out of active routes until fixed. Do not churn OpenClaw config when the upstream is the proven fault.

## 13. Self-Update And Restart Hazard

Root failure: an agent updated the host or plugins while depending on the gateway it was changing, leaving installed package state and running service state out of sync.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/root-failure-taxonomy.md (reported line 233)May include surrounding context.

md
- If access, service ownership, or lifecycle is unproven, fix that first.
- If one layer is green but user-visible behavior is bad, test runtime, cron, tasks, channels, and models separately.
- If cost is the symptom, prioritize cron payload models, fallbacks, context load, reviewer model, and retry/timeout loops.
- If the host just updated, prioritize plugin cohort, migration drift, service lifecycle, and self-update hazards before model rewrites.
- If local model APIs are involved, prove the exact OpenClaw runtime path, not only a generic HTTP request.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

md
- Before docs-sensitive config changes, record `openclaw --version`; prefer installed package docs when you need exact-version behavior, then current official docs at `https://docs.openclaw.ai`. Use docs for command semantics, plugin behavior, cron model/fallback behavior, approvals, secrets, and gateway APIs.
- Do not trust one green command. Pair static checks with live proof: gateway health, plugin doctor, task/cron state, model smoke, channel status, or direct endpoint probes as appropriate.
- Back up config/state before edits. Prefer `openclaw config set`, Gateway `config.patch`, or other supported CLI/Gateway RPC paths over direct file/database edits. Use direct DB/file edits only when the live API has no path, and verify by re-reading through OpenClaw afterward.
- Keep repairs small. Do not update OpenClaw, reinstall plugins, restart gateways, or rewrite model routes unless the evidence points there or the user approved that class of change.
- Separate confirmed findings from stale/historical warnings and from audit-tool false positives.
- Do not read raw secrets, env files, session bodies, or agent workspace contents unless the user approves that exact inspection. Prefer audits, redacted probes, metadata, and config paths over secret values.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/failure-map.md (reported line 63)May include surrounding context.

md
- Service-manager restart counts and recent stdout/stderr logs.

Fix pattern:
- Do not batch-rewrite `openclaw.json`. Use `openclaw config set` for single keys or Gateway `config.patch` with a fresh `baseHash` for structured edits.
- Back up the exact config source file first. If `$include` files are involved, edit the source include file, not a flattened copy.
- JSON5 syntax, env references, and `$include` layout can be valid config features; validate before removing them.
- Most channels, agents, models, cron, tools, bindings, session, messages, and logging changes hot-apply. `gateway.*`, `discovery`, and `plugins` usually need restart or hybrid restart handling; verify against current docs before restarting.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The document recommends npx openclaw@latest update, which executes whatever package version is current at runtime rather than a reviewed, pinned release. In an agent skill that guides operational repair on production hosts, this creates supply-chain and reproducibility risk because behavior can change unexpectedly or a compromised upstream package could be run during incident response.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · references/failure-map.md (reported line 133)May include surrounding context.

md
- Gateway is ready, then receives SIGTERM seconds later, on a fixed cycle; CLI says state is `undergoing offline maintenance`; a `doctor --fix` or other `openclaw` process has PPID 1.
- CLI over SSH fails with `... is configured as a secret reference but is unavailable in this command path` while the gateway is healthy; `security` reports `User interaction is not allowed`.
- `launchctl asuser` fails with `Could not switch to audit session ... Operation not permitted`.
- A macOS OpenClaw app in local mode is rejected by its gateway: `[ws] unauthorized ... auth=none reason=token_missing`.

Look:
- `launchctl list | grep -v com.apple` — labels of agent-created jobs often do not contain "openclaw".

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/failure-map.md (reported line 136)May include surrounding context.

md
- A macOS OpenClaw app in local mode is rejected by its gateway: `[ws] unauthorized ... auth=none reason=token_missing`.

Look:
- `launchctl list | grep -v com.apple` — labels of agent-created jobs often do not contain "openclaw".
- `launchctl print gui/$(id -u)/<label>`: `type = Submitted` plus a high `runs = N` is a `launchctl submit` job; submitted jobs are implicitly KeepAlive and relaunch on every exit.
- `openclaw config get gateway.auth.token --json` (shows `source`/`provider` only) to see whether secrets come from an exec/keychain provider.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/failure-map.md (reported line 143)May include surrounding context.

md
Fix pattern:
- Relaunch loop from a submitted job: let the current run finish (watch its log for its completion line), then `launchctl remove <label>` immediately so launchd cannot relaunch it. Killing a doctor mid-maintenance is a last resort.
- Never use `launchctl submit` for one-shot work.
- To run a CLI command that needs keychain-backed SecretRefs from SSH, run it as a one-shot LaunchAgent in the user's GUI domain, where the keychain is unlocked: a plist with `RunAtLoad=true`, `KeepAlive=false`, `LaunchOnlyOnce=true`, and `StandardOutPath` set to a log; `launchctl bootstrap gui/$(id -u) <plist>`; poll for an exit marker in the log with a deadline (never an unbounded wait); then `launchctl bootout` and delete the plist, even on timeout, and confirm `launchctl list` no longer shows the label. OpenClaw resolves its own secret and the value never passes through the operator. Never extract keychain items or export tokens into env to work around the boundary.
- Prefer that route over handing commands back to the user when the user asked you to do the work; tell them afterwards what ran and that the job was removed.
- `plugins update` on recent builds applies live ("Applied plugin updates in Gateway generation N"); restart only if the output or doctor says it is required.
- A local-mode Mac app cannot resolve exec/keychain SecretRefs and connects without a token. Fix by entering the gateway token in the app's own connection settings (the user does this) or by changing the secret provider; both are the user's decision.