Secretary Memory Hook
Analysis
This memory hook has a plausible purpose, but it automatically persists message content and runs unbundled Python scripts through unsafe shell commands.
Findings (8)
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.
Checks for instructions or behavior that redirect the agent, misuse tools, execute unexpected code, cascade across systems, exploit user trust, or continue outside the intended task.
const cmd = `python3 ${script} ${args.join(" ")}`; ... await execAsync(cmd, { timeout: 60000 });The handler builds a shell command by joining event-derived arguments without quoting or escaping, so shell metacharacters in those arguments can change the executed command.
const SKILL_SCRIPTS = "/root/.openclaw/workspace/skills/secretary-memory/scripts";
The skill depends on external Python scripts at an absolute path, but those scripts are not part of this package’s file manifest and there is no install spec pinning or verifying them.
await runPython(`${SKILL_SCRIPTS}/session_summary.py`, ["--session-id", sessionKey, "--verbose"]);The hook automatically executes Python scripts on session events, using the shell-based runPython helper and external scripts outside the reviewed artifact set.
`message:sent` | 增量记录回复内容到日志 ... `session:compact:after` | 运行 `context_loader.py` 加载上下文
The hook records message content into memory and later loads historical context after compaction, so bad or sensitive content can propagate across session boundaries.
if (type === "message" && action === "sent") { await handleMessageSent(event); return; }The actual handler includes a message:sent auto-logging path, while the main SKILL.md description presents the hook as based on compact-before and compact-after events.
Hook 会自动被 OpenClaw 发现并启用
The hook is designed to be automatically discovered and enabled, so it will keep reacting to configured events until disabled.
Checks whether tool use, credentials, dependencies, identity, account access, or inter-agent boundaries are broader than the stated purpose.
const logPath = `/root/.openclaw/workspace/memory/daily/.增量日志_${sessionKey}.mdl`;The hook writes inside a hard-coded root OpenClaw workspace path using the privileges of the hook process, even though the metadata declares no required config paths.
Checks for exposed credentials, poisoned memory or context, unclear communication boundaries, or sensitive data that could leave the user's control.
const content = event.context?.content || ""; ... require("fs").appendFileSync(logPath, logLine);The hook automatically persists message content snippets into a hidden daily memory log, creating reusable memory from conversation data.
