-
Notifications
You must be signed in to change notification settings - Fork 2
fix(memory): consolidation LLM prompt — separate system instructions from user content #2362
Copy link
Copy link
Closed
Labels
P3Research — medium-high complexityResearch — medium-high complexityllmzeph-llm crate (Ollama, Claude)zeph-llm crate (Ollama, Claude)memoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)securitySecurity-related issueSecurity-related issue
Description
Context
In crates/zeph-memory/src/consolidation.rs, the consolidate_batch function constructs a prompt for the LLM (to propose MERGE/UPDATE topology ops). Currently instructions and user-generated memory content are combined in a single Role::User message.
Risk
If memory content contains adversarial text resembling instructions, it could influence the consolidation decision. Severity is low (serde parse gate bounds the blast radius), but better practice is to separate them.
Fix
Split the prompt into:
Role::System: consolidation instructions onlyRole::User: memory content to analyze
Acceptance criteria
Consolidation LLM call uses separate system/user messages. Existing consolidation tests still pass.
Discovered in PR #2358 security audit (INFO-01).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Research — medium-high complexityResearch — medium-high complexityllmzeph-llm crate (Ollama, Claude)zeph-llm crate (Ollama, Claude)memoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)securitySecurity-related issueSecurity-related issue