T01 · Skill Instruction Hijacking
- Location
scripts/auto_dream.py:197- Finding
Untrusted memory entries can hijack consolidation instructions and poison persistent agent memory
- Content
View full analysis
str: """ 构建 4 阶段蒸馏 prompt(参考 Claude Code consolidationPrompt.ts) """ memory_root = str(AUTO_DREAM_DIR) memory_manifest = format_memory_manifest(scan_memory_files()) daily_logs = read_daily_logs(days_back=7) logs_content = "\n\n".join([ f"## {date}\n{content}" for date, content in sorted(daily_logs.items(), reverse=True) ]) prompt = f"""# Dream: Memory Consolidation You are performing a dream — a reflective pass over your memory files. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly. Memory directory: `{memory_root}` This directory already exists — write to it directly (do not run mkdir or check for its existence). --- ## Phase 1 — Orient - `ls` the memory directory to see what already exists - Read `MEMORY.md` to understand the current index - Skim existing topic files so you improve them rather than creating duplicates - Check `logs/` subdirectory for recent append-only log entries ## Phase 2 — Gather recent signal Look for new information worth persisting. Sources in rough priority order: 1. **Daily logs** (`logs/YYYY/MM/YYYY-MM-DD.md`) — these are the append-only stream: ``` {logs_content} ``` 2. **Existing memories tha ...[truncated 2701 chars]- Remediation
View remediation
