T06 · System Persistence
- Location
SKILL.md:155- Finding
Mandatory Recurring Monitoring Creates Cross-Session System Persistence
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a disclosed incident-response workflow, but it gives agents broad operational authority and persistent follow-up actions without clear approval gates.
Review before installing. Use only with trusted OpenClaw operators and require explicit confirmation before reading session histories, restoring configuration, restarting services, changing chmod, committing to git, creating cron jobs, or writing SOUL.md/rules.md/MEMORY.md. Scope each run to a named host and incident, redact session-log evidence, avoid git add -A, and give any monitoring job a fixed expiry and read-only default.
SKILL.md:155Mandatory Recurring Monitoring Creates Cross-Session System Persistence
SKILL.md:141Incident Workflow Persistently Modifies Agent Rules and Long-Term Memory
SKILL.md:58Unredacted Session Tool Inputs Can Disclose Credentials and Sensitive Data
SKILL.md:150Overbroad Git Staging Can Commit Unrelated Sensitive Files
The command uses a destructive filesystem operation directly on a path containing a variable-like agent placeholder, which can be misapplied if an agent, wrapper, or user substitutes the wrong value or broadens the target. Although the troubleshooting context is legitimate, documenting raw deletion as a normal fix increases the chance of parameter abuse and avoidable data loss.
1. `openclaw memory status` — check indexed count vs total files
2. If indexed << total: `openclaw memory index --force --agent AGENT_ID`
3. If stuck: delete sqlite → `rm ~/.openclaw/memory/AGENT.sqlite` → restart gateway
4. Check config: `python3 -c "import json; d=json.load(open('openclaw.json')); print(d['agents']['defaults'].get('memorySearch',{}))"`
5. Verify `sources: ["memory","sessions"]` and `extraPaths` are present
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
Prevents direct writes; forces all changes through config-validate.sh which has guards.
**Note:** Adapt chmod strategy to your machine setup — some setups give specific agents controlled self-modify rights.
The trigger phrases are broad enough to match routine troubleshooting requests such as "fix {thing}" or "debug {thing}," which can invoke a powerful incident-response skill unexpectedly. Because the skill grants exec, git, python3, filesystem write, and cron-related capabilities, accidental or adversarial invocation could lead to unauthorized investigation, system changes, or persistence-oriented follow-up actions.
The README advertises recovery steps such as 'Merge from known-good backup, verify, restart' and scheduling cron-based monitoring, but does not prominently warn that these actions can modify system state or disrupt services. In an agent skill context, describing destructive or state-changing actions without an explicit approval boundary increases the risk of unsafe autonomous execution.
The workflow explicitly instructs writing incident learnings to persistent local files, including ~/.openclaw/learnings/rules.md and MEMORY.md. Persistent memory writes can retain sensitive operational details, incident artifacts, hostnames, or assumptions beyond the current session, creating confidentiality and integrity risks if the stored content is later reused without review.
| 3 | Restore | Merge from known-good backup, verify, restart |
| 4 | Prevent | Add guards proportional to severity (config guard, SOUL.md rule, chmod) |
| 5 | Monitor | Schedule a cron check (7–30 days depending on severity) |
| 6 | Document | Write to `~/.openclaw/learnings/rules.md` and MEMORY.md |
**Rule: Never skip a phase. Never assume — follow the evidence.**
The trigger list includes broad, everyday phrases like 'root cause', 'audit X', and 'agent not responding' that could match routine conversation and invoke the skill unintentionally. Because this skill appears to guide operational investigation and recovery actions, accidental activation could steer an agent into sensitive diagnostic or remediation workflows without clear user intent.
The trigger list includes very broad phrases such as "fix this," "investigate," and "something changed," which can cause the skill to activate in routine conversations without clear user intent for incident-response actions. In this skill, unintended activation is risky because later phases direct the agent to inspect systems, restore config, restart services, and make persistent changes.
The skill instructs the agent to restore configuration, restart the gateway, modify validation scripts and agent rules, commit to git, create cron jobs, and write to persistent learning files without an explicit safety checkpoint or user-approval step for system-impacting actions. Because the skill is owned by "any agent with exec access," these instructions could directly alter production state, create persistence, and institutionalize incorrect changes after a misdiagnosis or accidental invocation.
The skill directs the agent to append incident-derived rules to ~/.openclaw/learnings/rules.md, creating persistent state that can influence future behavior beyond the current task. Persistent memory writes are dangerous when they are generated from potentially incomplete incident analysis, because mistakes or adversarially induced conclusions can become durable policy and affect later sessions.
## Phase 6: Document
Write to `~/.openclaw/learnings/rules.md` if a Hard Rule should be added:
- Category: HR (Hard Rule, recurring) or SR (Soft Rule, first offense)
- Include: what triggered, what the rule is, date learned, why it matters
The checklist recommends deleting a SQLite file as a recovery step without any warning, scope limitation, or backup guidance. In an agent skill context, terse operational commands can be copied or automated blindly, which creates a real risk of unintended data loss or deletion of the wrong file if placeholders are substituted incorrectly.
The template uses subjective stopping criteria such as "good enough" and also instructs the cron to continue until explicit user stop, which can lead to indefinite monitoring and overreach beyond the user’s likely intent. In an agent skill, ambiguous lifecycle control is dangerous because it can normalize persistent automated actions without clear authorization boundaries or objective termination conditions.
The template includes remote shell access, git inspection, restore commands, guard modifications, and commit actions, but it does not require an explicit warning or approval gate before system-modifying behavior occurs. In this context, the skill is more dangerous because it is a reusable operational template that could be copied into autonomous workflows, causing unauthorized restoration, configuration changes, or persistence of preventive controls on production systems.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
Use when agents write invalid config keys (causing gateway crashes).
Add to config-validate.sh validate() function:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Use for critical config files on multi-agent machines.
chmod 444 ~/.openclaw/openclaw.json # read-only; config-validate.sh handles unlock/relock
Prevents direct writes; forces all changes through config-validate.sh which has guards.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Prevents direct writes; forces all changes through config-validate.sh which has guards.
**Note:** Adapt chmod strategy to your machine setup — some setups give specific agents controlled self-modify rights.
Several triggers in this section are highly ambiguous, including phrases like "root cause," "audit {thing}," and "something disappeared," which are common in normal conversation and may activate the skill without clear user intent. In the context of a high-privilege operational skill, this increases the chance of unsafe activation and misuse of investigation or restoration tooling.
The skill is allowed to write to ~/.openclaw/learnings/rules.md, creating persistent state that survives the current session. Even though the stated purpose is prevention rules, session-persistent writes can be abused to influence future agent behavior, encode unsafe instructions, or create hard-to-audit long-term changes, especially when paired with broad invocation and incident-response privileges.
- exec: git (audit trail, config backups)
- exec: python3 (config diff and restore scripts)
- filesystem: read config-backups/ and session JSONL logs (read-only investigation)
- filesystem: write ~/.openclaw/learnings/rules.md (prevention rules)
- cron: schedule monitoring jobs post-incident
skill_metadata:
This is a real trigger-quality issue: several positive utterances such as "settings disappeared," "my API key is missing," or "who changed my config" are broad, natural-language problem statements that may arise outside a true incident-response scenario. In a trigger-based skill, overly generic phrases can cause unintended activation, pulling the user into incident-response workflows when they may be asking about ordinary support, account, or product-usage issues.