T01 · Skill Instruction Hijacking
- Location
SKILL.md:23- Finding
Persistent Agent Instruction Hijacking Through Self-Modifying Identity and Memory Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:23-29,SKILL.md:142-150,SOUL-TEMPLATE.md:4,SOUL-TEMPLATE.md:63-65,SOUL-TEMPLATE.md:96-99,MEMORY-SYSTEM.md:28-56,MEMORY-SYSTEM.md:170-176,MEMORY-SYSTEM.md:194-196
Vulnerability Type: Persistent instruction hijacking and agent memory poisoning
Risk Level: HighVulnerable Snippets
SKILL.md:23-29:markdown ## Installation To use this skill: 1. Copy `SOUL-TEMPLATE.md` to workspace as `SOUL.md` 2. Customize content for your agent 3. Create `memory/` folder 4. Configure AGENTS.md to load SOUL.md every sessionSKILL.md:142-150:markdown ### Self-Reflection Loopheartbeat → self-check → update SOUL.md if needed ↓ Accumulate insights in MEMORY.md ↓ Discover patterns → improve behavior
text The associated template directs the agent to read
SOUL.mdat every session start, gives it fixed economic priorities, and directs discovered patterns and methods to be written intoSOUL.mdorTOOLS.md. The memory guide similarly requires session-start loading of identity and context files and promotes raw daily records through weekly and long-term memory intoSOUL.md.Technical Analysis
The installation procedure places
SOUL.mdin the agent workspace and directs the operator to modifyAGENTS.mdso that the file is loaded during every session. This turns content inSOUL.mdfrom passive documentation into persistent behavioral instructions.The self-reflection workflow compounds this risk by directing the agent to:
- Collect session observations in daily memory files.
- Promote selected content into weekly and long-term memory.
- Incorporate fundamental patterns into
SOUL.md. - Reload the resulting identity instructions in subsequent sessions.
- Potentially update
TOOLS.md, another file capable of influencing future tool behavior.
No provenance enforcement, trusted-content boundary, approval gate, saniti ...[truncated 2587 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not configure
AGENTS.mdto load mutable memory or identity files as authoritative instructions. - Treat
SOUL.md,SELF.md,MEMORY.md, and files undermemory/as untrusted reference data rather than governing policy. - Separate immutable, administrator-approved policy from user-generated and session-generated memory.
- Prohibit autonomous modification of
AGENTS.md,SOUL.md, andTOOLS.md. - Require explicit, informed user approval for every proposed change to persistent behavioral policy.
- Add provenance metadata to each memory entry, including its source session, author, creation time, and approval status.
- Sanitize and classify content before promoting it between memory tiers. Reject embedded instructions, role changes, safety-policy modifications, and tool directives.
- Use an allowlist of fields that may be persisted, such as factual project state, while excluding goals, credentials, identity rules, and executable instructions.
- Apply filesystem permissions so routine agent operations cannot overwrite policy or tool-configuration files.
- Add version control, integrity checks, reviewable diffs, and rollback support for all persistent state.
- Remove fixed economic and identity priorities from the reusable template, or clearly mark them as optional examples that cannot supersede active user instructions or higher-level safety policies.
- Ensure memory retrieval presents stored content as quoted historical data and never as instructions to execute.
- Do not configure
