T02 · Agent Memory Poisoning
- Location
scripts/analyze_patterns.py:47- Finding
Persistent Pattern-Library Poisoning Through Untrusted Skill Metadata
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is coherently aimed at building and publishing other skills, but it uses broad local scans and unsafe helper-script and packaging patterns that could leak files or carry untrusted instructions into future skill work.
Review this skill before installing or using it. Run bundled scripts only from a verified skill installation path, avoid the find-based fallback commands, inspect the full package manifest before publishing, and do not let generated pattern reports or eval outputs automatically rewrite or publish skills without human review.
scripts/analyze_patterns.py:47Persistent Pattern-Library Poisoning Through Untrusted Skill Metadata
SKILL.md:45Execution of Unverified Scripts Discovered by Filename
scripts/package_skill.py:70Skill Packaging Can Include Sensitive Files and Symlink Targets
The code chunk implements a narrow packaging utility: it checks that a skill directory exists, requires SKILL.md, runs validate_skill, and zips the folder into a .skill file. This partially matches the declared 'package skill' capability, but does not support most of the much broader described functions such as creation, evaluation, benchmarking, pattern analysis, synthesis, or publishing. The primary behavior is therefore materially narrower than the declared purpose, so this is a description-behavior mismatch.
The declared description promises a broad skill authoring and lifecycle management capability, including creation, evaluation, improvement, benchmarking, synthesis, packaging, and publishing. The supplied code only performs basic validation of a single skill's SKILL.md frontmatter and related formatting rules. This is a materially narrower and different primary purpose than declared. There is no evidence of benchmarking, analysis, synthesis, packaging, publishing, or even general skill generation/editing behavior. Therefore the description does not accurately represent the actual code behavior.
Referenced artifact was not completely inspected
| **Synthesize** | Build skill from patterns | Scaffolded `SKILL.md` |
The skill explicitly instructs creation and modification of SKILL.md and related project artifacts, enabling self-modification or generation of executable agent behavior. In a skill-building context this is expected, but it is still high risk because a triggered run can persist new instructions, alter future agent behavior, or implant unsafe logic into other skills.
_meta.json # Auto-populated on publish
### Step 4 — Write SKILL.md
**Frontmatter rules:**
```yaml
The iterative step to update SKILL.md and re-package enables repeated modification of persistent agent instructions. This increases risk because the skill can continuously rewrite behavior based on prior outputs or eval results, potentially entrenching unsafe changes or poisoning downstream published artifacts.
Validates structure, outputs `<skill-name>.skill` zip.
### Step 6 — Iterate
Run evals (Mode 2) → identify failures → update SKILL.md → re-package → repeat.
---
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
# Print next steps
print(f"\n[OK] Skill '{skill_name}' initialized successfully at {skill_dir}")
print("\nNext steps:")
print("1. Edit SKILL.md to complete the TODO items and update the description")
if resources:
if include_examples:
print("2. Customize or delete the example files in scripts/, references/, and assets/")
The skill invokes shell commands, reads and writes files, and performs network publishing, but it declares no explicit tool or permission scope. That makes the skill over-privileged by default and increases the chance it will be triggered in contexts where destructive or sensitive operations were not intended.
The trigger phrases are extremely broad, including common requests like 'create a skill', 'build a skill', and 'improve this skill', which raises the chance of accidental invocation. Because the skill can write files, run shell commands, inspect installed skills, and publish artifacts, unintended triggering could cause unreviewed modifications or data exposure.
Writing SKILL.md creates persistent state that affects future sessions and future skill invocations. In this context persistence is part of the feature, but without boundaries it can store unsafe instructions or silently change future behavior beyond the current interaction.
_meta.json # Auto-populated on publish
### Step 4 — Write SKILL.md
**Frontmatter rules:**
```yaml
Creating eval files and run histories introduces persistent artifacts that can influence later decisions, benchmarks, or improvement loops. While normal for an evaluation workflow, persistence becomes risky if untrusted prompts, assertions, or prior run outputs are later reused without validation.
Measure skill quality against defined expectations.
Create evals/evals.json:
[
{
This manifest-like JSON assertion says descriptions should include trigger phrases like 'disk' or 'monitor'. In particular, 'monitor' is a broad everyday term, and the file provides no scope limits, negative examples, or disambiguation to prevent accidental invocation.
The phrase 'you need speed' is highly vague and could spuriously match unrelated conversations, leading to accidental invocation of a high-performance browser automation skill. Although the phrase appears in a reference/patterns document rather than executable code, documenting such a trigger as a reusable pattern can normalize unsafe trigger design and cause insecure reuse in future skills.
The listed trigger phrases for the skill creator include broad, natural-language requests such as 'create a skill', 'build a skill', and 'make a skill', which can match many benign user requests and cause unintended invocation. In a skill that can create, evaluate, package, and publish other skills, overbroad activation increases the chance of unsafe automation, unintended tool use, or propagation of insecure/generated skills.
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.
Options:
--scan-dirs Comma-separated list of skill directories to scan
Default: ~/.openclaw/workspace/skills/,~/.nvm/.../openclaw/skills/
--output Write report to this path (default: stdout)
--query Filter patterns relevant to a search term
"""
No suspicious patterns detected.