Back to skill

Security audit

Gateway Health Monitor

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Mac troubleshooting skill for OpenClaw gateway reliability, but it includes optional persistent launchd changes and one system-wide power setting command that users should understand before running.

Install this only if you intentionally manage an OpenClaw gateway on macOS. Review the patcher scripts before running them, because the installer creates a persistent LaunchAgent that keeps modifying the gateway plist. Avoid the sudo Power Nap command unless you accept a machine-wide power-management change, and make your own rollback plan for unloading the patcher and restoring the plist defaults.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill clearly instructs users to run multiple shell commands and scripts, but no permissions are declared to signal that capability or constrain its use. This is dangerous because reviewers and users may underestimate the skill's operational reach, especially where it modifies launchd configuration, reloads agents, or invokes privileged system commands.

Vague Triggers

Medium
Confidence
88% confidence
Finding
Several trigger phrases are broad, such as "disconnected" and "gateway down," and may match ordinary troubleshooting conversation outside the intended context. Over-broad activation is risky because it can cause the skill to surface operational instructions, including shell commands and persistent system changes, when the user did not explicitly request this workflow.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The markdown recommends `sudo pmset -a powernap 0`, which changes system-wide macOS power management behavior, but it does not warn about battery, sleep, or fleet-policy implications. Users may apply a persistent host-level change to solve an app issue without understanding the broader operational side effects.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script writes a user LaunchAgent plist into ~/Library/LaunchAgents and immediately loads it with launchctl, creating persistence in the user's session without any confirmation, consent gate, or uninstall guidance. Even if intended for reliability, silently installing a WatchPaths+RunAtLoad agent can be abused to keep code running automatically whenever the watched plist changes or the user logs in.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Check**: `pmset -g | grep powernap`

**Fix**: `sudo pmset -a powernap 0`

## Plist Auto-Patcher
Confidence
97% confidence
Finding
The skill instructs the user to run a command with `sudo`, elevating privileges to change global power settings. Privileged commands materially increase risk because mistakes, abuse, or confused activation can alter host behavior beyond the application and may violate least-privilege expectations.

Session Persistence

Medium
Category
Rogue Agent
Content
**Cause**: After many restarts (10+/day), macOS marks the job as low-priority and delays restarts via App Nap / Power Nap logic.

**Fix**: Add these keys to the launchd plist (`~/Library/LaunchAgents/ai.openclaw.gateway.plist`):

```xml
<key>ProcessType</key>
Confidence
80% confidence
Finding
The proposed launchd plist changes alter persistent service behavior on macOS and will remain in effect until manually reverted or overwritten. Even though intended to improve uptime, changing launch semantics is security-relevant because it normalizes persistent autostart modification through a troubleshooting skill.

Session Persistence

Medium
Category
Rogue Agent
Content
**Cause**: After many restarts (10+/day), macOS marks the job as low-priority and delays restarts via App Nap / Power Nap logic.

**Fix**: Add these keys to the launchd plist (`~/Library/LaunchAgents/ai.openclaw.gateway.plist`):

```xml
<key>ProcessType</key>
Confidence
80% confidence
Finding
The proposed launchd plist changes alter persistent service behavior on macOS and will remain in effect until manually reverted or overwritten. Even though intended to improve uptime, changing launch semantics is security-relevant because it normalizes persistent autostart modification through a troubleshooting skill.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
launchctl bootout gui/$(id -u)/ai.openclaw.gateway
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
```

**Note**: `openclaw gateway start` overwrites the plist. Use the patcher script (below) to auto-reapply.
Confidence
76% confidence
Finding
Reloading a launch agent from a user LaunchAgents plist activates persistent configuration changes immediately and reinforces session-to-session service persistence. In context this is not malware-like, but it does operationalize a persistent autostart modification and should be treated as security-sensitive guidance.

Session Persistence

Medium
Category
Rogue Agent
Content
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
```

**Note**: `openclaw gateway start` overwrites the plist. Use the patcher script (below) to auto-reapply.

### 3. Hung Shutdown
Confidence
78% confidence
Finding
The note that the gateway start command overwrites the plist, followed by advice to auto-reapply changes, signals an intent to maintain persistent launchd modifications over time. That is not necessarily malicious, but automating reapplication makes the persistence stronger and less visible to users.

Session Persistence

Medium
Category
Rogue Agent
Content
**Symptoms**: Gateway receives SIGTERM but doesn't exit. launchd can't restart because old PID still alive.

**Fix**: Set `ExitTimeOut` in the plist:

```xml
<key>ExitTimeOut</key>
Confidence
72% confidence
Finding
Adding `ExitTimeOut` to a launchd plist is a persistent service-management change. The impact is lower than autorun creation because it tunes shutdown behavior rather than introducing a new startup item, but it still modifies durable host configuration.

Session Persistence

Medium
Category
Rogue Agent
Content
**Fix**: `sudo pmset -a powernap 0`

## Plist Auto-Patcher

Since `openclaw gateway start` overwrites the plist, use `scripts/patch-plist.sh` as a launchd WatchPaths agent:
Confidence
86% confidence
Finding
The 'Plist Auto-Patcher' section introduces a launchd WatchPaths agent that continuously monitors and re-applies modifications to the gateway plist. That is a textbook persistence mechanism: it installs an agent that survives across sessions and automatically restores changes, which is dangerous even if framed as maintenance.

Session Persistence

Medium
Category
Rogue Agent
Content
## Plist Auto-Patcher

Since `openclaw gateway start` overwrites the plist, use `scripts/patch-plist.sh` as a launchd WatchPaths agent:

```bash
# Install the patcher
Confidence
90% confidence
Finding
This duplicated finding describes the same WatchPaths-based auto-patcher, which creates durable, automated persistence in the user's launchd environment. The danger is amplified by the skill context because the documented purpose is to re-add settings after overwrite, normalizing indefinite persistence of system behavior changes.

Session Persistence

Medium
Category
Rogue Agent
Content
## Plist Auto-Patcher

Since `openclaw gateway start` overwrites the plist, use `scripts/patch-plist.sh` as a launchd WatchPaths agent:

```bash
# Install the patcher
Confidence
90% confidence
Finding
This duplicated finding describes the same WatchPaths-based auto-patcher, which creates durable, automated persistence in the user's launchd environment. The danger is amplified by the skill context because the documented purpose is to re-add settings after overwrite, normalizing indefinite persistence of system behavior changes.

Session Persistence

Medium
Category
Rogue Agent
Content
bash scripts/install-patcher.sh
```

This creates a launchd agent that watches the gateway plist and re-adds `ExitTimeOut`, `ProcessType`, and `LowPriorityBackgroundIO` within seconds of any overwrite.

## Monitoring
Confidence
91% confidence
Finding
The documentation states that the installed launchd agent watches the gateway plist and re-adds keys within seconds of overwrite, confirming continuous enforcement of persistent system changes. This moves beyond documentation of persistence into active establishment of a resident monitoring-and-repair mechanism.

Session Persistence

Medium
Category
Rogue Agent
Content
}
```

Plus plist keys: `ExitTimeOut=10`, `ProcessType=Interactive`, `LowPriorityBackgroundIO=false`, `ThrottleInterval=1`, `KeepAlive=true`.

## Troubleshooting Reference
Confidence
74% confidence
Finding
The recommended configuration explicitly includes persistent plist keys such as `ThrottleInterval` and `KeepAlive`, which shape autostart and relaunch behavior across sessions. In a security review, recommending durable service persistence settings without caveats is risky because it conditions users to accept persistent host modifications as routine.

Static analysis

No suspicious patterns detected.