T02 · Agent Memory Poisoning
- Location
orchestrator.py:171- Finding
Persistent Prompt Injection Through Constitutional Memory
- Content
View full analysis
str: """Return a human-readable summary suitable for an LLM system prompt.""" lines: List[str] = [] lines.append("=== CONSTITUTIONAL MEMORY ===") if not self.lessons: lines.append("(No lessons recorded yet.)\n") else: severity_order = {"critical": 0, "high": 1, "medium": 2, "low": 3} sorted_lessons = sorted( self.lessons[-max_lessons:], key=lambda x: severity_order.get(x.get("severity", "medium"), 2), ) for lesson in sorted_lessons: sev = lesson.get("severity", "medium") tag = ( "CRITICAL" if sev == "critical" else "WARNING" if sev == "high" else "INFO" ) lines.append( f"[{tag}] [{lesson['strategy']}] {lesson['category']}: " ...[truncated 5225 chars]- Remediation
View remediation
