crewai - 💡(How to fix) Fix [FEATURE] Security: OWASP ASI06 memory poisoning defense for CrewAI agent memory

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

from agent_memory_guard import MemoryGuard

guard = MemoryGuard(policy="strict")

def safe_memory_write(content):
    result = guard.validate_memory(text=content)
    if not result.is_safe:
        audit_log.record(content, result.threat_type)
        return
    memory_store.write(content)
RAW_BUFFERClick to expand / collapse

Feature Area

Core functionality

Is your feature request related to a an existing bug? Please link it here.

NA - This is a security enhancement request, not related to an existing bug. OWASP ASI06 (Memory Poisoning) is a newly classified threat in the OWASP Top 10 for Agentic Applications that affects all AI agents with persistent memory.

Describe the solution you'd like

Integrate OWASP Agent Memory Guard as a security layer for CrewAI's memory system.

The Problem: CrewAI agents using long-term memory, short-term memory, or entity memory are vulnerable to memory poisoning (OWASP ASI06). An attacker can inject malicious content that persists across sessions and silently alters agent behavior.

The Solution: Agent Memory Guard provides:

  • Cryptographic integrity verification for stored memories
    • Semantic anomaly detection to flag suspicious entries
      • Pattern-based heuristics for known attack patterns Integration Example:
from agent_memory_guard import MemoryGuard

guard = MemoryGuard(policy="strict")

def safe_memory_write(content):
    result = guard.validate_memory(text=content)
    if not result.is_safe:
        audit_log.record(content, result.threat_type)
        return
    memory_store.write(content)

Performance: 100% detection on direct injection, 94% on encoded payloads, <3ms latency overhead.

References:

Describe alternatives you've considered

No response

Additional context

No response

Willingness to Contribute

Yes, I'd be happy to submit a pull request

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING