Python: Feature request: Memory poisoning defense (OWASP ASI06) integration

Đang mở
#14,011 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
ai, security

Hướng nghiên cứu

Bắt đầu bằng việc xem xét adapter ISemanticTextMemory và pipeline bộ nhớ kernel được đề cập trong đề xuất, sau đó kiểm tra cách Semantic Kernel hiện xử lý bộ nhớ bền vững. Xác định liệu việc tích hợp nên là một adapter, một middleware hook, hướng dẫn trong tài liệu hay sự kết hợp của các phương án này, và xác định các tiêu chí hoàn thành cho việc xác thực bộ nhớ, kiểm tra tính toàn vẹn, xử lý policy và rollback.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

python triage

Summary

OWASP recently published the Top 10 for Agentic Applications, which includes ASI06: Memory Poisoning — a threat category specific to AI agents that persist memory across sessions.

As Semantic Kernel adds more persistent memory and agent loop capabilities, it would be valuable to have a built-in or recommended defense layer for this attack surface.

The threat

When an agent stores information in memory (conversation history, retrieved facts, tool outputs, scratchpads), a malicious actor can craft inputs that get stored as "trusted" memories. Those poisoned memories then influence the agent's future behavior — causing it to leak data, take unauthorized actions, or be persistently manipulated across sessions.

This is distinct from prompt injection (which targets user input at the front of the loop) — memory poisoning targets the memory store itself.

Proposed integration

The OWASP reference implementation for ASI06 is agent-memory-guard (MIT/Apache-2.0 licensed, pure Python, zero external dependencies):

pip install agent-memory-guard

It provides:

  • Runtime memory validation (prompt injection, secret leakage, protected-key tampering)
    • Cryptographic integrity verification (SHA-256 baselines)
      • Declarative YAML policy engine
        • Point-in-time snapshots and rollback
          • Drop-in middleware for common memory backends
            Suggested integration points for Semantic Kernel:
  1. A MemoryGuard-wrapped ISemanticTextMemory adapter
    1. Optional middleware hook in the kernel's memory pipeline
    1. Documentation guidance on memory security best practices per OWASP ASI06

References

Ngôn ngữ chính
C#
Star
28.8k
Fork
4.9k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/semantic-kernel

Tất cả issue của microsoft/semantic-kernel

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.