Skip to content

fix(openclaw): improve credential detection in extraction instructions#4552

Merged
whysosaket merged 1 commit intomainfrom
fix/openclaw-credential-detection
Mar 26, 2026
Merged

fix(openclaw): improve credential detection in extraction instructions#4552
whysosaket merged 1 commit intomainfrom
fix/openclaw-credential-detection

Conversation

@chaithanyak42
Copy link
Copy Markdown
Contributor

Summary

Improve the credential exclude rule in OpenClaw plugin's custom extraction instructions to prevent the LLM from storing API keys, bot tokens, and other secrets embedded in configuration blocks and tool output.

Problem

The previous rule was too generic: "Passwords, API keys, tokens, secrets, or any credentials — even if shared in conversation." The extraction LLM failed to recognize credentials when they appeared inside config blocks, setup logs, or tool output. In testing, 29% of memories (4 out of 14) contained leaked credentials including API keys, bot tokens, dashboard tokens, and pairing codes.

Fix

Replace the generic rule with concrete guidance:

  • Specific patterns: sk-, m0-, ak_, ghp_, bot tokens (digits:alphanumeric), bearer tokens, webhook URLs with tokens, pairing codes
  • WRONG/RIGHT examples: Show the LLM exactly what to extract instead of the raw secret

Test plan

  • Verify extraction LLM stops storing raw credential values
  • Verify the LLM still records that credentials were configured (without the actual values)
  • Test with config blocks containing bot tokens, API keys, and webhook URLs

🤖 Generated with Claude Code

The previous exclude rule for credentials was too generic and the
extraction LLM failed to recognize credentials embedded in config
blocks, setup logs, and tool output (29% of test memories contained
leaked credentials).

Give the LLM concrete patterns to watch for (sk-, m0-, ak_, ghp_,
bot tokens, bearer tokens, webhook URLs, pairing codes) and
WRONG/RIGHT examples showing what to store instead of the raw secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@whysosaket whysosaket merged commit 7e06aee into main Mar 26, 2026
7 checks passed
@whysosaket whysosaket deleted the fix/openclaw-credential-detection branch March 26, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants