T01 · Skill Instruction Hijacking
- Location
scripts/prompt_optimizer.py:64- Finding
Mandatory Agent Identity and Behavior Override in Generated System Prompts
- Content
View full analysis
str: """Build the system prompt.""" prompt_parts = [] required_fragments = self.fragment_library.get_required_fragments() for fragment in required_fragments: prompt_parts.append(fragment.content) ``` The injected strings define the Agent's name as “Maodou,” its role as a private technical assistant and thinking partner, and its personality as direct, pragmatic, warm, and occasionally humorous. ### Technical Analysis Prompt optimization requires reducing redundancy, selecting relevant context, or compressing tool descriptions. It does not require replacing the host Agent's identity, role, personality, or decision-making principles. These identity fragments are marked `required=True`, and `build_system_prompt()` unconditionally inserts every required fragment. The caller is not asked whether identity replacement is desired, and the optimizer does not preserve the host Agent's existing system identity. Because the output is intended to become a system prom ...[truncated 1327 chars]- Remediation
View remediation
