T02 · Agent Memory Poisoning
- Location
scripts/crm-import.py:145- Finding
Untrusted CRM data can poison persistent agent memory and heartbeat output
- Content
View full analysis
tuple[Path, bool]: """Create a contact markdown file. Returns (path, created).""" name = contact.get("name", "Unknown") slug = slugify(name) filepath = PEOPLE_DIR / f"{slug}.md" if filepath.exists() and not overwrite: return filepath, False today = datetime.now().strftime("%Y-%m-%d") # Build frontmatter lines = [ "---", f"name: {name}", "type: person", ] # Tags tags = contact.get("tags", "") if tags: if isinstance(tags, str): tags = [t.strip() for t in tags.split(",") if t.strip()] lines.append(f"tags: [{', '.join(tags)}]") else: lines.append("tags: [imported]") # Other fields field_map = { "company": "company", "role": "role", "email": "email", "phone": "phone", "telegram": "telegram", "twitter": "twitter", "linkedin": "linkedin", "website": "website", "location": "location", } for key, yaml_key in field_map.items(): value = contact.get(key) if value: # Escape quotes in values if ":" in str(value) or '"' in str(value): value = f'"{value}"' lines.append(f"{yaml_key}: {value}") lines.extend([ f"first_contact: {today}", f"last_contact: {today}", "status: active", "---", "", f"# {name}", "", "## Context", "", "", "## Interactions", "", "", " ...[truncated 3952 chars]- Remediation
View remediation
