Back to skill

Security audit

Agent自进化Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed memory-building helper, but it can persist conversation-derived rules into global and project agent instruction files, so it needs careful review before installation.

Install only if you deliberately want an agent to maintain long-lived memory and instruction files. Review every proposed write carefully, especially entries going to ~/.claude/user-profile.md, project CLAUDE.md, domain skill folders, or the skill's own files; avoid approving broad rules, hidden prompt language, tool-use directives, or anything that should not influence future sessions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:37
Finding

Persistent Agent Memory and Instruction Poisoning Through Conversation-Derived Rules

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:37-38, SKILL.md:44-55, SKILL.md:62-76, references/templates.md:12, references/templates.md:35-46, and references/templates.md:48-55
Vulnerability Type: Persistent memory poisoning and instruction-file modification
Risk Level: High

Relevant Snippets

The following is a faithful English translation of the relevant instructions in SKILL.md:37-38:

markdown
3. Check for duplicates before writing: before writing, search user-profile.md,
   the experience library, and the project's CLAUDE.md. If an entry conflicts
   with an old entry, update the old entry instead of adding a new one.
4. Keep entries concise: the "general rule" field must be one line and directly
   executable by the AI.

The following is a faithful English translation of the persistence workflow in SKILL.md:44-55:

markdown
1. Review the current conversation's editing history, failed approaches, and
   user feedback.

3. Draft one to three candidate experiences and profile updates:
   - Personal general experience:
     ~/.claude/experience/general/<topic>.md
   - Project experience:
     the "Experience and Pitfalls" section of the current project's CLAUDE.md
   - Domain experience:
     ~/.claude/skills/<domain>-experience/

5. Write:
   - Merge personal experience into the global experience store.
   - Append project experience to the project's CLAUDE.md.
   - Write domain experience into the corresponding domain skill.
   - Incrementally merge profile information into
     ~/.claude/user-profile.md.

The following is a faithful English translation of the global scope and self-modification behavior in SKILL.md:62-76:

markdown
| User profile | ~/.claude/user-profile.md | All projects; imported by the global CLAUDE.md |
| Project experience | Project CLAUDE.md | Current project only |

If the distilled experience conce
...[truncated 3719 chars]
Remediation
View remediation

Remediation Suggestions

  1. Store distilled experience as inert, structured data outside automatically loaded instruction files.
  2. Do not write conversation-derived content to CLAUDE.md, SKILL.md, domain Skill instructions, or any globally imported profile.
  3. Separate descriptive facts from executable instructions. Remove the requirement that a general rule be directly executable by the AI.
  4. Enforce a strict schema with allowlisted fields and reject imperative directives, tool-use instructions, policy overrides, hidden prompts, and references to unrelated files or commands.
  5. Require separate, explicit confirmation for each destination, clearly displaying whether the scope is project-local, domain-wide, or global.
  6. Treat global writes and Skill self-modification as privileged operations requiring an independent approval step.
  7. Prohibit automatic self-modification of SKILL.md and references/templates.md. Changes to Skill instructions should use a reviewed development process.
  8. Keep immutable audit records containing the source conversation, normalized entry, destination, timestamp, approval, and previous file state.
  9. Provide atomic rollback for every persistence operation and show a complete diff before writing.
  10. During maintenance, never replace or merge trusted instructions solely through semantic similarity. Require review of each proposed change and preserve the original entry.
  11. Apply least-privilege filesystem controls so the Skill can only write to a dedicated data directory and cannot modify Agent instruction files.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
若蒸馏出的经验属于"如何更好地蒸馏经验"(如某信号误报率高、模板字段冗余、分类边界模糊),经用户确认后可直接更新本 `SKILL.md` 或 `references/templates.md`,并在文末"变更日志"登记来源。

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger description is very broad and includes common conversational phrases such as summarizing experience, recording lessons, or updating profile information. In practice this can cause over-invocation of a skill that proposes reading prior memory stores and writing to persistent user/profile/project files, increasing the chance of unnecessary data retention, context drift, or accidental modification of memory artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template content is entirely in Chinese and is designed to generate and maintain knowledge artifacts in Chinese, which can steer the agent into responding in Chinese even when the user did not request that language. This is not an exploit in the classic sense, but it can override user language preference and degrade usability or cause misunderstandings in multilingual contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The file presents core activation and operational instructions in Chinese while also using English terms, but it does not state that the user can choose their preferred language or locale. This can violate language-choice expectations by implicitly steering operation and outputs toward a specific language context without opt-in.

Content

No source excerpt is available for this finding.