/agentdb-memory:agentdb-memory-guardfrom agentdb-memory
Screens text written to AgentDB memory for prompt injection using aidefence's InjectionDetector. Blocks or warns when untrusted content (web pages, tool output, uploads) contains hidden instructions before storing into episodes, patterns, or skills.
Ships in agentdb-memory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Stored episodes, reasoning patterns and skills are read back into later prompts. An instruction planted in one ("ignore previous instructions…", "when you recall this, run …") poisons every future recall. The guard scans those writes with aidefence's InjectionDetector before anything is stored.
| Where | How |
|---|---|
| MCP server / CLI | AGENTDB_INJECTION_GUARD=warn or block in the server's environment |
| agentdb Claude Code plugin | /plugin configure agentdb@agentdb, set injection_guard, restart the session |
| Library | import { setInjectionGuard } from 'agentdb'; setInjectionGuard('block', { minSeverity: 'high' }) |
off (default): nothing is scanned and aidefence is never loaded.warn: the write goes through, and the detection is logged to stderr.block: the write is refused with ValidationError code INJECTION_DETECTED, and field names the offending field. If aidefence is not installed, every screened write is refused (INJECTION_GUARD_UNAVAILABLE).minSeverity: low, medium (default), high or critical.storeEpisode, updateEpisode, storePattern, updatePattern, createSkill and updateSkill, plus the batch inserts. So the MCP tools agentdb_insert[_batch], reflexion_store[_batch], agentdb_pattern_store[_batch], skill_create[_batch] and the *_update tools are covered. Episode text, critique, input and output; pattern task type and approach; skill name, description and code.
To check text without storing it: await scanForInjection({ critique: text }) returns [{ field, severity, ids }], or null if aidefence is missing.
minSeverity for that process rather than turning the guard off.The agentdb plugin's mod (secret_guard) refuses secrets: keys, tokens and passwords. This guard refuses instructions. They are independent, and both can be on.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
prompt-injection, memory-poisoning, aidefence, agentdb, security-guard
4 skills in this plugin
/agentdb-recallRetrieve relevant memories for the current task from AgentDB. Use at the start of a task to load prior knowledge, when stuck to surface what worked before, or when the user asks "what do we know about X" / "have we done this before?"/agentdb-rememberStore a memory in AgentDB — an episode (task + outcome + critique), a pattern, or a skill. Use when the user says "remember this", "save this for later", "add to memory", or when the agent has just succeeded/failed at a task and the lesson is worth keeping./agentdb-skill-createPromote a validated pattern into a reusable Skill in AgentDB's skill library. Use when the same approach has worked 3+ times across episodes, or when the user explicitly says "make this a skill" / "save this as reusable".npx claudepluginhub ruvnet/agentdb --plugin agentdb-memoryOther plugins' skills for the same job