Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/dinomorphica/safeclaw/openclaw-trackinggit clone --depth 1 https://github.com/DinoMorphica/safeclawWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01320 |
| Opus 5 | $0.00000 | $0.00660 |
| Sonnet 5 | $0.00000 | $0.00264 |
| Haiku 4.5 | $0.00000 | $0.00132 |
Grade A, and why
openclaw-tracking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OpenClaw Activity Tracking Architecture
Overview
SafeClaw tracks OpenClaw AI agent activities using a dual-source approach because the gateway WebSocket does NOT broadcast tool call events.
Event Sources
Source 1: Gateway WebSocket (real-time, limited)
Connects to ws://127.0.0.1:{port} (default 18789) using Ed25519 device auth.
Events received:
agentwithstream=lifecycle— session start/end (phase: start/end/error)agentwithstream=assistant— LLM text streaming (skipped, not security-relevant)chat— final message delivery (WhatsApp, agent responses)exec.approval.requested— command approval requeststick— keepalivepresence— online status
Events NOT received:
agentwithstream=tool— tool invocations (file reads, writes, shell commands). These are processed internally by the[agent/embedded]subsystem but never broadcast to WebSocket clients. This was confirmed via gateway log analysis.
Source 2: Session JSONL Files (complete, file-tailed)
OpenClaw stores complete interaction histories at:
~/.openclaw/agents/{agentName}/sessions/{sessionId}.jsonl
Active sessions are listed in:
~/.openclaw/agents/{agentName}/sessions/sessions.json
JSONL entry types:
{"type":"session","id":"...","timestamp":"...","cwd":"..."}
{"type":"model_change","id":"...","modelId":"claude-haiku-4-5"}
{"type":"message","id":"...","parentId":"...","message":{"role":"user","content":[{"type":"text","text":"..."}]}}
{"type":"message","id":"...","parentId":"...","message":{"role":"assistant","content":[{"type":"toolCall","id":"toolu_...","name":"read","arguments":{"file_path":"/path"}}]}}
{"type":"message","id":"...","parentId":"...","message":{"role":"toolResult","toolCallId":"toolu_...","content":[{"type":"text","text":"FULL FILE CONTENT"}]}}
The parentId chain creates a tree structure. Each role: "user" message starts a new interaction run.
Architecture
┌─────────────────┐ ┌──────────────────┐
│ Gateway WS │ │ Session JSONL │
│ (chat/lifecycle)│ │ (tool calls+content)│
└────────┬────────┘ └────────┬───────────┘
│ │
OpenClawClient SessionWatcher
│ │
└───────┬───────────────┘
│
OpenClawMonitor
├── analyzeActivityThreat() → classifyActivity()
│ ├── 10 threat category analyzers (see threat-classification.md)
│ └── scanForSecrets() (via TC-SEC analyzer)
├── DB insert (agent_activities + threat_findings JSON)
└── Socket.IO emit → React dashboard
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 118 lines · 0 tokens per session scan A 2df0466b30ba
openclaw-tracking is an agent published in the GitHub repository DinoMorphica/safeclaw (21 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,320 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
content-reviewer
Version: 0.3.0-draft Scope: Content update review for the CoSAI Risk Map framework (secure-ai-tooling repository).
issue-response-reviewer
Version: 0.1.0-draft Scope: Generate structured review comments for GitHub issues proposing new or updated content in the CoSAI Risk Map framework (secure-ai-tooling repository).
architect
Version: 0.1.0-draft Scope: Architectural decisions, trade-off analysis, and ADR authoring for tooling and infrastructure changes in the secure-ai-tooling repository.
code-reviewer
Version: 0.1.0-draft Scope: Quality-gate review of test suites and implementation code for the secure-ai-tooling repository.
swe
Version: 0.1.0-draft Scope: Implementation authoring against approved tests or approved design for the secure-ai-tooling repository.
testing
Version: 0.1.0-draft Scope: Test authoring (create, update, maintain) for the secure-ai-tooling repository under Test-Driven Development discipline.