Back to skill

Security audit

Agent Ops Kit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed monitoring and alerting toolkit, but its automatic recovery feature can run broad shell commands on a schedule and needs careful review before installation.

Install only if you are comfortable with a recurring local monitor that writes under ~/.agent-ops, sends operational details to Telegram, and may restart services automatically. Before using auto-recovery, restrict who can edit the config, avoid broad sudo, replace free-form restart commands with allowlisted commands, and protect Telegram tokens with restrictive file permissions or a credential store.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/health-check.sh:243
Finding

Arbitrary Command Execution Through Configuration-Driven Shell Evaluation

Content
View full analysis
/dev/null 2>&1; then record_metric "$name" "up" "0" $QUIET || echo "[OK] $name — process running" log "CHECK OK: $name — running" return 0 else record_metric "$name" "down" "0" echo "[FAIL] $name — process not running" log "CHECK FAIL: $name — not running" # Auto-restart if configured if [ -n "$restart_cmd" ]; then log "RESTART: Attempting $name via: $restart_cmd" if eval "$restart_cmd" 2>/dev/null; then sleep 3 if pgrep -f "$process_name" > /dev/null 2>&1; then record_metric "$name" "recovered" "0" echo "[RECOVERED] $name — restarted successfully" log "RESTART OK: $name recovered" return 0 fi fi log "RESTART FAIL: $name did not recover" fi return 1 fi } ``` ```bash # Read config and run checks via Python (handles JSON parsing) eval "$(python3 -c " import json config = json.load(open('$CONFIG')) for svc in config.get('services', []): name = svc['name'].replace(\"'\", \"\") stype = svc.get('type', 'url') if stype == 'url': target = svc['target'] expected = svc.get('expected_status', 200) timeout = svc.get('timeout_seconds', 10) print(f\"check_url '{name}' '{target}' '{expected}' '{timeout}'\") elif stype == 'port': host = svc.get('host', '127.0.0.1') port = svc['port'] timeout = svc.get('timeout_seconds', 3) print(f\"check_port '{name}' '{host}' '{port}' '{timeout}'\") elif stype == 'process': proc = svc['process_name'] restart = svc.get('restart_command', '') print(f\"ch ...[truncated 3711 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/health-check.sh:65
Finding

Telegram Bot Credentials Stored and Used Without Enforced Local Protection

Content
View full analysis
~/.agent-ops/config/services.json << 'CONF' { "services": [ { "name": "My Web App", "type": "url", "target": "https://example.com", "expected_status": 200, "timeout_seconds": 10 }, { "name": "API Server", "type": "url", "target": "https://api.example.com/health", "expected_status": 200, "timeout_seconds": 5 }, { "name": "Local Dev Server", "type": "port", "host": "127.0.0.1", "port": 3000 }, { "name": "Background Worker", "type": "process", "process_name": "celery", "restart_command": "systemctl restart celery" } ], "alerting": { "telegram_bot_token": "YOUR_BOT_TOKEN", "telegram_chat_id": "YOUR_CHAT_ID", "rate_limit_seconds": 300, "alert_on_recovery": true }, "check_interval_seconds": 300, "disk_warning_gb": 5, "stalled_task_hours": 24, "metrics_retention_days": 90 } CONF ``` The executable reads the plaintext values and includes the token in the request URL: ```bash # Read bot token and chat ID from config local bot_token chat_id bot_token=$(python3 -c "import json; c=json.load(open('$CONFIG')); print(c['alerting']['telegram_bot_token'])" 2>/dev/null || echo "") chat_id=$(python3 -c "import json; c=json.load(open('$CONFIG')); print(c['alerting']['telegram_chat_id'])" 2>/dev/null || echo "") if [ -z "$bot_token" ] || [ -z "$chat_id" ]; then log "ALERT: No Telegram credentials configured — skipping alert" return fi # Rate limiting: check if we sent within last 5 minutes local rate_file="$STATE_DIR/alert-rate-shell.json" local now_epoch now ...[truncated 3375 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The stated purpose emphasizes monitoring and alerting, but the skill also performs local process inspection, persistent logging/state management, and automatic execution of administrator-supplied restart commands. This mismatch increases the chance that operators deploy a skill with stronger capabilities than expected, especially because auto-recovery can modify running services.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

bash
# Replace YOUR_BOT_TOKEN with your actual token
curl -s "https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('result', []):

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The recovery engine executes restart_command with shell=True, allowing arbitrary shell execution from configuration data. If an attacker can influence the config, service definitions, or any upstream source that populates restart_command, they can run arbitrary commands, potentially with elevated privileges if sudo-based examples are followed.

Content

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

md
# Attempt restart
    log(f"RESTART: {service_name} — attempt {svc_state['attempts'] + 1}/{max_attempts}")
    try:
        result = subprocess.run(
            restart_command, shell=True,
            capture_output=True, text=True, timeout=30,
            env={**os.environ, "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin"}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · SKILL.md (reported line 1605)May include surrounding context.

lsof ~/.agent-ops/state/board.lock

If no process holds it, remove the stale lock

rm ~/.agent-ops/state/board.lock

text

### Metrics disk usage

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill provides code that writes files, creates persistent state, and invokes shell commands, but the manifest declares no tool scope or permissions. This creates a dangerous transparency gap: users or platforms may approve the skill without understanding that it can modify the local system and execute commands.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest omits the task board/work-tracking subsystem even though the file includes persistent board storage, task creation, task movement, and stalled-task scanning. Hidden or undocumented capability expansion is risky because it broadens data handling and persistent state beyond the advertised monitoring role.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill description does not clearly disclose that it transmits operational status and alerts to external endpoints such as monitored URLs and the Telegram API. This matters because service names, failure details, and environment metadata may leave the host without explicit privacy acknowledgement.

Content

No source excerpt is available for this finding.

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 39)May include surrounding context.

1. Create the directory structure

bash
mkdir -p ~/.agent-ops/{config,logs,metrics,scripts,state}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description of auto-recovery does not prominently warn that the system can execute restart commands and modify running services automatically. In operational contexts, this omission can cause unsafe deployment of a skill that performs active remediation rather than passive monitoring.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill instructs users to install a recurring cron job, creating ongoing autonomous execution. Persistence is expected for monitoring, but it is still security-relevant because it causes the skill to continue performing checks, writing state, and possibly executing recovery commands without further user interaction.

Content

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

bash
# crontab: run every 5 minutes
(crontab -l 2>/dev/null; echo "*/5 * * * * ~/.agent-ops/scripts/health-check.sh >> ~/.agent-ops/logs/cron.log 2>&1") | crontab -

# Or on macOS, create a launchd plist (see Orchestrator Loop section)

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 · SKILL.md (reported line 112)May include surrounding context.

crontab: run every 5 minutes

(crontab -l 2>/dev/null; echo "*/5 * * * * ~/.agent-ops/scripts/health-check.sh >> ~/.agent-ops/logs/cron.log 2>&1") | crontab -

Or on macOS, create a launchd plist (see Orchestrator Loop section)

text

---

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 · SKILL.md (reported line 1322)May include surrounding context.

crontab: run every 5 minutes

(crontab -l 2>/dev/null; echo "*/5 * * * * ~/.agent-ops/scripts/health-check.sh >> ~/.agent-ops/logs/cron.log 2>&1") | crontab -

Or on macOS, create a launchd plist (see Orchestrator Loop section)

text

---

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 · SKILL.md (reported line 1323)May include surrounding context.

crontab: run every 5 minutes

(crontab -l 2>/dev/null; echo "*/5 * * * * ~/.agent-ops/scripts/health-check.sh >> ~/.agent-ops/logs/cron.log 2>&1") | crontab -

Or on macOS, create a launchd plist (see Orchestrator Loop section)

text

---

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 · SKILL.md (reported line 1347)May include surrounding context.

crontab: run every 5 minutes

(crontab -l 2>/dev/null; echo "*/5 * * * * ~/.agent-ops/scripts/health-check.sh >> ~/.agent-ops/logs/cron.log 2>&1") | crontab -

Or on macOS, create a launchd plist (see Orchestrator Loop section)

text

---

Session Persistence

Medium
Category
Rogue Agent
Confidence
55% 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 605)May include surrounding context.

md
def check_and_alert(checker):
    """Run checks, alert on failures, and optionally alert on recovery."""
    # Load previous state for recovery detection
    state_file = os.path.expanduser("~/.agent-ops/state/last-status.json")
    prev_status = {}
    if os.path.exists(state_file):

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
87% confidence
Finding

The documentation explicitly encourages restart commands that use sudo, meaning the skill may trigger privileged service management actions if operators adopt the example. Combined with configurable command execution elsewhere in the skill, this materially raises the impact of misuse or config tampering.

Content

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

md
"name": "Web Server",
  "type": "process",
  "process_name": "nginx",
  "restart_command": "sudo systemctl restart nginx",
  "restart_cooldown_seconds": 300,
  "max_restart_attempts": 3
}

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

bash
restart_systemd_service() {
  local service_name="$1"
  sudo systemctl restart "$service_name"
  sleep 2
  if systemctl is-active --quiet "$service_name"; then
    return 0

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

bash
restart_systemd_service() {
  local service_name="$1"
  sudo systemctl restart "$service_name"
  sleep 2
  if systemctl is-active --quiet "$service_name"; then
    return 0

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

bash
restart_systemd_service() {
  local service_name="$1"
  sudo systemctl restart "$service_name"
  sleep 2
  if systemctl is-active --quiet "$service_name"; then
    return 0

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The general task board subsystem is not necessary for basic service monitoring and alerting, yet it introduces additional persistence, locking logic, and operational data storage. While not inherently malicious, this capability broadens the attack surface and creates a stealthier data-retention function than users may expect from a monitoring skill.

Content

No source excerpt is available for this finding.

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 868)May include surrounding context.

Board I/O Module (Atomic, Locked)

This is critical for production use. Never read/write the board file directly; always go through this module to prevent data corruption.

python
#!/usr/bin/env python3

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 947)May include surrounding context.

md
return {"columns": list(DEFAULT_COLUMNS), "tasks": []}

def board_write(data):
    """Write board.json atomically under lock."""
    _ensure_dir()
    with _file_lock():
        # Backup current

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The launchd plist instructions create a persistent agent that runs automatically on an interval and at load. Given this skill can send network traffic and execute recovery actions, installing a LaunchAgent materially increases the operational risk if users are not clearly warned.

Content

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

macOS launchd Setup

Create ~/Library/LaunchAgents/com.agent-ops.orchestrator.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The launchd plist instructions create a persistent agent that runs automatically on an interval and at load. Given this skill can send network traffic and execute recovery actions, installing a LaunchAgent materially increases the operational risk if users are not clearly warned.

Content

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

macOS launchd Setup

Create ~/Library/LaunchAgents/com.agent-ops.orchestrator.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>

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 · SKILL.md (reported line 1322)May include surrounding context.

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>

Static analysis

No suspicious patterns detected.