Back to skill

Security audit

Resilient Claude Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill transparently runs unattended Claude Code sessions with permission checks disabled, which fits its purpose but gives a background agent broad host-level authority.

Install only in a disposable container, VM, or dedicated low-privilege account with only the intended project mounted. Do not use it on a host that exposes SSH keys, cloud credentials, browser profiles, production databases, unrelated repositories, or privileged local services. Expect background tmux/nohup activity, local logs that may contain sensitive output, automatic retries, and Claude Code usage under the selected account/model.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/wrapper.sh:41
Finding

Unattended Claude execution bypasses permission controls without sandbox enforcement

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/monitor.sh:159
Finding

Hang recovery can launch concurrent unrestricted agents in the same workspace

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/wrapper.sh:89
Finding

Unvalidated PID files can target unrelated processes or produce false liveness results

Content
View full analysis
/dev/null || true)" if [ -z "$MONITOR_PID" ]; then _signal_outcome="monitor_pid_empty" elif ! kill -0 "$MONITOR_PID" 2>/dev/null; then _signal_outcome="monitor_not_live:$MONITOR_PID" elif kill -TERM "$MONITOR_PID" 2>/dev/null; then _signal_outcome="signaled:$MONITOR_PID" else _signal_outcome="kill_failed:$MONITOR_PID" fi else _signal_outcome="monitor_pid_missing" fi ``` The monitor similarly trusts the contents of the task PID file: ```bash PID="$(cat "$TASK_TMPDIR/pid")" # --- Layer 1: Done-file (task completed) --- if [ -f "$TASK_TMPDIR/done" ]; then EXIT_CODE="$(cat "$TASK_TMPDIR/exit_code" 2>/dev/null || echo "unknown")" echo "Task completed with exit code: $EXIT_CODE" exit 0 # EXIT trap fires but guard prevents abandoned update fi # --- Layer 2: PID liveness (process crashed) --- if ! kill -0 "$PID" 2>/dev/null; then # Grace window: wrapper may still be writing completion markers ``` ### Technical Analysis A PID identifies a process only at a point in time and can be reused after that process exits. The implementation stores bare PID values without recording or validating an associated process start time, executable, parent process, process group, or ownership relationship. The wrapper checks whether the PID from `monitor.pid` is live and then sends `SIGTERM`, but it does not confirm that the live process is the monitor created for this task. If the PID file is stale or modified and the PID has been reused, an unrelated process owned by the ...[truncated 1948 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (26)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Session names are sanitized (`monitor.sh` rejects anything outside `[A-Za-z0-9._-]`) before being passed to tmux, preventing injection through the session-nam

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Session names are sanitized (`monitor.sh` rejects anything outside `[A-Za-z0-9._-]`) before being passed to tmux, preventing injection through the session-nam

Prompt Exfiltration via Tool

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains patterns that exfiltrate system prompts or internal instructions via tool calls (file writes, network requests, logging).

Content

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

md
# Step 1: Create secure temp directory
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"

# Step 2: Write prompt to file (use orchestrator's write tool, not echo/shell)
# File: $TMPDIR/prompt

# Step 3: Create initial manifest

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/local-smoke-test.sh (reported line 28)May include surrounding context.

sh
_cleanup() {
  tmux kill-session -t "$SESSION" 2>/dev/null || true
  [ -n "${MONITOR_PID:-}" ] && kill -9 "$MONITOR_PID" 2>/dev/null || true
  [ -n "${MOCK_BIN:-}" ] && rm -rf "$MOCK_BIN" 2>/dev/null || true
  [ -n "${PROJECT_DIR:-}" ] && rm -rf "$PROJECT_DIR" 2>/dev/null || true
  # Leave TASK_TMPDIR on failure so the user can inspect it
  if [ $FAIL -eq 0 ] && [ -n "${TASK_TMPDIR:-}" ]; then

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/local-smoke-test.sh (reported line 29)May include surrounding context.

sh
_cleanup() {
  tmux kill-session -t "$SESSION" 2>/dev/null || true
  [ -n "${MONITOR_PID:-}" ] && kill -9 "$MONITOR_PID" 2>/dev/null || true
  [ -n "${MOCK_BIN:-}" ] && rm -rf "$MOCK_BIN" 2>/dev/null || true
  [ -n "${PROJECT_DIR:-}" ] && rm -rf "$PROJECT_DIR" 2>/dev/null || true
  # Leave TASK_TMPDIR on failure so the user can inspect it
  if [ $FAIL -eq 0 ] && [ -n "${TASK_TMPDIR:-}" ]; then

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/monitor.sh (reported line 164)May include surrounding context.

sh
# Signal wrapper to use resume mode + clear stale PID
  touch "$TASK_TMPDIR/resume"
  rm -f "$TASK_TMPDIR/pid"

  # Dispatch wrapper (resolves mode from resume file). Use printf %q to
  # shell-quote WRAPPER_PATH so paths containing spaces or shell metacharacters

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/monitor.sh (reported line 194)May include surrounding context.

sh
fi
  tmux pipe-pane -t "$SESSION" 2>/dev/null || true
  tmux kill-session -t "$SESSION" 2>/dev/null || true
  rm -f "$TASK_TMPDIR/monitor.pid" 2>/dev/null || true
  _log "cleanup done"
}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/wrapper.sh (reported line 51)May include surrounding context.

sh
if [ -f "$TASK_TMPDIR/resume" ]; then
  # Resume mode: monitor signaled a resume
  rm -f "$TASK_TMPDIR/resume"
  claude --dangerously-skip-permissions -c --model "$MODEL" &
else
  # First run: launch with prompt via stdin (avoids exposing prompt in process args)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · scripts/wrapper.sh (reported line 55)May include surrounding context.

sh
claude --dangerously-skip-permissions -c --model "$MODEL" &
else
  # First run: launch with prompt via stdin (avoids exposing prompt in process args)
  claude --dangerously-skip-permissions -p --model "$MODEL" - < "$TASK_TMPDIR/prompt" &
fi

# --- Lifecycle management (same for both modes) ---

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill exposes substantial shell-execution capability through tmux, bash, and Claude Code, but does not declare an explicit tool scope such as permissions or allowed-tools in the skill metadata. That omission weakens policy enforcement and makes it easier for an orchestrator or reviewer to underestimate that this skill can execute arbitrary commands and modify project files autonomously.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The skill is explicitly designed to run Claude Code with --dangerously-skip-permissions, allowing autonomous read/write/execute actions in the project directory without interactive approval. In a fire-and-forget tmux workflow, this creates a strong pathway for unintended or malicious prompt-driven actions to execute with no human checkpoint.

Content

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

md
**What this skill can do at runtime:**

- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).

**What this skill does NOT do:**

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).

**What this skill does NOT do:**

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/local-smoke-test.sh (reported line 69)May include surrounding context.

sh
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).

**What this skill does NOT do:**

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"

Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"

Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"

Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
**Prompt safety:** Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's `write` tool (no shell involved). The wrapper reads the prompt via stdin redirection (`claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"`), so the prompt content never appears in process arguments (invisible to `ps`/`top`) and is not subject to shell interpolation. This depends on the orchestrator's `write` tool not invoking a shell; OpenClaw's built-in `write` tool meets this requirement.

**Sensitive output:** tmux scrollback and log files may contain secrets or API keys from agent output. On shared machines, restrict file permissions (`chmod 600`) and clean up temp directories after task completion.

## When to Use This

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill intentionally launches a detached nohup monitor so it survives the parent shell and can continue managing long-running sessions. Persistence is core to the feature, but it also means code-execution and recovery logic remains active outside normal interactive oversight, increasing the blast radius if the task or monitor is misused or compromised.

Content

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

Use the active monitor script for every task. The monitor runs continuously with configurable intervals and handles its own timing -- no cron or external scheduler needed.

bash
nohup bash <skill-dir>/scripts/monitor.sh claude-<task-name> "$TMPDIR" \
  >"$TMPDIR/monitor.log" 2>&1 &

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

Marking detached monitoring as mandatory reinforces persistent unattended execution as part of the standard workflow. In context with --dangerously-skip-permissions, this persistence increases the chance that harmful actions continue after the initiating session ends and reduces opportunities for human interruption.

Content

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

md
6. Launch Claude Code with wrapper (PID capture + manifest updates + done-file protocol)
7. Verify pipe-pane is capturing output (`ls -la $TMPDIR/output.log`)
8. Notify user: task content, session name (`claude-<task-name>`), model used
9. Launch monitor: `nohup bash <skill-dir>/scripts/monitor.sh claude-<task-name> "$TMPDIR" >"$TMPDIR/monitor.log" 2>&1 &` (mandatory for every task; `nohup` ensures the monitor survives parent shell exit)

## Limitations

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/local-smoke-test.sh (reported line 106)May include surrounding context.

sh
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"

# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/local-smoke-test.sh (reported line 178)May include surrounding context.

sh
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"

# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/monitor.sh (reported line 27)May include surrounding context.

sh
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"

# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/monitor.sh (reported line 32)May include surrounding context.

sh
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"

# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/monitor.sh (reported line 223)May include surrounding context.

sh
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"

# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on