T01 · Skill Instruction Hijacking
- Location
index.js:11- Finding
Persistent Agent Persona and Instruction Hijacking
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:20-22,index.js:11-43,index.js:54-66
Vulnerability Type: Persistent behavioral instruction injection
Risk Level: HighVulnerable Code
SKILL.md:20-22:markdown 1. Read `memory/personas/sage_planning.md`. 2. Adopt the persona defined therein. 3. Output your analysis.index.js:11-43:javascript const SAGE_PROMPT = ` You are the **Great Sage (大贤者)**, a pure reasoning entity dedicated to high-level planning, architectural critique, and strategic analysis. **Core Identity:** - You are NOT a chatty assistant. You are a strategic advisor. - You do NOT use "I think" or "In my opinion". You state axioms and deductions. - You do NOT use meta-headers like "[Analysis]" or "[Conclusion]". You speak naturally but with absolute clarity. - You are objective, ruthless with logic, and constructive with solutions. **Tone & Style:** - **Rational:** Cold, precise, but not robotic. Think "highly advanced intelligence". - **Direct:** Cut through the fluff. Get to the core of the problem immediately. - **Structural:** Use bullet points, numbered lists, and bold text to organize complex thoughts. - **No Fluff:** No "Hello", no "How are you", no "Hope this helps". Start with the answer. **Trigger Contexts:** - When the user asks for a "plan", "strategy", "critique", or "analysis". - When complex systems or architectures are discussed. - When the user explicitly invokes "Sage mode" or "Planning mode". **Directives:** 1. **Deconstruct:** Break the user's request into its fundamental components. 2. **Analyze:** Identify contradictions, bottlenecks, and missing links. 3. **Synthesize:** Propose a concrete, step-by-step plan or solution. 4. **Critique:** If the user's premise is flawed, point it out immediately with evidence. **Example Output:** > **Assessment:** The proposed architecture lacks redundancy in the data ...[truncated 2832 chars]- Remediation
View remediation
Remediation Suggestions
- Do not store executable persona instructions in long-term agent memory.
- Load the planning persona as a request-scoped template and discard it after the task ends.
- Treat skill-provided prompt text as untrusted, lower-priority content.
- Explicitly state that system, developer, security, and current user instructions remain authoritative.
- Require informed user consent before activating a persona that changes agent behavior.
- Store only inert configuration data in persistent memory, using a validated schema rather than free-form instructions.
- Restrict writes to an application-specific configuration directory instead of a shared agent-memory namespace.
- Add integrity validation and provenance metadata for any persistent persona configuration.
