feat: add Agent Memory Guard plugin 0.0.1 - #2896
Open
vgudur-dev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin Submission
Plugin information
Submission type
What changed
Adds a credential-free Dify tool plugin that screens a proposed durable-memory write before a workflow persists it. The tool returns safe_to_persist, action, severity, detector, message, and memory_key so a workflow can branch before a database, vector store, or other durable-memory component is called.
The plugin is deliberately narrow: it does not automatically intercept all Dify conversation-memory features. Workflow authors must place Screen Proposed Memory Write immediately before the write boundary they intend to protect.
Risk level
Required checks
Security and privacy notes
Low risk. The plugin is local-only: it has no credentials, network requests, telemetry, external APIs, file operations, arbitrary URL fetching, code execution, or bundled executables. It processes only the proposed memory key, content, provenance label, and optional task identifier inside the Dify plugin runtime. The host Dify deployment's own logging and retention settings remain the administrator's responsibility.
Local validation
PYTHONPATH=/home/ubuntu/amg-dify-plugin uv run --with pytest --with agent-memory-guard pytest -q returned 2 passed. Benign external content returns allow, while a representative prompt-injection payload returns block with detector prompt_injection.
The package archive was inspected with unzip -t and contains only runtime files. The plugin has not been installed in a Dify Community Edition or Dify Cloud instance in this submission; the required integration point is documented in the README, and reviewer testing in the target Dify runtime is requested.
Reviewer notes
This is a workflow-level pre-persistence screen, not an end-to-end security guarantee or an OWASP certification. It depends on agent-memory-guard==0.3.0 and dify_plugin>=0.5.0, and does not require any API key.