T01 · Skill Instruction Hijacking
- Location
scripts/generate.py:72- Finding
Untrusted Memory Content Can Hijack Sub-Agent Instructions and Poison Persistent State
- Content
View full analysis
15000: content = content[:15000] + "\n\n[... truncated for context ...]" return content return None ``` ```python if today_log: context_parts.append(f"## Today's Session Log ({date_str}):\n{today_log}") if recent_sessions: context_parts.append(f"## Recent Session Context:\n{recent_sessions}") if persistent_files.get("quotes"): context_parts.append( f"## Quote Hall of Fame (existing):\n{persistent_files['quotes']}" ) if persistent_files.get("curiosity"): context_parts.append( f"## Curiosity Backlog (existing):\n{persistent_files['curiosity']}" ) if persistent_files.get("decisions"): context_parts.append( f"## Decision Log (existing):\n{persistent_files['decisions']}" ) if persistent_files.get("relationship"): context_parts.append( f"## Relationship Notes (existing):\n{persistent_files['relationship']}" ) context = "\n\n---\n\n".join(context_parts) task = build_generation_task(date_str=date_str, context=context) ``` ```python user_prompt = f"""Write your personal diary entry for {date_str}. Based on the following context from today and recent days: {context} --- Write a RICH, reflective diary entry (400-600 words minimum) with these sections: ... """ ``` ```python def update_persistent_files(entry_content, date_str, workspace): ...[truncated 3588 chars]- Remediation
View remediation
