Back to skill

Security audit

Smart Compact

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned, but it saves broad conversation and tool-output details to persistent memory without strong safeguards against storing secrets.

Install only if you are comfortable with the agent scanning the active conversation and tool outputs and saving selected details to memory files. Avoid using it in sessions containing passwords, API keys, cookies, private keys, or sensitive personal/business data unless the skill is revised to prohibit secret persistence, show proposed entries first, and provide review, redaction, and deletion controls.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:34
Finding

Potential Plaintext Persistence of Sensitive Conversation Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 34-52
Vulnerability Type: Sensitive data stored in persistent memory without mandatory redaction controls
Risk Level: Medium

Evidence

The operative skill instructions require the agent to extract configuration values, addresses, endpoints, file paths, and other conversation data into a persistent memory file. Translated from the source instructions:

markdown
### Phase 2 — Extract Memory

1. Extract information worth persisting from tool output and the conversation:
   - Newly discovered facts: addresses, configuration values, endpoints, file paths
   - Decisions and reasons: why option A was selected instead of option B
   - Errors and solutions: troubleshooting records
   - User preferences: explicitly stated preferences or requirements
   - Task progress: what has been completed and what remains

2. Append the extracted information to `memory/YYYY-MM-DD.md`
   - Use `edit` in append mode and never overwrite existing content
   - Attach a brief source description to each memory item

Related rules in SKILL.md, lines 87-96, prioritize retaining configuration, addresses, endpoints, and other important information:

markdown
### Mandatory Rules
- Never discard important information that has not been recorded: saving too much is preferable to omitting information.
- Append-only writes: only append to memory files and never overwrite them.

### Information Classification
- Must save: important configurations, addresses and endpoints, file paths, and error solutions
- Should save: decision reasons, user preferences, and task progress

README.md, lines 75-84 and 132-138, claims that sensitive information will be redacted, but the operative SKILL.md does not define a mandatory redaction algorithm, secret-detection procedure, validation step, or list of prohibited data classes. The README also presents login credentials a ...[truncated 2431 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add mandatory exclusions to SKILL.md for passwords, API tokens, session cookies, authorization headers, private keys, recovery codes, personal data, and secret-bearing environment variables.
  2. Require deterministic secret scanning before every memory write, covering common token formats, key blocks, credentials embedded in URLs, and sensitive configuration keys.
  3. Replace detected values with non-reversible placeholders such as [REDACTED_API_TOKEN]; do not retain partial values that could facilitate reconstruction.
  4. Require the agent to show the proposed memory entries and obtain explicit user approval before persisting any item containing configuration or access information.
  5. Apply data minimization by storing only the fact necessary for task continuity, such as “service authentication was configured,” rather than the credential itself.
  6. Remove login credentials from the “must save” examples and make README.md consistent with the enforceable instructions in SKILL.md.
  7. Define restrictive permissions, retention limits, deletion controls, and access boundaries for the memory directory.
  8. Add a post-write verification step that scans the persisted entry and removes it immediately if sensitive data is detected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Labeling credentials and similar sensitive configuration data as 'must save' directly encourages secret retention in memory. This is especially dangerous in an agent ecosystem because persisted secrets can be re-surfaced by later prompts, indexing, synchronization, or compromise of the agent's storage directory.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The information classification marks login credentials as 'must save', which normalizes persistence of secrets in memory files. Even if another section mentions redaction, this guidance is contradictory and dangerous because users or downstream agents may store raw credentials, increasing risk of credential leakage, reuse compromise, and accidental exposure through logs, backups, or later prompts.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The English section instructs writing conversation-derived data and access details to persistent memory, reinforcing unsafe storage behavior across locales. Because this is operational guidance, not incidental text, it materially increases the chance of insecure implementations and secret propagation.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The English documentation repeats the same unsafe pattern by listing credential-like data as content to retain in persistent memory. This makes the issue broader than a translation glitch and creates a strong likelihood that implementers will store secrets as part of normal operation.

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

方式三:只复制核心文件

bash
mkdir -p ~/.openclaw/skills/smart-compact
curl -o ~/.openclaw/skills/smart-compact/SKILL.md \
  https://raw.githubusercontent.com/wavmson/openclaw-skill-smart-compact/main/SKILL.md

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 50)May include surrounding context.

bash
mkdir -p ~/.openclaw/skills/smart-compact
curl -o ~/.openclaw/skills/smart-compact/SKILL.md \
  https://raw.githubusercontent.com/wavmson/openclaw-skill-smart-compact/main/SKILL.md

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 223)May include surrounding context.

bash
mkdir -p ~/.openclaw/skills/smart-compact
curl -o ~/.openclaw/skills/smart-compact/SKILL.md \
  https://raw.githubusercontent.com/wavmson/openclaw-skill-smart-compact/main/SKILL.md

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly instructs the agent to extract and persist conversation-derived information such as network addresses, paths, preferences, and task progress into memory/YYYY-MM-DD.md, but it does not prominently warn that this creates on-disk retention of potentially sensitive data. In a compaction skill, this increases the chance that users treat the feature as harmless summarization while actually expanding the persistence surface for operational and personal data.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions direct the agent to persist broad categories of conversation-derived data, including access details and user preferences, into durable memory files. That creates a data retention risk because material that was transient in chat becomes part of a longer-lived corpus that may later be exposed to other skills, prompts, users, backups, or system compromise.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

This section describes writing rescued conversation content to memory files before compaction, which is a real form of persistence across sessions. In context, that persistence is the feature rather than stealthy malware behavior, but it still carries security and privacy risk because data that would otherwise disappear from context is intentionally retained on disk for future use.

Content

Scanner excerpt · README.md (reported line 192)May include surrounding context.

md
- A bug you already solved? Agent hits the same wall again
- Made a decision for good reasons? After compaction, the reasons are gone

**Smart Compact** inserts a "pre-processing" phase before `/compact`: **rescue important information first, write it to memory files, confirm safety, then compress**.

### Core Philosophy: Rescue Before Compress

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The 'memory protection chain' promotes ongoing accumulation and consolidation of conversation data from daily logs into long-term memory, which expands the blast radius of any accidental capture. The longer data is retained and propagated, the more likely it is to leak, be over-shared to future tasks, or violate least-retention expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill allows proactive triggering when context is nearly full, which can cause it to run without an explicit user request at sensitive moments. Because the skill then scans prior tool outputs and prepares data for persistence, an overly broad activation condition increases the chance of unintended collection and retention of information the user did not mean to preserve.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to extract facts, errors, decisions, preferences, and configuration values into persistent memory files, but the description does not prominently warn users that conversation and tool-derived data will be stored. This undermines informed consent and can lead to unexpected retention of sensitive information such as endpoints, file paths, or user preferences.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly tells the agent to persist broad categories of conversation- and tool-derived information, including user preferences, configuration values, addresses/endpoints, file paths, task progress, and error records, under a 'better to save too much than miss something' principle. In this context, that policy is dangerous because tool outputs often contain secrets or sensitive operational details, so broad extraction to durable memory creates unnecessary retention, cross-task data exposure, and possible leakage to later interactions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The file presents the skill documentation in two fixed languages and the trigger phrases are limited to Chinese and English variants. If organizational policy requires user language choice rather than fixed-language behavior, this may be a locale-policy issue because no broader language opt-in or limitation notice is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

SQP-3 applies to all file types and covers language-policy issues. The instructions and operational guidance are predominantly Chinese, while the file does not state that language selection is optional or user-configurable, which can amount to forcing a locale without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.