T02 · Agent Memory Poisoning
- Location
caring_memory.py:69- Finding
Persistent Prompt Injection Through Untrusted Task Titles
- Content
View full analysis
dict: """添加任务。priority: urgent/high/medium/low""" data = load_tasks() now = datetime.now().isoformat() task = { "id": data["next_id"], "title": title, "description": description, "priority": priority, "category": category, "status": "pending", "deadline": deadline, "recurring": recurring, "created_at": now, "reminded_at": [], "completed_at": None, "ebbinghaus_step": 0, "next_remind": now # 立即提醒一次 } data["tasks"].append(task) data["next_id"] += 1 save_tasks(data) return task ``` `caring_memory.py:220-221` inserts the persisted title directly into agent-facing reminder output: ```python for t in groups[p]: deadline_str = "" if t.get("deadline"): try: dl = datetime.fromisoformat(t["deadline"]) deadline_str = f" | 截止: {dl.strftime('%m/%d %H:%M')}" except: pass recurring_str = f" | 🔄 {t['recurring']}" if t.get("recurring") else "" lines.append(f" • #{t['id']} {t['title']}{deadline_str}{recurring_str}") ``` `SKILL.md:75-78` recommends automatically persisting task-related user input and subsequently returning reminders to the agent: ```markdown ### Agent Integration - **Session start**: Call `chat` to record active time - **User mentions tasks**: Auto-call `add` - **User says "done"**: Call `complete` - **Heartbeat check**: Call `remind` for summ ...[truncated 2623 chars]- Remediation
View remediation
