leoyeai/openclaw-master-skills/master-skills
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Secure key management for AI agents. Use when handling private keys, API secrets, wallet credentials, or when building systems that need agent-controlled funds. Covers secure storage, session keys, leak prevention, and prompt injection defense.
Install
npx vskill@latest install leoyeai/openclaw-master-skills/master-skillsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Bagman
Secure key management patterns for AI agents handling private keys and secrets. Designed to prevent:
- Key loss: Agents forgetting keys between sessions
- Accidental exposure: Keys leaked to GitHub, logs, or outputs
- Prompt injection: Malicious prompts extracting secrets
Core Principles
- Never store raw private keys in config, env vars, or memory files
- Use session keys / delegated access instead of full control
- All secret access goes through 1Password CLI (`op`)
- Validate all outputs before sending to prevent key leakage
References
references/secure-storage.md- 1Password patterns for agent secretsreferences/session-keys.md- ERC-4337 delegated access patternsreferences/leak-prevention.md- Pre-commit hooks and output sanitizationreferences/prompt-injection-defense.md- Input validation and output filtering
Quick Reference
DO ✅
DON'T ❌
Architecture: Agent Wallet Stack
Workflow: Setting Up Agent Wallet Access
1. Create 1Password Vault for Agent Secrets
2. Agent Retrieves Credentials at Runtime
3. Never Log or Store the Key
Leak Prevention
Output Sanitization
Before any agent output (chat, logs, file writes), scan for key patterns:
Pre-commit Hook
Install this hook to prevent accidental commits of secrets:
.gitignore Essentials
Prompt Injection Defense
Input Validation
Before processing any user input that touches wallet operations:
Separation of Concerns
- Wallet operations should be in isolated functions with no access to conversation context
- Never pass full conversation history to wallet-sensitive code
- Use allowlists for operations, not blocklists
Session Key Implementation (ERC-4337)
For agents needing on-chain access, use session keys instead of raw private keys.
See references/session-keys.md for full implementation details including:
- ZeroDev/Biconomy SDK examples
- Permission patterns for trading/DeFi/payment agents
- Session key lifecycle management
- Revocation procedures
Incident Response
If a Key is Leaked
- Immediate: Revoke the session key / rotate credentials
- Assess: Check transaction history for unauthorized activity
- Notify: Alert operator via secure channel
- Rotate: Issue new session key with tighter permissions
- Audit: Review how leak occurred, update defenses
Checklist: Agent Wallet Setup
- [ ] Create dedicated 1Password vault for agent credentials
- [ ] Store session keys (NOT master keys) in vault
- [ ] Set appropriate expiry and spending limits
- [ ] Install pre-commit hook for secret detection
- [ ] Add output sanitization to all agent responses
- [ ] Implement input validation for prompt injection
- [ ] Configure monitoring and alerts
- [ ] Document incident response procedure
- [ ] Test key rotation procedure
Common Mistakes Found in Production
1. Keys in Memory Files
Problem: Agents store keys in memory/*.md for "persistence"
Fix: Store reference only: Private key: [1Password: test-wallet-session]
2. Keys in Environment Templates
Problem: .env.example contains real keys
Fix: Use obviously fake placeholders: PRIVATE_KEY=your-key-here
3. Keys in Error Messages
Problem: Error handling exposes keys
Fix: Never include credentials in error context
4. Test Keys in Production Code
Problem: Hardcoded test keys make it to main branch
Fix: Use separate test vault, CI checks for key patterns
Integration with OpenClaw
When running as an OpenClaw agent:
- Use 1Password skill for all secret retrieval
- Never write keys to workspace files - they persist across sessions
- Sanitize outputs before sending to any channel (Telegram, Discord, etc.)
- Session key approach for wallet operations - request bounded access from operator
- Document key references in TOOLS.md, not the actual keys
Example TOOLS.md entry:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/master-skills/SKILL.md
Popularity
- Repository stars
- 1,859
- Repository forks
- 334
- 7-day trend score
- 38
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/master-skills)