mirror of
https://github.com/openclaw/trust.git
synced 2026-07-25 18:25:28 -04:00
[Threat] Workspace files injected into system prompt create credential storage honeypot #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zeroaltitude on GitHub (Feb 8, 2026).
Attack Scenario
OpenClaw loads user-editable workspace files (
TOOLS.md,AGENTS.md,SOUL.md,USER.md,HEARTBEAT.md,IDENTITY.md) into the system prompt every turn.TOOLS.mdis explicitly described as a place for "environment-specific" notes — camera names, SSH hosts, voice preferences, etc.In practice, users naturally store operational secrets here too: API keys, database passwords, keyring passwords, SSH passphrases. It's the obvious place to put "things my agent needs to know." The default
TOOLS.mdtemplate even has a "Secrets & Auth" section heading in some configurations.Once a secret is in a workspace file, it's in the system prompt on every single LLM API call — every user message, every heartbeat poll (~30 min cycles), every sub-agent spawn. This means:
Prompt injection extracts credentials, not just instructions. A successful direct or indirect injection (T-EXEC-001, T-EXEC-002) that gets the agent to disclose its system prompt now yields operational secrets — SSH passphrases, API keys, database credentials — not just the agent's personality and rules.
The exposure is continuous. Secrets are sent to the LLM API hundreds of times per day via heartbeats alone. They appear in API logs, session transcripts, and any monitoring/debugging output.
The platform's UX encourages this pattern.
TOOLS.mdis documented as the right place for operational specifics. There's no warning that its contents become part of every API call, and no detection for accidentally stored secrets.Affected Components
TOOLS.md,AGENTS.md, etc.)Severity
High. The underlying vulnerability (system prompt extraction) is rated Medium in the current threat model, but the practical impact is elevated because:
Evidence
We reproduced this in a real deployment.
TOOLS.mdcontained a plaintext keyring password loaded into the system prompt on every agent turn. The fix was to remove all secrets from workspace files and fetch them at runtime from a secret manager (1Password CLI via service account).Suggested Mitigations
Quick wins:
TOOLS.mdtemplate: "Never store secrets here — contents are sent to the LLM on every API call"Detection:
sk-ant-,sk-proj-,xoxb-,AKIA, etc.) before injecting into system promptArchitecture:
op://,env://, orsecret://references in workspace files that resolve at runtime rather than being embedded in the promptRelated Threats