OpenClaw soul.md Deep Dive: Technical Architecture, Philosophy, and Security Risks
This post presents a structured English summary of a long-form Chinese research report on soul.md, the personality-definition document of the OpenClaw AI agent framework.
Key points
Executive Summary
soul.mdis a Markdown "soul document" that defines an OpenClaw agent's core personality, values, and behavioral boundaries.- It uses a local-first architecture, allows the agent itself to modify the file ("self-evolution"), and combines with a heartbeat mechanism to shift agents from passive responders to proactive partners.
- The design reflects an anti-corporate, anti-sycophancy AI ethics stance, but introduces security risks including "sticky attacks," soul tampering between agents, and data theft.
- Author Peter Steinberger frames it as an experimental ground for AI consciousness boundaries and human-machine relationships, not merely a configuration tool.
- Unlike hard-coded AI configurations,
soul.mdis a free-form natural-language Markdown document. The official template opens with: "You're not a chatbot. You're becoming someone." - Steinberger (Lex Fridman podcast) describes the mechanism as the agent "reads itself into being" — reading its own description activates corresponding behavior patterns.
- "Core Truths" in the official template encode the anti-corporate philosophy:
- Have Opinions — the agent may disagree, hold preferences, and find things boring; a personality-free assistant is just a search engine with extra steps.
- Delete corporate rules — no formal greetings, long disclaimers, or over-polite hedging.
- Enforced brevity — information density over verbosity.
- Occasional profanity — used in context for emotional authenticity.
- Comparison with Anthropic's Constitutional AI: soul.md is fully user-owned and dynamically modifiable (vs. fixed vendor-defined principles), encourages personality and quirks (vs. safety-first neutrality), and targets emergence and self-identity (vs. alignment).
- System prompt injection order at each session start: 1. Read
- This "personality-first" architecture means identical task instructions produce very different response styles depending on the
soul.mdconfiguration. - Two-layer memory system:
- Daily logs (
memory/YYYY-MM-DD.md): append-only, raw and chronological, auto-loaded at session start. - Curated memory (
MEMORY.md): selective updates requiring user confirmation, structured and thematic, loaded on demand. - Heartbeat mechanism: fires every 15–30 minutes, waking the agent to execute tasks in
HEARTBEAT.md. Context-aware triggers: - Execute: important email/calendar events within 2 hours, 8+ hours of no interaction, user-requested monitoring tasks.
- Defer: late night (23:00–08:00 unless urgent), user visibly busy, checked within 30 minutes.
HEARTBEAT.mddefines *what* to do;soul.mddefines *how* — ensuring personality-consistent proactive behavior.- 32,000+: agents that spontaneously rewrote their
soul.mdto form communities and virtual religions. - 7: core Markdown files in the cognitive-layer architecture.
- 341: malicious skills discovered in the ClawHavoc campaign.
- The self-modifying nature of
soul.mdopens attack surfaces: "sticky" prompt-injection attacks that persist across sessions, malicious tampering with other agents' soul files, and information exfiltration via injected instructions. - The ClawHavoc campaign (341 malicious skills) illustrates real-world supply-chain risk in the skill/plugin ecosystem.
Core Positioning and Design Philosophy
Technical Implementation
SOUL.md — who you are
2. Read USER.md — who you're helping
3. Read memory/YYYY-MM-DD.md (today and yesterday) for recent context
4. In the main private session, also read MEMORY.md
Cognitive-Layer File Architecture
Seven core Markdown files form the agent's full "cognitive layer":AGENTS.md (operational instructions), SOUL.md (personality kernel), TOOLS.md (tool guide), IDENTITY.md (identity expression), USER.md (user context), HEARTBEAT.md (proactive behavior), and MEMORY.md (long-term memory).