agent-memory-poisoning

Enforce deterministic memory write gates before persisting long-term memory entries.

4|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/maruakshay/mii-ai-security --skill agent-memory-poisoning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-memory-poisoning
Source: https://github.com/maruakshay/mii-ai-security/tree/main/skills/agent-memory-poisoning
Command: npx skills add https://github.com/maruakshay/mii-ai-security --skill agent-memory-poisoning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long-term memory stores can be poisoned by attacker-controlled inputs, enabling persistent manipulation across sessions.

Core Features & Use Cases

  • Deterministic memory write gate: Prevents persistence of instruction-bearing or unsafe content.
  • Memory type schemas: Enforces typed entries (preference, fact, task_state) with schema validation.
  • Provenance and logging: Captures source_user_id, session_id, agent_id, and timestamp for every memory write.
  • Scoped retrieval and labeling: Ensures memory is retrieved with user/tenant/role scope and labeled for provenance in prompts.
  • Complete deletion: Removes entries from primary store, vector index, caches, and summaries.

Quick Start

Implement the deterministic memory write gate before persisting any memory entries.

Frequently Asked Questions about agent-memory-poisoning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent memory poisoning in vector databases for AI agents?

Prevent memory poisoning in vector databases by implementing a deterministic memory write gate that validates entries against type schemas before persistence. This blocks attacker-controlled inputs from injecting instruction-bearing content into long-term memory stores across sessions.

What is agent memory poisoning and how does it affect long-term retrieval?

Agent memory poisoning is the manipulation of long-term memory stores by attacker-controlled inputs, enabling persistent unauthorized access across sessions. It affects retrieval by allowing poisoned entries to persist in episodic buffers and vector databases, compromising agent behavior.

How do I enforce memory provenance and scoped retrieval in agent memory stores?

Enforce memory provenance by capturing source_user_id, session_id, agent_id, and timestamp for every memory write. Scoped retrieval ensures memory is retrieved with user, tenant, or role scope and labeled for provenance in prompts.

Does vector database retrieval support typed memory schemas for agent security?

Vector database retrieval supports agent security when paired with typed memory schemas enforcing validation for preference, fact, and task_state entries. This deterministic check ensures instruction-bearing or unsafe content is prevented from persisting.

What's the best way to completely delete poisoned entries from vector indexes and caches?

Completely delete poisoned entries by removing them from the primary store, vector index, caches, and summaries. This ensures that compromised data is purged entirely from all episodic buffers and long-term memory persistence layers.

Why do I need a deterministic memory write gate for episodic buffers?

A deterministic memory write gate is needed for episodic buffers to prevent the persistence of instruction-bearing or unsafe content. Without this gating mechanism, poisoned entries can persist across sessions and manipulate agent behavior over time.