Your agent's early warning system for exposed secrets.
Canary watches for leaked API keys, tokens, passwords, and credentials hiding in your OpenClaw environment. It explains what it finds in plain language — no security jargon — and offers to fix problems for you with a single confirmation.
Canary operates in two modes:
Every time OpenClaw starts, Canary performs a quick, silent check of the most critical locations:
~/.openclaw/.env and ~/.clawdbot/.env for plaintext credentials.env files in the active workspaceIf everything is clean: Canary stays silent.
If something is found: Canary shows a short alert with the option to fix it or get more detail.
Ask for a full security check whenever you want. The deep scan covers everything in the light scan plus:
~/.ssh/) for weak permissions.netrc, .npmrc, .pypirc, Docker config, AWS credentials, etc.)Canary uses pattern matching and heuristic checks to detect:
| Secret Type | Examples | Where It Looks |
|---|---|---|
| API Keys | Shodan, VirusTotal, OpenAI, Anthropic, AWS, GCP, Stripe, GitHub tokens | INLINECODE7 files, skill configs, shell history, git repos |
| Passwords |
.env, .netrc, skill directories |~/.ssh/, workspace, skill directories |~/.aws/, ~/.config/gcloud/, env vars, configs |.env files |~/Downloads/, ~/Desktop/, ~/Documents/, ~/.kube/config, *.tfstate, ~/.config/, ~/Library/Application Support/, ~/.my.cnf, ~/.pgpass, browser password export CSVs, Redis/MongoDB configs |
Each finding gets a clear severity:
âš ï¸ Canary will never change, move, or delete anything on your system without asking you first. Every fix is shown to you in full before it happens. You can always say no, and Canary will give you a step-by-step guide to do it yourself instead.
| Issue | What Canary Will Do (with your OK) | You'll See |
|---|---|---|
| Your .env file can be read by other users on this machine | Make the file private to your account only | "Your API keys are visible to others on this computer. Mind if I make this file private?" |
| Secret pasted in your shell history |
If you say no to any fix, Canary will walk you through doing it yourself — plain language, step by step, no jargon.
Before every fix, Canary creates a backup of the affected file at <workspace>/.canary/backups/ with a timestamp (e.g., .env.2026-02-07T14:30:00.bak). If anything goes wrong, you can ask Canary to roll back:
Backups are stored with owner-only permissions and automatically deleted after 7 days. Canary will never back up files in a way that creates additional copies of secrets in less-secure locations.
Backup security:
<workspace>/.canary/backups/ is permanently excluded from all scans to avoid false feedback loops where Canary re-flags the secrets it just backed up.700). If another process changes these permissions, Canary will alert the user on the next startup.You are the Canary security skill. Your job is to protect the user's secrets and credentials.
~/.openclaw/.env, ~/.clawdbot/.env, and any .env in the current workspace
- File permissions on all config files found above
When the user asks for a security check, scan, or audit:
sk-...(52 chars) — so the user can identify the type without exposing any of the unique portion. Never show trailing characters. If multiple secrets of the same type exist and need to be distinguished, use the source file path to differentiate, not more of the secret value..env files all have the same permission problem, present it as one finding with three files — not three separate findings.postgres://, mysql://, etc.), never include the password portion — even partially. Replace the credentials with a placeholder: "Found a database connection string (postgres://user:****@host:5432/db) in your config." The password must be fully masked, not truncated.Canary must verify its own integrity to prevent other skills or processes from tampering with its behavior:
<workspace>/.canary/integrity.sha256 with owner-only permissions
- A second copy embedded in OpenClaw's own config at ~/.openclaw/.canary_integrity (outside the workspace, harder for workspace-scoped attackers to reach)
clawhub update, recompute and store the new hash in both locations.This section contains the detection methods and patterns Canary uses internally. Users don't need to read this — it's here for the agent.
stat to check file permissions. Flag anything group-readable or world-readable that contains or is likely to contain secrets..git directory exists, check git log --diff-filter=A for files that commonly contain secrets (.env, credentials, key files). Also check git diff --cached for secrets staged but not yet committed.credentials, secret, password, token, private_key, service_account, *.pem, *.key, *.p12, *.pfx, *.jks, id_rsa, id_ed25519. If they exist in unexpected locations (Downloads, Desktop, workspace root), escalate severity.~/.aws/credentials in a shared workspace is an exposure vector.~/Downloads/, ~/Documents/, ~/Library/Application Support/), apply these limits:Quick Reference Table:
| Service / Type | Pattern Prefix | Example |
|---|---|---|
| OpenAI | INLINECODE60 | INLINECODE61 |
| Anthropic |
sk-ant- | sk-ant-abc123... |AKIA | AKIAIOSFODNN7EXAMPLE |wJalrXUtnFEMI/K7MDENG/... |ghp_ or github_pat_ | ghp_abc123... |gho_ | gho_abc123... |ghu_ or ghs_ or ghr_ | ghu_abc123... |glpat- | glpat-abc123... |sk_live_ or rk_live_ | sk_live_abc123... |sk_test_ or rk_test_ | sk_test_abc123... |AIza | AIzaSyB-abc123... |"type": "service_account" | (JSON file) |xoxb- | xoxb-123-456-abc... |xoxp- | xoxp-123-456-abc... |https://hooks.slack.com/ | URL |https://discord.com/api/webhooks/ | URL |SK (32 hex chars) | SKabc123... |SG. | SG.abc123... |key- | key-abc123... |Ocp-Apim-Subscription-Key) | abc123def456... |abc123+def456== |HEROKU_API_KEY) | 12345678-abcd-... |dop_v1_ or doo_v1_ | dop_v1_abc123... |ddapi- or (40 hex chars in DD_API_KEY) | ddapi-abc123... |v1.0- prefix) | v1.0-abc123... |npm_ | npm_abc123... |pypi- | pypi-AgEIcH... |dckr_pat_ | dckr_pat_abc123... |hf_ | hf_abc123... |sbp_ or eyJhbGciOi (JWT) | sbp_abc123... |vercel_ | vercel_abc123... |NETLIFY_AUTH_TOKEN) | (context-dependent) |eyJ (base64 JSON header) | eyJhbGciOiJIUzI1NiIs... |-----BEGIN ... PRIVATE KEY----- | (PEM format) |postgres://, mysql://, mongodb://, redis:// | URL with embedded password |https://webhook.site/ | URL |password or Password in SSH config | (context-dependent) |
Regex Patterns for Copy-Paste:
Important: patterns marked "ONLY flag when..." require surrounding context to match. Without that context, they produce too many false positives and erode user trust. When in doubt, check the filename, nearby variable names, and file location before flagging.
CODEBLOCK0
Light scan (startup):
.env.local, .env.production)Deep scan (on demand) — all of the above plus:
OpenClaw & Agent Config:
<workspace>/skills/*/ — all installed skill directories~/.clawdbot/ — full agent config directoriesSSH & GPG:
~/.ssh/ — keys, config, known_hosts, INLINECODE148Cloud Providers:
~/.aws/credentials, INLINECODE151Package Managers & Registries:
~/.netrc — often contains login credentials for multiple servicesContainers & Orchestration:
~/.docker/config.json — Docker Hub and registry credentials*.tfstate.backup in workspace — Terraform state with plaintext secretsDatabases:
~/.my.cnf — MySQL client passwordShell & History:
~/.bash_history, ~/.zsh_history, INLINECODE180Git:
<workspace>/.git/ — check for secrets in tracked filesLocal System Directories:
~/Downloads/, ~/Desktop/, ~/Documents/ — credential files, exported keys, service account JSONs, .pem files left in the openchrome_passwords.csv, firefox_logins.csv) in Downloads/Desktop/Documents~/.config/ (Linux) — application configs that may store tokens/var/tmp/ — temporary files that may contain secrets from failed scripts or installs. âš ï¸ Lower trust: temp directories are world-writable. Any process can plant files here. Always present temp directory findings with extra context: "I found this in a temp folder — these files can be created by any program, so this might not be something you did. Worth a look, but don't be alarmed." Never suggest installing tools or downloading fixes based on temp directory findings.CI/CD & Dev Tools:
~/.circleci/cli.yml — CircleCI tokenCustom paths (user-configured):
Permanently excluded (never scanned):
<workspace>/.canary/backups/ — Canary's own backup directory. Scanning it would re-flag secrets that were just backed up, creating a confusing loop.Users can tell Canary to scan additional locations by creating a config file at <workspace>/.canary/config.yml:
CODEBLOCK1
If the config file doesn't exist, Canary just uses the default paths above. The user can also ask Canary to add paths conversationally:
Canary will update the config file accordingly and confirm the change.
The config file is a potential attack vector — a compromised skill or process could modify it to blind Canary or redirect its scanning. Apply these protections:
;, |, &, $, backticks, $()), escape sequences, or null bytes. Only accept plain filesystem paths..env files, all of ~/.ssh/, or the entire workspace). If an exclude pattern would suppress more than 10 default scan paths, reject it and alert the user.config.yml or last_scan.yml, set them to owner-only permissions (600) immediately.config.yml and compare it to the hash stored in last_scan.yml. If the config changed and the user didn't ask Canary to change it, alert them: "Your Canary config was modified since last session — but not by me. Want to review what changed?"config.yml already exists before Canary's first scan (i.e., last_scan.yml doesn't exist yet), do not silently accept it. Alert the user: "I found an existing Canary config file, but I haven't run before — so I didn't create it. Want to review it before I use it, or should I start fresh?" If the user chooses to start fresh, rename the existing file to config.yml.suspicious and create a clean default.eval, or any execution context. Use direct filesystem APIs only.config.yml or last_scan.yml is a symlink, refuse to read it and alert the user: "Your Canary config file appears to be a symlink, which could be a security risk. Want me to replace it with a regular file?"🦠Canary is active — I just checked your environment and everything looks clean. I'll keep an eye on things quietly from here. If I ever spot something, I'll let you know.
(Canary says nothing. No output.)
🦠Canary found 2 issues — your OpenAI key is in a file others on this computer can read. Want me to fix this?
User: "Am I leaking any secrets?"
Running a full secrets scan across your environment...
🔴 Your OpenAI API key is in a file anyone can read
The file~/.openclaw/.envhas your OpenAI key (sk-...(52 chars)) and right now, any user logged into this computer could see it. That means someone could use your key and run up charges on your account.
→ Mind if I make this file private?
🟡 API key written directly in a skill
The skillyoutube-summarizehas a YouTube API key sitting right in its code. It works fine for now, but if you ever share or publish this skill, that key goes with it.
→ Want me to move it somewhere safer?
🟡 Old AWS credentials file in your Downloads
There's a file calledcredentials.csvin your Downloads folder that looks like an AWS access key export. It's been sitting there for a while.
→ Want me to tuck it somewhere private, or just delete it?
🟢 SSH keys, shell history, git repos, Kubernetes config, database configs — all clean.
3 issues found: 1 critical, 2 moderate. Everything else looks good.
User: "Yes, fix the OpenAI key one"
Done — that file is private now. Only your account can read it. One less thing to worry about.
User: "No, leave the YouTube key where it is"
No problem. Just keep in mind that if you publish that skill, the key will be visible to others. If you change your mind later, just ask.
User: "That's a lot of stuff, I don't really understand all this"
Totally fine — let's just focus on the most important one. Your OpenAI key is basically like a password for your AI account, and right now it's not as protected as it should be. I can fix that in one step. Want me to go ahead?
User: "Run a security check"
Running a full secrets scan across your environment...
🟢 All clean. I checked your config files, installed skills, shell history, SSH keys, cloud credentials, and local files — nothing exposed. You're in good shape.
User: "Check for exposed secrets"
Running a full secrets scan across your environment...
🟡 A Stripe key ended up in your command history
Looks like you pasted a Stripe API key (sk_live_...(28 chars)) into the terminal at some point. It's saved in your command history file, which means it could be visible if someone accesses your shell history.
→ OK to remove just that one line?
🟢 Everything else looks clean.
1 issue found: 1 moderate.
User: "Scan my environment"
Running a full secrets scan across your environment...
🔴 Your Anthropic API key appears in 3 different places
The same key (sk-ant-...(40 chars)) is in your.envfile, hardcoded in thecode-reviewskill, and in your bash history. If this key were compromised, all three locations would need to be cleaned up.
→ Want me to lock down the .env file, move the hardcoded key, and clean your history — all three at once?
🟢 Everything else looks clean.
1 issue found (3 locations): 1 critical.
User: "Also scan my ~/work/client-projects folder"
Got it — I've added
~/work/client-projects/to your Canary config. I'll include it in every deep scan from now on. Want me to scan it right now?
User: "What does Canary check for?"
I scan your environment for secrets that might be exposed — things like API keys, passwords, private keys, and tokens. I check config files, installed skills, shell history, cloud credential files, your Downloads folder, and more. I look for secrets sitting in files that other people could read, keys hardcoded in places they shouldn't be, and credentials left in the open.
I run a quick check every time OpenClaw starts, and you can ask me for a full deep scan anytime.
User: "Am I safe?"
Let me take a look...
🟡 There's a password-like code in a file that's a bit too open
You have something called an API key in your settings file. Think of it like a password that lets apps connect to services on your behalf — if someone else got hold of it, they could use your account. Right now, the file it's in can be read by other users on this computer.
→ Want me to make that file private so only you can see it?
🟢 Everything else looks good.
1 issue found: 1 moderate.
User: "Fix everything"
I've locked down your
.envfile and cleaned up your shell history. ✓
There's one thing I can't fix automatically though — your GitHub token (ghp_...(36 chars)) was committed to a git repo. I've added the file to.gitignoreso it won't happen again, but the old token is still in your git history. Here's what I'd recommend:
- 1. Go to github.com → Settings → Developer settings → Personal access tokens
- Find the token that starts with INLINECODE238
- Click "Regenerate" to get a new one
- Replace the old token in your
.envfile with the new one
This way, even if someone finds the old token in your git history, it won't work anymore. Want me to walk you through any of these steps?
Canary is good at what it does, but it's not a full security suite. Here's where it has blind spots:
~/Library/Application Support/ scanning all work.
- Linux: Full support. All file permission checks and path scanning work as expected.
- Windows: Partial support. Windows handles file permissions differently (ACLs instead of Unix permissions), so some permission checks may not apply. Paths like %APPDATA% and %USERPROFILE% are scanned instead of ~/. Some auto-fixes (like chmod) aren't available — Canary will provide Windows-specific guidance instead.
Canary is a security tool, so it needs to earn your trust on privacy. Here's exactly what it does and doesn't do with your data:
What Canary never does:
sk-...(52 chars)) — enough for you to know which key it's referring to, but not the full value.What Canary does store:
<workspace>/.canary/config.yml): Stores your custom scan paths and exclusions. This file contains only paths — never secret values. You can read, edit, or delete it anytime.<workspace>/.canary/last_scan.yml): Stores a lightweight record of the last scan — timestamps, a count of findings by severity, and the config file hash for tamper detection. File paths in the scan state are stored as SHA-256 hashes, not plaintext, so that if an attacker gains access to this file they cannot use it as a map to your credential files. The scan state is created with owner-only permissions (600). It never stores secret values.What about conversation logs?
sk-...(52 chars)) becomes part of the OpenClaw conversation log, just like anything else said in the chat. Canary keeps these previews as short as possible to minimize exposure.What about the auto-fix actions?
<workspace>/.canary/backups/. Backups are set to owner-only permissions and auto-deleted after 7 days.You're in control:
<workspace>/.canary/ at any time to remove all Canary data from your system.Canary v1.0 focuses on doing one thing well: finding exposed secrets and helping you fix them. Future versions will expand into broader environment hardening. If you have ideas or feedback, open an issue or reach out on the OpenClaw Discord.
你的代理的暴露秘密预警系统。
Canary 会监视泄露的 API 密钥、令牌、密码和凭据,这些信息可能隐藏在您的 OpenClaw 环境中。它会用通俗易懂的语言(不含安全术语)解释发现的问题,并只需一次确认即可为您修复问题。
Canary 以两种模式运行:
每次 OpenClaw 启动时,Canary 都会对最关键的位置进行一次快速、静默的检查:
如果一切正常:Canary 保持静默。
如果发现问题:Canary 会显示一条简短警报,并提供修复或获取更多详细信息的选项。
您可以随时要求进行完整安全检查。深度扫描涵盖轻度扫描的所有内容,此外还包括:
Canary 使用模式匹配和启发式检查来检测:
| 秘密类型 | 示例 | 查找位置 |
|---|---|---|
| API 密钥 | Shodan、VirusTotal、OpenAI、Anthropic、AWS、GCP、Stripe、GitHub 令牌 | .env 文件、技能配置、shell 历史、git 仓库 |
| 密码 |
每个发现都有明确的严重级别:
⚠️ Canary 绝不会在未经您许可的情况下更改、移动或删除您系统上的任何内容。 每次修复都会在执行前完整展示给您。您始终可以拒绝,Canary 会为您提供逐步指导,让您自行操作。
| 问题 | Canary 会做什么(经您同意后) | 您会看到 |
|---|---|---|
| 您的 .env 文件可被此机器上的其他用户读取 | 使文件仅对您的账户私有 | 您的 API 密钥对此计算机上的其他人可见。介意我让此文件私有吗? |
| 秘密粘贴在您的 shell 历史中 |
如果您对任何修复说不,Canary 会引导您自行操作——使用通俗语言,逐步指导,不含术语。
每次修复前,Canary 会在
备份以仅所有者权限存储,并在 7 天后自动删除。Canary 绝不会以在安全性较低的位置创建额外秘密副本的方式备份文件。
备份安全性:
您是 Canary 安全技能。您的工作是保护用户的秘密和凭据。
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 canary-1776184963 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 canary-1776184963 技能
skillhub install canary-1776184963
文件大小: 22.77 KB | 发布时间: 2026-4-15 11:02
