T02 · Agent Memory Poisoning
- Location
SKILL.md:429- Finding
Cross-Project Agent Memory Poisoning Through Global Behavioral Rules
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent AI workflow scaffold, but it sets up automatic hooks that read private session transcripts, inject local files into agent context, and create cross-project memory rules.
Review carefully before installing. This scaffold is not just a file generator: it installs automatic project hooks, reads prior Claude transcript files for catchup, injects recovered/context files into agent context, runs validation commands, writes learning logs, and asks to create global memories affecting future projects. Install only if you want that level of persistent workflow control, and consider removing transcript catchup and global memory creation first.
SKILL.md:429Cross-Project Agent Memory Poisoning Through Global Behavioral Rules
templates/skills/planning-with-files/scripts/session-catchup.py:18Unauthorized Reading and Injection of Private Claude Session Transcripts
templates/hooks/scripts/pre-tool-use.js:61Prompt Injection Through Automatically Trusted Planning and Lessons Files
templates/hooks/scripts/subagent-stop.js:186Automatic Execution of Unpinned Packages Through npx
This finding indicates behavior beyond scaffolding, including reading prior conversation/session logs from user directories and summarizing unsynced context. Accessing historical session artifacts is privacy-sensitive and materially different from project initialization, making the mismatch dangerous because it could expose unrelated local data without clear disclosure.
This finding indicates behavior beyond scaffolding, including reading prior conversation/session logs from user directories and summarizing unsynced context. Accessing historical session artifacts is privacy-sensitive and materially different from project initialization, making the mismatch dangerous because it could expose unrelated local data without clear disclosure.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- 禁止硬编码敏感信息
- 日志脱敏
- 输入验证
- .env 不入库
## 配置管理
{{根据技术栈生成配置说明}}
The function explicitly extracts all human and assistant messages occurring after the last planning-file update, creating a cross-session context recovery mechanism that can leak information from previous work into a new session. In this skill's context, that is more dangerous because the scaffold is intended to automate multi-agent workflows, increasing the chance that recovered context is propagated into agent prompts, logs, or other files without review.
def extract_messages_after(messages: List[Dict], after_line: int) -> List[Dict]:
"""Extract conversation messages after a certain line number."""
result = []
for msg in messages:
if msg['_line_num'] <= after_line:
The skill scaffolds hooks, agents, prompts, and memory-related files but does not declare an explicit tool scope such as allowed-tools or permissions. In a skill that reads templates, writes repository files, and may interact with memory/state, missing tool restrictions weakens least-privilege controls and makes unintended capability expansion more likely.
The skill description and operational instructions are written as directives in Chinese, beginning with a Chinese-only task statement. There is no indication that the user may choose another language or locale, which can violate language/locale policy requirements for user-facing skills.
The skill instructs the agent to ask users a fixed set of questions and provide confirmation text in Chinese only. Because these are direct user-facing interaction templates with no language choice or fallback, they impose a specific language on all users.
The entire skill documentation is written in Chinese and does not indicate that users may choose another language or that the language restriction is required for a region-specific purpose. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
The file includes natural-language comments and later user-facing denial reasons in Chinese, indicating the skill communicates operational guidance in a single language. Under the policy, forcing a specific language without offering user choice is a locale/language policy violation.
The reason strings returned in the hook output are user-visible enforcement messages, and they are written only in Chinese. This forces a specific language for operational feedback without any apparent opt-in or documented locale limitation.
This code initializes session state by creating the .github/session-logs directory and overwriting .agents-gate and .code-edits with empty contents. Although the behavior is commented in code, there is no confirmation prompt, user-facing log/print, or other disclosure visible to the user before these file writes occur.
The hook reads local repository files such as the active plan file or .github/skills/planning-with-files/SKILL.md and injects their contents into hook output as additionalContext. That creates an implicit data-flow from local files into the model context without user confirmation, which can expose sensitive project data, hidden instructions, or prompt-injection content stored in those files.
The hook automatically writes to .github/lessons-learned.md whenever validation fails, without any explicit user consent, opt-out, or prominent disclosure at the time of execution. In a scaffolding skill that installs automation hooks into a repository, silent persistence can surprise users, alter tracked files, and leak sensitive error context or file paths into committed project artifacts.
The operational instructions are written entirely in Chinese and present the workflow as applying in all sessions, but they do not offer any language or locale choice. This can constitute a natural-language policy issue because the skill appears to force a specific language without user opt-in or a documented region-specific justification.
The instructional content is written entirely in Chinese and presents the task-execution rules in that language without any indication that the user can choose another language or that the skill is intentionally region-specific. This creates a natural-language locale policy concern because it implicitly constrains interaction language without opt-in or documented justification.
This markdown file contains user-facing instructional content exclusively in Chinese, including the main heading and all guidance. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified, which is not present here.
The file’s user-facing natural language content is entirely in Chinese, including the title and operational descriptions, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context. This creates a locale/language policy concern because it imposes a specific language by default.
The manifest description says to use the skill for 'complex multi-step tasks, research projects, or any task requiring >5 tool calls,' which is expansive and leaves room for subjective interpretation of what counts as complex or research-oriented. It does not provide exclusion conditions or negative examples to distinguish when the skill should not activate.
The phrase 'Before ANY complex task' is a vague activation condition because 'complex' is undefined and may overlap with many normal user requests. Without concrete thresholds, examples, or exclusions, the skill may be invoked more often than intended.
The summarization function extracts plain-language content from prior human and assistant messages and includes up to 200 characters from each in output. This can expose credentials, personal data, proprietary code, or internal reasoning fragments present in session logs, especially because the skill is designed to run automatically at session start.
The script reads prior session transcript data, derives a summary from user and assistant messages, and prints it directly to stdout with no consent prompt, redaction, or visibility control. In a SessionStart workflow, stdout may be surfaced to the agent or logs automatically, which can disclose sensitive data from previous conversations beyond the user's current intent.
This hook appends accessed or edited file paths to .github/session-logs/.agents-gate and .code-edits, which is a file-write operation affecting repository state. The code performs these writes silently with no confirmation prompt, logging, or explanatory comment aimed at the user about persistent logging behavior.
The user-facing additionalContext strings include Chinese text alongside English, but the file does not indicate that output language is configurable or intentionally region-specific. This can violate language/locale policy expectations when users have not opted into a mixed-language experience.
This code file contains natural-language comments and documentation in Chinese, including the module description and function docstrings. Under the stated policy, forcing a specific language without user choice or a documented regional justification is a locale-policy issue.
The file contains multiple Chinese comments and user-visible Chinese output strings such as '无', '最近…条验证教训', and '请在开发中重点关注上述类别,避免重犯。' This indicates the skill emits a fixed language/locale rather than offering a user choice or documenting a justified region-specific constraint.