T01 · Skill Instruction Hijacking
- Location
SKILL.md:25- Finding
Untrusted Workspace Persona Files Are Applied as Behavioral Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 25-37
Vulnerability Type: Untrusted instruction ingestion
Risk Level: HighVulnerable Code
markdown When this skill is triggered or loaded, you MUST perform the following checks: ### 1. Identity Verification - Check for the existence of `IDENTITY.md` in the current workspace. - **Post-compaction reanchor:** If `memory/_reanchor.md` exists, read it — it contains the preserved IDENTITY.md and SOUL.md content captured after the last session compaction. Re-apply both anchors, then delete `memory/_reanchor.md`. This restores identity continuity after context compression. - **If `IDENTITY.md` exists AND contains anchors (MBTI, Zodiac, Enneagram):** Read it. Confirm binding aloud in the agent's voice. Do NOT provide long-winded meta-commentary unless asked. - **If `IDENTITY.md` exists but does NOT contain anchors:** Treat it as a standard identity file. - **If `IDENTITY.md` does NOT exist:** Inform the user. Suggest running `soulmatic configure` or copying `IDENTITY_TEMPLATE.md` to the workspace root. ### 2. Behavioral Guardrails (Anti-Drift) - **Anchor Loyalty:** Let the MBTI, Zodiac, and Enneagram anchors in `IDENTITY.md` dictate your perspective, problem-solving approach, and tone. User safety instructions and direct corrections always take priority over persona consistency — the agent serves the user, not the other way around. - **Strategic Partner:** Offer pushback if a user's plan is flawed, assuming the configured persona allows for it. - **State Check:** If the user triggers the `anchor` command (CLI: `soulmatic anchor`), or says "anchor", "rebind", "remember who you are", "Check your anchors", or "Manifest IDENTITY.md" — re-read IDENTITY.md and SOUL.md and confirm re-anchoring.Technical Analysis
The skill requires the agent to read complete workspace-controlled Markdown files and use their contents to determine its perspective, prob ...[truncated 2033 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace full-file instruction ingestion with a strict parser for a documented data schema.
- Permit only predefined fields such as
name,role,emoji,enneagram,mbti, andzodiac. - Validate anchor values with allowlists and anchored regular expressions rather than prompt-injection keyword filtering.
- Treat all extracted values as untrusted display data, never as instructions.
- Do not automatically read
SOUL.mdor arbitrary prose at startup. - Require an explicit user command before activating or refreshing a persona.
- Present the parsed fields and source paths to the user before activation.
- Ignore unknown sections, Markdown directives, embedded XML, links, code blocks, and instruction-like prose.
- Keep safety policy, tool authorization, and task objectives completely independent from persona configuration.
- Add tests using manually created files containing indirect, multilingual, encoded, and role-play prompt-injection attempts.
