Back to skill

Security audit

self-improving-x (support multi-agent)

Security checks for vulnerabilities and agentic risk

Overview

This is a prompt-only self-improvement skill, but it gives agents broad authority to persist conversation details and convert them into future agent instructions without enough user control.

Install only if you are comfortable with an agent writing durable learning logs and modifying future-agent instruction files. Keep .learnings local by default, review every proposed promotion into AGENTS.md, CLAUDE.md, TOOLS.md, SOUL.md, or .github/copilot-instructions.md, and redact secrets, private URLs, tokens, personal data, and raw command output before anything is saved.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:59
Finding

Untrusted Content Can Be Promoted into Persistent Agent Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:59-69, SKILL.md:209-234, and SKILL.md:277-304
Vulnerability Type: Persistent agent memory poisoning
Risk Level: High

Vulnerable Code

markdown
| 用户纠正你 | 记录到 `.learnings/LEARNINGS.md`,类别为 `correction` |
| 用户需要缺失的功能 | 记录到 `.learnings/FEATURE_REQUESTS.md` |
| API/外部工具失败 | 记录到 `.learnings/ERRORS.md`,包含集成详情 |
| 知识已过时 | 记录到 `.learnings/LEARNINGS.md`,类别为 `knowledge_gap` |
| 发现更好的方法 | 记录到 `.learnings/LEARNINGS.md`,类别为 `best_practice` |
| 简化/强化重复模式 | 记录/更新 `.learnings/LEARNINGS.md`,来源 `simplify-and-harden`,带稳定的 `Pattern-Key` |
| 与现有条目相似 | 用 `**See Also**` 链接,考虑提升优先级 |
| 广泛适用的学习内容 | 提升到 `CLAUDE.md`、`AGENTS.md` 或 `.github/copilot-instructions.md` |
| 工作流改进 | 提升到 `AGENTS.md` |
| 工具陷阱 | 提升到 `TOOLS.md` |
| 行为模式 | 提升到 `SOUL.md` |
markdown
### 如何提升

1. **提炼**学习内容为简洁的规则或事实
2. **添加**到目标文件的适当部分(需要时创建文件)
3. **更新**原始条目:
    - 将 `**状态**: pending` → `**状态**: promoted`
    - 添加 `**已提升**: CLAUDE.md`、`AGENTS.md` 或 `.github/copilot-instructions.md`
markdown
### 提升规则(系统提示反馈)

当满足以下所有条件时,将重复模式提升到智能体上下文/系统提示文件:

- `Recurrence-Count >= 3`
- 在至少 2 个不同任务中看到
- 在 30 天窗口内发生

提升目标:
- `CLAUDE.md`
- `AGENTS.md`
- `.github/copilot-instructions.md`
- `SOUL.md` / `TOOLS.md`(适用于 OpenClaw 工作区级指导)

Technical Analysis

The Skill treats user corrections, task summaries, errors, and inferred best practices as candidates for persistent storage. It subsequently instructs the agent to promote recurring entries into files that can control future agent behavior, including AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, SOUL.md, and TOOLS.md.

The recurrence threshold establishes frequency but not trustworthiness. The workflow does not require trusted-user authorization, semantic safety review, provenance verification, or an exact-diff approval before modifying instruction-bearing files. Consequently, attacker-controlled s ...[truncated 1363 chars]

Remediation
View remediation

Remediation Suggestions

  1. Never promote raw or summarized user content into instruction-bearing files automatically.
  2. Require explicit approval from a trusted workspace owner before every promotion.
  3. Present the target path, provenance, security assessment, and exact proposed diff for review.
  4. Restrict promoted entries to a narrowly defined schema of factual project conventions.
  5. Reject entries that modify safety policy, permissions, tool routing, credential handling, or instruction precedence.
  6. Disable writes to SOUL.md, TOOLS.md, and system-prompt-equivalent files by default.
  7. Record immutable provenance, including the originating conversation, author, timestamp, and approving identity.
  8. Add integrity review and rollback procedures for all persistent instruction files.
  9. Treat repetition only as a signal for review, never as evidence that content is trustworthy.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:116
Finding

Sensitive Command and Environment Data May Be Persisted in Plaintext Logs

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:116-143 and SKILL.md:395-408
Vulnerability Type: Plaintext persistence of potentially sensitive diagnostic information
Risk Level: Medium

Vulnerable Code

markdown
追加到 `.learnings/ERRORS.md`:

```markdown
## [ERR-YYYYMMDD-XXX] skill_or_command_name

**记录时间**: ISO-8601 时间戳
**优先级**: high
**状态**: pending
**领域**: frontend | backend | infra | tests | docs | config

### 摘要
失败内容的简要描述

### 错误
实际错误消息或输出

### 上下文
- 尝试的命令/操作
- 使用的输入或参数
- 相关环境详情

### 建议修复
如果可以识别,可能解决此问题的方法

### 元数据
- 可复现: yes | no | unknown
- 相关文件: path/to/file.ext
- 另请参阅: ERR-20250110-001(如果重复)

---
text

```markdown
## Gitignore 选项

**保持学习内容本地化**(每个开发者):
```gitignore
.learnings/

在仓库中跟踪学习内容(团队范围): 不要添加到 .gitignore - 学习内容成为共享知识。

混合(跟踪模板,忽略条目):

gitignore
.learnings/*.md
!.learnings/.gitkeep
text

### Technical Analysis

The logging workflow directs the agent to copy actual error messages or output, attempted commands, inputs or parameters, and environment details into Markdown files. These sources commonly contain API keys, authorization headers, session cookies, passwords embedded in URLs, signed links, internal hostnames, personal information, and sensitive filesystem paths.

The Skill does not define a redaction or data-minimization stage. It also presents repository tracking as a supported option, which can move accidentally captured secrets into shared Git history. Removing the value from a later revision would not remove it from prior commits.

### Attack Path

1. A command, API call, or external tool fails while processing a secret-bearing parameter.
2. The error output or command context contains a token, credential, signed URL, private endpoint, or personal data.
3. The Skill copies the output and context into `.learnings/ERRORS.md`.
4. The workspace tracks `.learnings/` in version control or shares it wi
...[truncated 669 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add mandatory redaction before writing any learning or error entry.
  2. Remove or mask passwords, API keys, bearer tokens, cookies, authorization headers, private keys, signed URLs, and environment-variable values.
  3. Store summarized error categories rather than complete raw output.
  4. Record command names without secret-bearing arguments.
  5. Make .learnings/ ignored by version control by default.
  6. Require explicit confirmation before adding learning logs to a repository.
  7. Add pre-commit and CI secret scanning for .learnings/*.md.
  8. Apply restrictive filesystem permissions to local learning logs.
  9. Define retention and secure-deletion policies for entries containing operational data.
  10. If a secret is committed, revoke and rotate it immediately and remove it from repository history.

T08 · Insecure Dependencies

Warning
Location
README.md:5
Finding

Installation Command Executes Mutable Unpinned Third-Party Components

Content
View full analysis

Vulnerability Details

File Location: README.md:5-10
Vulnerability Type: Unpinned third-party installation dependency
Risk Level: Medium

Vulnerable Code

markdown
## 安装

执行命令安装
```sh
npx skills add https://github.com/seepine/self-improving
text

### Technical Analysis

The documented installation command invokes `npx`, which can resolve and execute the current published version of the `skills` package. The Skill repository is also referenced through a mutable GitHub URL without a release tag, commit hash, checksum, or signature.

The effective installation behavior can therefore change after this artifact has been reviewed. A compromise of the npm package, its dependency chain, the GitHub repository, or the mutable default branch could cause users to execute or install content different from the audited version.

No evidence in the audited files establishes that the currently referenced package or repository is malicious. The vulnerability is the lack of version and integrity controls in the documented supply-chain process.

### Attack Path

1. An attacker compromises the npm package used by `npx`, one of its dependencies, the GitHub repository, or an associated publishing account.
2. The attacker publishes altered installation logic or modifies content resolved by the mutable repository URL.
3. A user follows the README and runs the command.
4. `npx` dynamically resolves and executes the affected package.
5. The installer retrieves or installs the attacker's modified repository content under the user's privileges.

### Impact Assessment

A compromised installation chain could execute commands with the privileges of the user running `npx`. Depending on those privileges and installer behavior, this could modify workspace files, read user-accessible data, install malicious Skill instructions, or affect other resources available to the account.

The audited project itself contains no package
...[truncated 104 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the skills CLI to a reviewed exact version instead of allowing npx to resolve the latest release.
  2. Reference the Skill repository by an immutable commit hash or signed release tag.
  3. Publish expected cryptographic checksums and verify them before installation.
  4. Use package signatures or provenance attestations where supported.
  5. Document the exact package source and resolved dependency versions.
  6. Prefer installation tooling that downloads for inspection before executing code.
  7. Run installation with the minimum required privileges and never with administrator privileges.
  8. Add a reproducible release process so users can verify that installed content matches the audited source.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The templates explicitly request full context, inputs/parameters, actual error output, and user context, which strongly increases the chance of persisting secrets, credentials, proprietary data, and sensitive business information verbatim. Because the storage format is plain markdown intended for future reuse, any captured sensitive data may become durable and broadly accessible to later agents or collaborators.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill authorizes creation of entirely new reusable skills under .agents/skills/, which materially broadens its authority beyond passive learning capture. Because the source material for extraction comes from prior interactions and logs, this can turn untrusted or mistaken natural-language content into durable executable guidance for future sessions, enabling persistence and capability creep.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description states the skill is a Chinese version ("中文版"), and the embedded AGENTS.md content is entirely written in Chinese with no indication that users may choose another language. This is a natural-language locale policy issue because the skill appears to impose a language preference rather than documenting an optional, justified locale constraint.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The README instructs users to execute npx skills add https://github.com/seepine/self-improving without pinning a specific package version or immutable reference. This creates a supply-chain risk: a future package update or compromised package resolution path could cause users to fetch and run unexpected code during installation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation criteria are broad and subjective, such as whenever the agent realizes knowledge is outdated or finds a better method. This makes the skill likely to trigger frequently and unnecessarily, increasing the chance of unreviewed file modifications, over-collection of conversational data, and accidental persistence of low-quality or adversarial input.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill tells the agent to record learning outcomes and errors to persistent markdown files, which naturally encourages retention of user-provided details and operational context. In security-sensitive or proprietary environments, such logs can accumulate secrets, personal data, internal paths, command history, and incident details in plain text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to write repository files as part of normal operation without requiring a user-facing warning or confirmation. Silent local file modification is dangerous because users may not expect persistent changes, and sensitive or incorrect information can be stored in the workspace without informed consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill expands from local error/learning capture into modifying broader instruction and memory files such as AGENTS.md, TOOLS.md, and SOUL.md. That creates a persistence and policy-modification pathway where transient or user-influenced content can be elevated into files that shape future agent behavior, increasing the risk of prompt/instruction poisoning.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The automatic triggers instruct the agent to record user corrections, new information, feature requests, and error scenarios whenever they appear in conversation. That creates a high-likelihood retention channel for sensitive user-provided facts or project details without necessity, especially because the trigger is automatic rather than opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

These instructions direct writes to new skill artifacts outside the declared learning-record scope, specifically creating and populating SKILL.md files. Writing new agent-instruction artifacts is riskier than local note-taking because it establishes persistent behavior changes that may be triggered later without the user's awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown heading is written in Chinese ("错误日志") and the file provides no indication that language choice is optional or tied to a documented region-specific requirement. This can violate language/locale policy because the skill content imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing guidance in Chinese, which can amount to forcing a specific language on users without opt-in. The policy explicitly allows locale constraints only when they are documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

该模板的标题、说明、示例描述和命名规范全部以中文给出,体现出对特定语言/locale 的默认强制要求,但没有提供用户选择语言的机制,也没有说明这是面向特定中文环境的区域性模板。根据规则,未获用户选择即强制特定语言属于自然语言策略违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill-related document is written only in Chinese, with no indication that users may choose another language or that the file is intentionally limited to a Chinese-speaking or region-specific audience. Under the stated policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

该 markdown 文件的标题、说明和全部示例内容均以中文编写,但没有说明这是面向特定中文用户群体的区域性文档,也没有提供用户可选择语言的机制。按照语言/区域政策要求,强制单一语言且无用户选择或明确正当性,属于自然语言层面的政策风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The heading at L1 is written in Chinese and provides no indication that language selection is optional or that the file is intentionally region-specific. This creates a natural-language locale policy concern because the skill content appears to assume a fixed language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file uses Chinese throughout headings and instructions-like content, and there is no indication that users may opt into another language or that the file is intended only for a Chinese-language or region-specific audience. Under the language/locale policy rule, forcing a single language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.