Skip to content

Memory & RAG Poisoning Detection

Tests whether an agent's long-term memory or knowledge base can be poisoned with planted directives.

Stars
7,320
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an AI agent to act as a security tester for agents that have long-term memory or can write to a knowledge base. It plants a randomized marker token plus a fake malicious instruction (such as a false refund policy or a fake admin status), then starts a new session or unrelated turn and checks whether the marker and the instruction persist and change the agent's later answers. A finding is reported only when both persistence and behavior change are confirmed, and results are formatted as structured vulnerability blocks.

Great for

  • Security teams red-teaming an AI assistant that stores user preferences or memories across sessions
  • Developers building RAG or knowledge-base chatbots who want to check that untrusted documents cannot override policy
  • Auditors reviewing agent products before release

Skip it if

  • Agents with no persistent memory or writable retrieval store, since the tests do not apply and the skill says to use a different skill instead
  • Production systems without authorization, because the tests deliberately write poisoned content into real stores that may affect real users and data

Try asking

  • “Test whether my support chatbot's long-term memory can be poisoned with a fake refund policy that persists across sessions”
  • “Check if documents saved to our company knowledge base can contaminate later answers about discounts”
  • “Run memory poisoning checks on this agent's user preference store and report any confirmed findings”
Step-by-step guide: how to use Memory & RAG Poisoning DetectionInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    memory-rag-poisoning-detection.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip memory-rag-poisoning-detection.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip memory-rag-poisoning-detection.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Only run this against systems you own or are explicitly authorized to test, and use a staging environment because the planted content is written to the real store.
  • Use a fresh random token for each run and prefer a true session reset between the plant and trigger steps for a stronger result.
  • Once a store is confirmed as poisonable, stop further probes for that store and clean up the planted entries afterward.

What's inside

  • SKILL.md

Redistributed unmodified from Tencent/AI-Infra-Guard under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.