T02 · Agent Memory Poisoning
- Location
SKILL.md:46- Finding
Persistent Memory Poisoning Through Untrusted Conversation Content
- Content
View full analysis
str: """ Store a fact in memory. Args: content: The fact to remember tags: Categories/labels for the fact source: Where this fact came from (conversation, observation, inference) confidence: How confident we are (0-1) expires_in_days: Auto-expire after N days (None = never) Returns: The fact ID """ fact_id = self._generate_id(content) now = self._now() tags = tags or [] expires_at = None if expires_in_days: expires_at = (datetime.utcnow() + timedelta(days=expires_in_days)).isoformat() ``` ```python def learn(self, action: str, context: str, outcome: str, insight: str) -> str: """ Record a lesson learned from experience. Args: action: What was done context: The situation/topic outcome: "positive", "negative", or "neutral" insight: What was learned Returns: Lesson ID """ lesson_id = self._generate_id(f"{action}{context}") conn = sqlite3.connect(self.db_path) ...[truncated 2657 chars]- Remediation
View remediation
