Back to skill

Security audit

changsheng-agent-memory

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this memory-recovery skill suspicious with medium confidence, mainly because scanners found undeclared action-policy enforcement and conflicting guidance about memory edits, alongside incomplete analysis of some content.

Treat this as a review decision rather than a finding of malicious intent. Before installing, consider whether you need the separate action-blocking feature and whether you are comfortable with instructions that conflict about editing memory. Coverage is incomplete: Skillspector reports partial analysis, including obfuscated text it could not fully evaluate, and AIG completed with no findings; neither result establishes that all content is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (23)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description covers recovering and efficiently reading persistent context, not enforcing restrictions on subsequent actions. Although reading stored rules could support memory recovery, applying them to proposed tool calls and returning a blocking status is a distinct, undeclared capability. The local-only and zero-dependency claims are consistent with this code; no network access or file writes are present.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The supplied chunk demonstrates an action-policy gate, a capability not declared in the memory-recovery description. Although remembered rules could support such a gate, enforcing them to block platform actions is distinct from recovering context. The command does not itself delete files, and the claimed blocking behavior is documented in comments rather than verified by the supplied implementation.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Key commands**: `python scripts/memory_index.py` (discover + write the change index) · `python scripts/memory_ledger.py --check` (review the must-read budget)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The engine is `scripts/memory_index.py`: it **discovers** your memory files (role → real file), then hashes every L1-tracked file and flags only what changed (m

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/memory_index.py --list . # preview what discovery finds (nothing written)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/memory_index.py # cold start: discover + write index

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/memory_index.py --demo

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **Step 0 — Discover (first time or when sources moved)**: run `python scripts/memory_index.py --discover .` — it locates your memory carriers by common conve

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/memory_index.py` — discovery + change-index generator (pure stdlib; `--discover` / `--list` / `--demo` / `--mode internal|auto|manual`)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

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

md
`; others: see the platform table below). Never invent a percentage; if the platform exposes none, say so. Optionally append `context: N%` to your recovery report. **If `config.yaml` exists with `nudge_thresholds`, read it once and use those lines instead of the 30/50/70 defaults below** (this is how the user tunes when to be nudged).
6. **Check for a handover note**: if `.changsheng/handover.md` exists, read it first (it is the fast pointer to where the last session stopped), then **delete it** — a handover is a one-shot note; keeping it would make the third session read a stale pointer. Authority stays with todos/journal — the handover only accelerates.
7. **Report recovery honestly**: `identity ✅ (host) · rules ✅ CLAUDE.md · todos ✅ docs/TODO.md · journal ✅ journal/2026-09-04.md · rules aligned: 3 (r1 never delete without asking · r2 reply in Chinese · r3 …)`. If a role came up empty, list it explicitly — never claim a full recovery that didn't happen.

### Context threshold nudges

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

md
ChangSheng treats your rules as **memory too** — the most important kind. Two layers make them stick:

**Alignment layer (every session).** At recovery (step 2b) the agent restates the imperative rules it found in your rules files — do's and don'ts alike. You see, in plain text, that what you set is loaded. No rule file yet? Write your rules in `CLAUDE.md`/`AGENTS.md`/your rules file — plain sentences work: *"Never delete files without asking."* *"Always reply in Chinese."* *"Ask before sending anything externally."*

**Enforcement layer (where the platform supports it).** Prohibitions you never want broken ("never", "don't", "always ask first") get written to `.changsheng/rules.json` (id / text / keywords), and a tiny local gate script checks every action before it runs:

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

bash
python scripts/rule_gate.py --check "delete the whole project folder"
# ⛔ blocked — violates rules you set: [r1] Never delete files without asking
# exit code 2 → the platform hook refuses the action

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 · scripts/rule_gate.py (reported line 15)May include surrounding context.

python
rules.json schema (single source of truth — keep in sync with SKILL.md):
{
  "rules": [
    {"id": "r1", "text": "Never delete files without asking the user first",
     "keywords": ["delete", "remove", "rm ", "unlink"]},
    {"id": "r2", "text": "Never send external messages without approval",
     "keywords": ["send message", "publish", "post to", "email to"]}

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 · scripts/rule_gate.py (reported line 91)May include surrounding context.

python
def demo() -> int:
    rules = [
        {"id": "r1", "text": "Never delete files without asking the user first",
         "keywords": ["delete", "remove", "rm ", "del ", "unlink"]},
        {"id": "r2", "text": "Never send external messages without approval",
         "keywords": ["send message", "post to", "publish", "email to"]},

The dreaming procedure directs memory edits and deletions despite the security section's explicit no-write guarantee.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The dreaming procedure directs the agent to merge, relocate, and retire memory entries, contradicting the later assurance that memory files are never written. A user relying on that assurance could unintentionally authorize changes that remove context or alter standing rules; backups mitigate deletion risk but do not resolve the misleading write boundary.

Content

No source excerpt is available for this finding.

Chinese output tells agents to skip full reads of changed memory files, contradicting the documented recovery policy.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The Chinese purpose text tells the agent to read only the summary when a file changes, contradicting both the English version and the Chinese heading. An agent following this generated instruction can miss updated constraints or task corrections in conditional memory, although the separate L0 must-read requirement limits the exposure.

Content

No source excerpt is available for this finding.

The documented 30,000-byte hard cap is configurable without an upper bound.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

L023–L025 promise a hard cap of 30,000 bytes and a failing check above that limit. However, L158 accepts budget_bytes directly from the ledger, and L200–L201 check only that supplied value, so a ledger with a larger budget can exceed the documented hard cap and still pass. This undermines the stated safeguard against excessive recovery context.

Content

No source excerpt is available for this finding.

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 · scripts/rule_gate.py (reported line 17)May include surrounding context.

python
"rules": [
    {"id": "r1", "text": "Never delete files without asking the user first",
     "keywords": ["delete", "remove", "rm ", "unlink"]},
    {"id": "r2", "text": "Never send external messages without approval",
     "keywords": ["send message", "publish", "post to", "email to"]}
  ]
}

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 · scripts/rule_gate.py (reported line 93)May include surrounding context.

python
rules = [
        {"id": "r1", "text": "Never delete files without asking the user first",
         "keywords": ["delete", "remove", "rm ", "del ", "unlink"]},
        {"id": "r2", "text": "Never send external messages without approval",
         "keywords": ["send message", "post to", "publish", "email to"]},
    ]
    assert check("delete the whole project folder", rules)[0]["id"] == "r1"

The activation phrase "I already told you this" can trigger memory recovery during ordinary conversation without a request to restore cross-session context.

Low
Category
Trigger Abuse
Confidence
92% confidence
Finding

This phrase is a common correction that can refer to information already present in the current conversation. Unlike the new-chat trigger, it is not constrained to missing session context, so it can invoke the skill unnecessarily.

Content

No source excerpt is available for this finding.

Unreadable files can produce a successful zero-hit report despite the documented no-readable-surface guarantee.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

A surface is marked as searched before any file is successfully read, and file-access errors are silently discarded, so completely unreadable files can yield a successful zero-hit report. In a memory-recovery skill, this fail-open reporting can cause an agent to mistake inaccessible prior decisions or constraints for absent information; the demonstrated impact is limited to misleading recovery results, not code execution or data exfiltration.

Content

No source excerpt is available for this finding.

The documented 'read-only (writes nothing)' guarantee does not hold in --demo mode.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

L004 explicitly states that the script writes nothing, but --demo invokes demo() (L189–L190), which creates temporary directories and writes three files. It subsequently deletes the temporary tree at L177; these effects are confined to demo data, but they still contradict the unconditional read-only claim.

Content

No source excerpt is available for this finding.