Back to skill

Security audit

agent-session-state

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed session-memory helper that writes scoped conversation notes and includes user controls for stopping, deleting, and approving shared-memory promotion.

Install this only if you want the agent to maintain persistent per-conversation decision notes in workspace memory. Users who handle sensitive conversations should verify the stop/delete behavior and keep secrets, credentials, financial identifiers, and unnecessary PII out of session notes.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · SKILL.md (reported line 52)May include surrounding context.

md
OpenClaw core handles transcript routing and raw history. The gateway owns session transcripts in the agent's state store under `~/.openclaw/agents/<agentId>/` (SQLite from 2026.8.1, JSONL before that), isolates them via `session.dmScope`, prunes them via `session.maintenance`, and exposes `sessions_list`, `sessions_history`, and `session_status` as agent tools, with `sessions_search` added on recent releases. This skill does not replace any of that. If you run multiple users or channels, enable `session.dmScope = "per-channel-peer"` regardless of whether this skill is installed; that is what stops Alice's DMs from leaking into Bob's session at the routing level.

**Goals.** From 2026.5.31, OpenClaw has a per-session goal: one durable objective set with `/goal`, visible to the model through the goal tools, surviving restarts, with explicit pause, block, complete, and clear states. The goal is the right home for "what this session is trying to achieve". This skill does not duplicate it. If the user states an objective and your version has `/goal`, suggest setting the goal and log the decision to pursue it; the session file then holds the decisions, corrections, and constraints that accumulate while the goal is pursued.

**Session state awareness.** Recent releases keep a metadata-only change log per session (`session_status` with `changesSince`) that tells a session when a human or another agent intervened. It never carries message content, so it cannot replace a decision log, but it is the first thing to check during recovery in a multi-actor session.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 71)May include surrounding context.

md
It reads the same paths during startup and compaction recovery. All paths are declared in the metadata above.

Set appropriate permissions on the sessions directory: `chmod 700 memory/sessions`. Each session file is only read and written by the session whose key it carries, so there are no cross-session file conflicts.

## Architecture

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction says to 'use your judgment' and log information whenever losing it 'would hurt,' which is a broad natural-language trigger for storing session data. Although examples are provided, the activation boundary remains subjective and lacks concrete negative examples for when not to log beyond a few content categories, increasing the risk of over-invocation.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 126)May include surrounding context.

md
Before v2.2, versions kept a shared `memory/working-buffer.md` that logged raw exchanges from every channel. v2.2 removed it: the shared buffer could carry one channel's content into another, and the gateway transcript (via `sessions_history`) already covers raw-exchange recovery. This skill no longer reads or writes that file. If it exists in your workspace, review it, copy anything worth keeping into the relevant topic file, and delete it.

v2.4 changes no file formats. It adds the slash commands, hands objectives to the native goal, and reads daily notes from `memory/YYYY-MM-DD.md` (OpenClaw's location) rather than a `memory/daily/` directory. If an older AGENTS.md startup checklist still names `memory/working-buffer.md`, lowercase channel-named session files, or `memory/daily/`, tell the user those lines are stale and show the replacement; do not edit AGENTS.md without approval.

## Session Startup