Bug Description
config.get correctly redacts sensitive values in the parsed field (replacing them with __OPENCLAW_REDACTED__), but the sourceConfig and runtimeConfig fields in the same response contain plaintext API keys, bot tokens, and gateway auth tokens.
This means any agent session that calls config.get receives all credentials in cleartext within its context window, and they get persisted in session log files (.jsonl).
Steps to Reproduce
- Configure OpenClaw with API keys in
openclaw.json (providers, bot tokens, etc.)
- In any agent session, call the
config.get tool
- Observe that
parsed fields show __OPENCLAW_REDACTED__ ✅
- Observe that
sourceConfig and runtimeConfig fields contain plaintext keys ❌
Expected Behavior
All three fields (parsed, sourceConfig, runtimeConfig) should apply the same redaction logic for sensitive values.
Impact
- Credentials exposed to agent context windows
- Credentials persisted in session log files on disk
- Potential for accidental leakage if session logs are shared or backed up
Environment
- OpenClaw version: 2026.4.1
- OS: macOS (Apple Silicon)
Bug Description
config.getcorrectly redacts sensitive values in theparsedfield (replacing them with__OPENCLAW_REDACTED__), but thesourceConfigandruntimeConfigfields in the same response contain plaintext API keys, bot tokens, and gateway auth tokens.This means any agent session that calls
config.getreceives all credentials in cleartext within its context window, and they get persisted in session log files (.jsonl).Steps to Reproduce
openclaw.json(providers, bot tokens, etc.)config.gettoolparsedfields show__OPENCLAW_REDACTED__✅sourceConfigandruntimeConfigfields contain plaintext keys ❌Expected Behavior
All three fields (
parsed,sourceConfig,runtimeConfig) should apply the same redaction logic for sensitive values.Impact
Environment