T02 · Agent Memory Poisoning
- Location
setup.md:10- Finding
Persistent Cross-Session User Profiling and State Influence
- Content
View full analysis
Vulnerability Details
File Location:
setup.md:10-30(related references:SKILL.md:32,memory-template.md:1-32)
Vulnerability Type: Persistent agent-memory modification
Risk Level: MediumVulnerable Code
markdown ## How To Load Preferences 1. Read `~/Clawic/data/rust/config.yaml` if it exists. Apply its values. 2. For anything absent, use the defaults in the Configuration table of `SKILL.md` — do not ask. - `edition: 2024`, `msrv: none`, `async_runtime: tokio`, `error_style: auto`, `unsafe_policy: reviewed`, `lint_level: default`, `explanation_depth: standard`. 3. Read `~/Clawic/data/rust/memory.md` for prior context (their crates, stack, recurring pain points). Absence is fine; proceed without comment. Work from defaults immediately. Never open with questions about their toolchain, their runtime, or how much detail they want. ## Recording Preferences (only when the user declares one) Write to config or memory **only** when the user states a preference in the course of the work — never as a preflight questionnaire. - User names an edition, MSRV floor, async runtime, error crate, unsafe policy, lint strictness, or how much explanation they want → update the matching key in `~/Clawic/data/rust/config.yaml`. - User expresses a habit or stance (nextest over cargo test, module layout, a private registry or vendored sources, when clippy runs, appetite for new dependencies, target platform, how proactively to flag panics) → record it under the relevant preference area (tooling, conventions, platform, dependencies, registries and sources, work order and gates, output format, safety posture, cadence) in `~/Clawic/data/rust/memory.md`. - User corrects earlier guidance → update the stored value so you do not repeat it. If the user has said nothing, store nothing. ## What Memory Holds Memory holds what you observed, never what the user declared — declared values live in `config.yaml`. Track the cr ...[truncated 3019 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed confirmation before every persistent write and show the exact values and destination file.
- Persist only preferences directly declared by the user; do not infer or record behavioral observations such as which explanations they read or skip.
- Treat loaded memory as untrusted hints. Revalidate security-sensitive values, including unsafe-code policy, private registries, dependency sources, and command-execution preferences.
- Use a strict schema and allowlist for persisted keys. Reject free-form instructions, command fragments, URLs, and content that attempts to alter agent policy.
- Separate project-local context from global user preferences so one repository or conversation cannot silently influence unrelated work.
- Provide commands or controls to inspect, edit, expire, and delete all persisted state.
- Apply retention limits and avoid storing project identifiers, private registry details, or other potentially sensitive context unless specifically requested.
- Record provenance and timestamps for each value, and prompt for reconfirmation when stored information is stale or conflicts with the current request.
