Commit Graph

1 Commits

Author SHA1 Message Date
Devin AI
98227d29bb Add memory_guard parameter to Crew for validating memory writes
Implements #6043: Add write guards for multi-agent crews to prevent
cross-agent memory poisoning.

- Add memory_guard field to Crew (Optional[Callable[[str], bool]])
- Integrate guard check into Memory base class save()
- Add guard check to LongTermMemory.save() (bypasses super)
- Propagate guard from Crew to all memory instances on creation
- Log warnings when writes are blocked
- Add 19 tests covering all memory types and Crew integration

Co-Authored-By: João <joao@crewai.com>
2026-06-04 20:44:48 +00:00