Session Janitor

Security checks across static analysis, malware telemetry, and agentic risk

Overview

This skill is mostly aligned with session cleanup, but it persistently edits active OpenClaw sessions and can store or push transcript-derived memories in ways users may not expect.

Before installing, back up your OpenClaw session directories and review config.json carefully. Disable LLM extraction, memCli, sceneFilesPath, watchdog, cron, or watcher features you do not want. Only use this if you are comfortable with a background process that can edit all discovered OpenClaw sessions and handle gateway tokens.

Static analysis

No static analysis findings were reported for this release.

VirusTotal

VirusTotal findings are pending for this skill version.

View on VirusTotal

Risk analysis

Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.

#
ASI02: Tool Misuse and Exploitation
Medium
What this means

Your active OpenClaw sessions could silently lose model override settings, changing how future agent turns run.

Why it was flagged

The janitor edits active sessions.json entries and removes modelOverride for active sessions regardless of transcript size. That can change a user's selected model or agent behavior, and it is not clearly described as part of transcript trimming.

Skill content
# ACTIVE session — always clear modelOverride + compactionCheckpoints regardless of size ... if 'modelOverride' in v: del v['modelOverride']
Recommendation

Make modelOverride removal opt-in, document it prominently, and back up sessions.json before running the janitor.

#
ASI08: Cascading Failures
Medium
What this means

An oversized active conversation may lose continuity after the janitor runs, and that behavior can apply across all discovered gateways.

Why it was flagged

After a successful trim, the script renames the active transcript and removes the session entry, effectively resetting the active session. The user-facing description emphasizes keeping recent exchanges and a summary, not forcing a clean slate.

Skill content
mv "$jsonl" "${jsonl}.reset.${reset_ts}" ... del sessions[k] ... log "$name: session $sid reset after trim (clean slate for next message)"
Recommendation

Disable or change the reset-after-trim behavior unless you explicitly want clean-slate sessions; keep backups and test on noncritical sessions first.

#
ASI06: Memory and Context Poisoning
Medium
What this means

Private conversation facts, decisions, or tasks may be added to a persistent memory store automatically.

Why it was flagged

Setup automatically enables mem CLI storage when a mem executable is found. That means LLM-extracted memories from trimmed transcripts may be persisted without a separate per-run review step.

Skill content
"memCli": { "enabled": bool(mem_path), "path": mem_path }
Recommendation

Review config.json after setup and set memCli.enabled and llmExtraction.enabled to false unless you want automatic memory storage.

#
ASI06: Memory and Context Poisoning
Medium
What this means

Summaries of private conversations could be committed and pushed to a remote repository if scene-file memory is configured.

Why it was flagged

If a scene files path is configured, extracted memories can be appended to files and automatically pushed to the configured git remote. This is a sensitive transcript-derived data flow that is not clearly surfaced in the main setup/config documentation.

Skill content
def git_commit_scene_files(scene_dir): """Commit and push scene file updates to git repo.""" ... subprocess.run(["git", "-C", repo_dir, "push"], timeout=30, check=True)
Recommendation

Do not configure sceneFilesPath unless you understand the git remote; add an explicit no-push option or require manual approval before git push.

#
ASI03: Identity and Privilege Abuse
Low
What this means

The generated config.json may contain gateway tokens that can control or reload sessions.

Why it was flagged

The skill reads local OpenClaw gateway auth tokens so it can call the gateway API. This is purpose-aligned, but it gives the janitor delegated access to gateway sessions.

Skill content
Each discovered gateway gets its own entry in config.json with: - Port ... - Auth token (from gateway.auth.token) - Sessions directory path
Recommendation

Protect config.json permissions and install only if you trust the scripts with OpenClaw gateway access.

#
ASI10: Rogue Agents
Low
What this means

The janitor can continue modifying session state after installation until the cron job/service is disabled.

Why it was flagged

The skill is designed to keep running in the background through cron and a watcher service. This is disclosed and purpose-aligned, but it is persistent automation over session files.

Skill content
Setup auto-discovers all gateway installations (`~/.openclaw/`, `~/.openclaw-*/`), generates `config.json`, installs a cron job, and installs the watcher service
Recommendation

Know how to disable the cron entry and watcher service before installing, and monitor the configured log files after setup.