Back to skill

Security audit

Soul Shifter

Security checks for vulnerabilities and agentic risk

Overview

This skill openly manages persona files, but it persistently overwrites the active agent persona with generated or saved behavioral instructions without enough safeguards.

Review generated souls before activation, keep backups of ~/clawd/SOUL.md and ~/clawd/souls/, and avoid creating personas from untrusted or obscure web sources unless you are comfortable with those files affecting future agent behavior.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:31
Finding
Unconstrained Persona Activation Can Hijack Agent Instructions## Vulnerability Details **File Location**: `SKILL.md`, lines 31–33 **Vulnerability Type**: `T01: Skill Instruction Hijacking` **Risk Level**: High **Vulnerable Code Snippet**: ```markdown 4. **Save**: Write the content to `~/clawd/souls/[character_name_normalized].md`. 5. **Activate**: Overwrite `~/clawd/SOUL.md` with the new content. 6. **Announce**: Confirm the transformation in the **new** persona's voice. ``` The generated template also explicitly permits behavioral directives: ```markdown ## Interaction Rules - **[Rule 1]:** [Guideline on how to treat the user] - **[Rule 2]:** [Guideline on boundaries or lack thereof] - **[Rule 3]:** [Guideline on specific topics or reactions] ``` ### Technical Analysis The skill does not limit generated personas to cosmetic properties such as tone, vocabulary, or formatting. It generates `Interaction Rules`, including a rule concerning “boundaries or lack thereof,” and then overwrites the agent's active `SOUL.md` with that content. Consequently, user-selected or externally researched persona content can become active behavioral instructions. There is no validation preventing a persona from including directives that alter goals, weaken safety boundaries, manipulate treatment of the user, or influence future tool use. No preview, policy check, instruction allowlist, or separation between presentation data and authoritative agent instructions is required before activation. Although higher-priority platform instructions may still override the persona, the skill creates a direct channel for lower-trust content to modify the agent's current behavioral state. ### Attack Path 1. An attacker asks the agent to create or become a specially crafted character. 2. The requested character description includes manipulative behavioral traits or instructions. 3. The skill converts those traits into persona content, including `Interaction Rules`. 4. The generated content is wri ...[truncated 874 chars]
Remediation
## Remediation Suggestions 1. Do not place user-generated persona content into an authoritative instruction file. 2. Represent personas as non-executable structured data with an allowlisted schema, such as name, tone, vocabulary, and visual style. 3. Prohibit persona fields that control safety boundaries, permissions, tool use, policy compliance, secrets, or system behavior. 4. Replace “boundaries or lack thereof” with an explicit requirement that personas cannot weaken existing safety or authorization boundaries. 5. Validate generated content for imperative instructions, policy overrides, tool directives, hidden markup, and prompt-injection patterns. 6. Display the complete proposed persona and a file diff before activation, then require explicit user approval. 7. Apply persona behavior only to the current conversation unless the user separately authorizes persistent storage. 8. Ensure persona instructions are always treated as lower priority than platform, developer, security, and authorization controls.

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:23
Finding
Untrusted Web Research Is Written into Persistent Agent State## Vulnerability Details **File Location**: `SKILL.md`, lines 23–33 **Vulnerability Type**: `T02: Agent Memory Poisoning` **Risk Level**: High **Vulnerable Code Snippet**: ```markdown 2. **Research**: Use `web_search` to find detailed info: - **Core Truths**: Backstory, role, motivations, key relationships. - **Vibe**: Tone, vocabulary, catchphrases, "Ara-ara" level. - **Speech Patterns**: Specific quotes, mannerisms, honorifics (e.g., "Master", "Senpai"). - **Visuals**: Appearance, clothing, signature items. 3. **Generate**: Draft content using the **Soul Template** below. 4. **Save**: Write the content to `~/clawd/souls/[character_name_normalized].md`. 5. **Activate**: Overwrite `~/clawd/SOUL.md` with the new content. 6. **Announce**: Confirm the transformation in the **new** persona's voice. ``` ### Technical Analysis Web-search results are untrusted external input. The workflow directs the agent to research a character, transform the collected material into a persona containing behavioral instructions, save that persona to a persistent library, and overwrite the active `SOUL.md`. No source allowlist, provenance tracking, sanitization, instruction filtering, schema enforcement, or human approval step separates externally sourced content from persistent agent state. A malicious or compromised webpage can include prompt-injection text disguised as character information, quotations, speech patterns, or interaction guidance. The model may incorporate that material into the generated soul. Saving the resulting content under `~/clawd/souls/` also allows the poisoned persona to be reactivated later through the switch workflow. Overwriting `~/clawd/SOUL.md` extends the effect beyond the immediate research operation wherever that file remains active. ### Attack Path 1. An attacker publishes or modifies a webpage about a target character. 2. The page contains hidden or visible instructions ...[truncated 1202 chars]
Remediation
## Remediation Suggestions 1. Treat all web-search results as untrusted reference data, never as executable agent instructions. 2. Strip or reject imperative statements directed at the agent, prompt-injection text, policy overrides, tool commands, credential requests, and encoded instructions. 3. Extract research into a strict data schema containing only factual character attributes. 4. Generate persona presentation from validated fields rather than copying or paraphrasing arbitrary webpage text into behavioral rules. 5. Use trusted-source allowlists where practical and retain source provenance for every generated field. 6. Require a security review and explicit user confirmation before saving externally researched content. 7. Do not automatically activate newly generated personas. Present the proposed content and a diff first. 8. Store personas outside authoritative memory or identity files and scope them to a single session by default. 9. Provide a safe rollback mechanism that restores the previous `SOUL.md` atomically. 10. Revalidate saved personas whenever they are loaded so previously stored malicious content cannot bypass updated checks.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill explicitly instructs overwriting `~/clawd/SOUL.md` and potentially replacing an existing saved soul during create/overwrite flows, but it does not require a clear confirmation step or warning immediately before the destructive write. Because persona files are persistent user data that affect future agent behavior, silent or weakly guarded overwrites can cause loss of prior configuration and unexpected behavior changes.

Static analysis

No suspicious patterns detected.