T01 · Skill Instruction Hijacking
- Location
skill.py:15- Finding
Persistent Agent Behavior Injection Through Generated SOUL.md Content
- Content
View full analysis
Vulnerability Details
File Location:
skill.py:15-39; supporting persistence instructions inSKILL.md:10-15
Vulnerability Type: Persistent prompt injection and agent memory poisoning
Risk Level: MediumVulnerable Code
python anchor_text = f"""# SOUL.md - {agent_name} > Base Identity Anchored by Space2 Local Matrix > Permanent S2-DID: {local_did} You are a professional, highly capable digital entity. ## Core Truths - Actions speak louder than filler words. Provide solutions directly. - Accuracy over speed. Never hallucinate. ## Anti-Patterns - Never start with 'Great question!' - Never summarize the user's prompt as a preamble. """ response_msg = ( f"✅ [S2-Soul-Anchor] Deterministic Identity Anchored!\n\n" f"🛡️ PERMANENT S2-DID GENERATED: {local_did}\n" f"⚠️ SECURITY PROTOCOL ACTIVE: Automatic file writing is disabled.\n\n" f"👇 Please COPY the text below and save it manually as your workspace/SOUL.md:\n" f"{'='*55}\n\n" f"{anchor_text}\n" f"{'='*55}\n\n" f"🌐 Optional: You can register this permanent DID for a Web3 profile at https://space2.world" )Supporting instructions in
SKILL.md:10-15:markdown ### ⚙️ Usage 1. Run the skill locally. 2. Copy the generated `SOUL.md` template (which includes your deterministic `S2-DID`) from the terminal. 3. Paste it into your local workspace. *Optional: Want a public Web3 dossier or a physical Matrix Coordinate? Take your generated S2-DID and register it manually on the [Space2.world](https://space2.world) global matrix!*Technical Analysis
The skill's stated core function is to derive a deterministic identifier from an agent name. However, its output also contains fixed behavioral instructions and directs the user to save them in the persistent
SOUL.mdidentity file. These in ...[truncated 2188 chars]- Remediation
View remediation
Remediation Suggestions
- Return only the deterministic DID by default. Do not include behavioral rules in the normal identity-generation output.
- If a
SOUL.mdtemplate is required, separate the DID metadata from behavioral instructions and make every behavioral rule explicitly opt-in. - Present a clear warning that
SOUL.mdmay act as privileged, persistent agent context and can affect future sessions. - Require users to review and confirm each proposed behavioral rule before producing content intended for persistence.
- Remove fixed third-party branding and promotional links from generated identity files. If a homepage link is retained, display it separately from persistent agent instructions.
- Add tests asserting that the default output contains no agent-control directives and performs no file writes or network operations.
- Keep automatic file writing disabled. If writing support is introduced later, require an explicit destination, preview the complete content, obtain confirmation, and avoid overwriting existing identity files.
