Back to skill

Security audit

Local Approvals

Security checks for vulnerabilities and agentic risk

Overview

This approval skill is not deceptive, but its approval boundary is weak enough that it should be reviewed carefully before use.

Use this only as a convenience workflow, not as a strong security boundary. Before installing, make sure requesting agents cannot invoke the approval CLI or edit its state files directly, avoid learning broad categories, and regularly inspect or reset auto-approved categories.

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
cli.py:37
Finding

Approval Authority Can Be Impersonated

Content
View full analysis
bool: """ Approve a pending request. Args: request_id: The ID of the request to approve reviewer: Who is approving (default: "user") auto_learn: Whether to add category to auto-approve list Returns: True if approved successfully, False if not found """ request = get_request(request_id) if request is None: print(f"❌ Error: Request '{request_id}' not found") return False if request["status"] != "pending": print(f"⚠️ Request '{request_id}' is not pending (status: {request['status']})") return False # Update the request updated = update_request(request_id, "approved", reviewer) if updated: print(f"✅ Approved request '{request_id}'") print(f" Agent: {updated['agent']}") print(f" Category: {updated['category']}") print(f" Operation: {updated['operation']}") ``` ```python approve_parser.add_argument("id", help="Request ID to approve") approve_parser.add_argument("--learn", action="store_true", help="Add the category to agent's auto-approve list") approve_parser.add_argument("--reviewer", default="user", help="Who is approving (default: user)") ``` ```python def update_request(request_id: str, decision: str, reviewer: str) -> Optional[Dict[str, Any]]: pending = _load_pending() if request_id not in pending["requests"]: return None request = pending["requests"][request_id] request["status"] = "decided" request["decision"] = decision request["reviewer"] = reviewer request["updated_at"] ...[truncated 1986 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
core.py:109
Finding

Unauthenticated Approval Can Permanently Expand Auto-Approval Policy

Content
View full analysis
bool: """ Add a category to an agent's auto-approve list. This enables learning from approved decisions - once a category is trusted for an agent, it gets auto-approved in the future. Args: agent: The agent identifier category: The category to add to auto-approve Returns: True if category was added, False if already present """ state = _load_state() # Initialize auto_approve dict if needed if "auto_approve" not in state: state["auto_approve"] = {} # Initialize agent's list if needed if agent not in state["auto_approve"]: state["auto_approve"][agent] = [] # Add category if not already present if category not in state["auto_approve"][agent]: state["auto_approve"][agent].append(category) _save_state(state) return True return False ``` ### Technical Analysis The unauthenticated approval operation accepts `--learn`, which permanently adds the request's agent and category to the auto-approval policy. The requester controls the `agent` and `category` values when calling `submit_request()`, and `learn_category()` does not validate either value against a trusted policy. No separate ...[truncated 1600 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
core.py:18
Finding

Authorization State Is Stored Without Atomicity or Integrity Protection

Content
View full analysis
None: """Ensure the state directory exists.""" STATE_DIR.mkdir(parents=True, exist_ok=True) ``` ```python def _save_state(state: Dict[str, Any]) -> None: """Save state to state.json.""" _ensure_state_dir() state["last_updated"] = datetime.now().isoformat() with open(STATE_FILE, 'w') as f: json.dump(state, f, indent=2) ``` ```python def _save_pending(pending: Dict[str, Any]) -> None: """Save pending requests to pending.json.""" _ensure_state_dir() pending["last_updated"] = datetime.now().isoformat() with open(PENDING_FILE, 'w') as f: json.dump(pending, f, indent=2) ``` ### Technical Analysis Approval decisions and auto-approval policies are security-sensitive authorization data, but the implementation stores them in predictable JSON files using ordinary truncating writes. The implementation does not: - Set explicit owner-only permissions on newly created directories and files. - Lock files during read-modify-write operations. - Write to a temporary file and atomically replace the prior version. - Validate that the destination is a regular file rather than a symbolic link. - Validate loaded data against a consistent schema. - Authenticate stored content with a signature or message authentication code. Concurrent approval operations can read the same old state and overwrite one another, causing lost updates. A crash during `json.dump()` can leave a truncated file and disable the approval workflow. Any process with write ...[truncated 1695 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (63)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill documentation describes capabilities that read and write local state files and exposes a CLI-based permission workflow, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This mismatch reduces transparency and can let a reviewer or runtime underestimate the skill's effective access, especially given the stated file and possible network capabilities detected by static analysis.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The skill is explicitly designed to support auto-approval of categories, which introduces autonomous authorization decisions. If a sensitive category is learned too broadly, future privileged actions may bypass human review and weaken the approval boundary.

Content

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

md
---
name: local-approvals
description: Local approval system for managing agent permissions. Use CLI to approve/deny requests, view history, and manage auto-approved categories.
---

# Local Approvals Skill

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The description confirms that the system maintains auto-approve lists as a core feature, meaning permission decisions can be delegated to persistent rules rather than per-request review. In a permissions-management skill, this increases the risk of overbroad trust and accidental privilege expansion over time.

Content

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

md
# Local Approvals Skill

A local approval system that manages agent permissions with auto-approve lists and approval history tracking.

## Quick Start

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The --learn option persists a granted category into an auto-approve list, turning a one-time approval into standing authorization. This is dangerous because a mistaken or manipulated approval can permanently reduce review requirements for later actions in the same category.

Content

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

text

**Options:**
- `--learn`: Add the category to the agent's auto-approve list
- `--reviewer`: Who is approving (default: "user")

**Example:**

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Persisting auto-approve lists in local state files creates durable autonomous approval behavior that may survive across sessions and reviewers. If those lists become overbroad or are modified improperly, sensitive operations could be silently approved in the future.

Content

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

md
The skill maintains two JSON files in the state directory:

- **state.json**: Auto-approve lists and approval history
- **pending.json**: Pending approval requests

Location: `~/.openclaw/skills/local-approvals/`

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The same section also documents categories being 'auto-approved,' reinforcing that the system intentionally bypasses interactive review under certain conditions. That behavior is security-relevant because category granularity may be too coarse to safely cover all future operations.

Content

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

md
The `core.py` module provides the underlying functionality:

- `check_auto_approve(agent, category)` - Check if a category is auto-approved
- `submit_request(agent, category, operation, reasoning)` - Submit a pending request
- `learn_category(agent, category)` - Add category to auto-approve list
- `get_request(request_id)` - Retrieve a request by ID

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The same section also documents categories being 'auto-approved,' reinforcing that the system intentionally bypasses interactive review under certain conditions. That behavior is security-relevant because category granularity may be too coarse to safely cover all future operations.

Content

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

md
The `core.py` module provides the underlying functionality:

- `check_auto_approve(agent, category)` - Check if a category is auto-approved
- `submit_request(agent, category, operation, reasoning)` - Submit a pending request
- `learn_category(agent, category)` - Add category to auto-approve list
- `get_request(request_id)` - Retrieve a request by ID

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

learn_category(agent, category) explicitly adds a category to the auto-approve list, creating persistent trust from a single decision. This can enable privilege creep if categories are broad, if requests are mislabeled, or if reviewers approve under incomplete context.

Content

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

md
- `check_auto_approve(agent, category)` - Check if a category is auto-approved
- `submit_request(agent, category, operation, reasoning)` - Submit a pending request
- `learn_category(agent, category)` - Add category to auto-approve list
- `get_request(request_id)` - Retrieve a request by ID
- `update_request(request_id, decision, reviewer)` - Update request with decision
- `list_pending(agent)` - List pending requests

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

When '--learn' is used, approving a single request automatically adds that category to the agent's auto-approve list for future requests. This can weaken human oversight and create persistent approval bypasses if categories are broad or attacker-influenced, especially in a local approval system where approvals directly gate agent permissions.

Content

Scanner excerpt · cli.py (reported line 74)May include surrounding context.

python
# Auto-learn the category if requested
        if auto_learn:
            learn_category(updated['agent'], updated['category'])
            print(f"   📚 Category '{updated['category']}' added to auto-approve for agent '{updated['agent']}'")
        
        return True

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 157)May include surrounding context.

python
history = state.get("history", [])
    
    if not history:
        print("✓ No approval history found")
        return
    
    # Show the most recent entries (up to limit)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 237)May include surrounding context.

python
else:
        agents_to_show = auto_approve
    
    print("\n📚 Auto-Approved Categories:")
    print("-" * 60)
    
    for agent_id, categories in agents_to_show.items():

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The CLI exposes a '--learn' option that persists approved categories into an auto-approve list, enabling future requests in that category to bypass manual review. In the context of a permission-management skill, this expands trust based on a single prior approval and can be abused if categories are coarse, spoofable, or not user-validated.

Content

Scanner excerpt · cli.py (reported line 277)May include surrounding context.

python
approve_parser = subparsers.add_parser("approve", help="Approve a pending request")
    approve_parser.add_argument("id", help="Request ID to approve")
    approve_parser.add_argument("--learn", action="store_true", 
                               help="Add the category to agent's auto-approve list")
    approve_parser.add_argument("--reviewer", default="user",
                               help="Who is approving (default: user)")

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 49)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 186)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 200)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 210)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 217)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · cli.py (reported line 226)May include surrounding context.

python
Local Approvals Core Module

Core functions for managing local agent approval workflows.
Handles auto-approve lists, pending requests, and learning from decisions.
"""

import json

Static analysis

No suspicious patterns detected.