security
Secret detection and credential scanning using gitleaks. Use when scanning repositories for leaked secrets, API keys, passwords, tokens, or implementing pre-commit security checks.
What this skill does
# Security: Secret Detection
This skill activates when performing secret detection, credential scanning, or implementing security checks for leaked sensitive data in code repositories.
## When to Use This Skill
Activate when:
- Scanning repositories for leaked secrets, API keys, or credentials
- Setting up pre-commit hooks for secret detection
- Auditing codebases for exposed passwords or tokens
- Implementing CI/CD security pipelines
- Checking git history for accidentally committed secrets
- Validating that .gitignore excludes sensitive files
## Pre-Commit Hook (Automatic)
When this skill is loaded, a pre-commit hook automatically scans staged files for secrets before every `git commit` command. This provides defense-in-depth by catching secrets before they enter git history.
### Hook Behavior
```
git commit -m "message"
↓
PreToolUse hook fires
↓
Extract staged files
↓
Run gitleaks --no-git
↓
┌─ Clean ─┴─ Secrets ─┐
↓ ↓
Allow Block commit
commit (exit code 2)
```
### What Gets Scanned
- Only **staged files** are scanned (not the entire working tree)
- Uses `.gitleaks-baseline.json` if present to ignore known false positives
- Uses `.gitleaks.toml` if present for custom detection rules
### When Secrets Are Detected
If the hook detects secrets, the commit is blocked with guidance:
```
[gitleaks] SECRETS DETECTED in staged files!
[gitleaks] Commit blocked. Remove secrets before committing.
[gitleaks]
[gitleaks] Options:
[gitleaks] 1. Remove the secret from the file
[gitleaks] 2. Use environment variables instead
[gitleaks] 3. Add to .gitleaks-baseline.json if false positive
```
### Container Runtime Requirements
The hook requires a container runtime to run gitleaks. It auto-detects:
1. **Apple Container** (macOS 26+)
2. **Docker** (Docker Desktop or Engine)
3. **Colima** via mise
If no runtime is available, the hook logs a warning and allows the commit.
## Agent Secret Safety
When agents interact with secrets (1Password, environment variables, keychains):
- **Never print secret values** in output, logs, or reports
- **Confirm existence only**: `test -n "$VAR" && echo "set" || echo "empty"`
- **Never use `--reveal`** in agent scripts — use it only in launcher scripts that don't capture output
- If a secret value is accidentally exposed in conversation context, the user must rotate it immediately
This applies to all agent tiers. A leaked secret in agent output forces credential rotation.
## When to Use security-review Instead
Use the `security-review` skill for:
- STRIDE threat modeling
- Security architecture reviews
- Vulnerability assessments
- Security documentation and reports
- Risk prioritization
- Attack surface analysis
| Task | Use `security` | Use `security-review` |
|------|---------------|----------------------|
| Scan for secrets in code | ✓ | |
| Detect leaked API keys | ✓ | |
| Pre-commit secret scanning | ✓ | |
| STRIDE threat modeling | | ✓ |
| Security architecture review | | ✓ |
| Vulnerability assessment | | ✓ |
| Security report documentation | | ✓ |
| Risk prioritization | | ✓ |
## Gitleaks
Gitleaks is an open-source tool for detecting secrets and sensitive information in git repositories. It scans commit history and file contents for patterns matching known secret formats.
### Common Secrets Detected
- AWS Access Keys and Secret Keys
- Google Cloud API Keys
- GitHub Personal Access Tokens
- Private Keys (RSA, SSH, PGP)
- Database Connection Strings
- JWT Tokens
- Stripe API Keys
- Slack Tokens
- Generic Passwords and API Keys
### Basic Usage
```bash
# Scan current directory
gitleaks detect --source="." -v
# Scan with JSON report
gitleaks detect --source="." -v --report-path=report.json --report-format=json
# Scan only staged changes (pre-commit)
gitleaks protect --staged
# Scan git history
gitleaks detect --source="." --log-opts="--all"
```
### Configuration
Create a `.gitleaks.toml` file to customize detection:
```toml
[extend]
# Extend default rules
useDefault = true
[[rules]]
id = "custom-api-key"
description = "Custom API Key Pattern"
regex = '''(?i)custom[_-]?api[_-]?key['\"]?\s*[=:]\s*['\"]([a-zA-Z0-9]{32,})'''
keywords = ["custom_api_key", "custom-api-key"]
[allowlist]
paths = [
'''\.gitleaks\.toml$''',
'''(.*)?test(.*)''',
'''\.git'''
]
regexes = [
'''EXAMPLE_.*''',
'''REDACTED'''
]
```
### Exit Codes
- `0`: No leaks found
- `1`: Leaks detected
- Other: Configuration or runtime error
## Scripts
This skill includes scripts for running gitleaks with automatic container runtime detection.
### gitleaks.nu (Nushell)
Cross-platform Nushell script with automatic runtime detection:
```bash
# Run with auto-detected runtime
nu scripts/gitleaks.nu
# Specify runtime
nu scripts/gitleaks.nu --runtime docker
nu scripts/gitleaks.nu --runtime container # Apple Container (macOS 26+)
nu scripts/gitleaks.nu --runtime colima
# Generate report
nu scripts/gitleaks.nu --report ./report.json
# Use custom config
nu scripts/gitleaks.nu --config ./.gitleaks.toml
# Scan specific path
nu scripts/gitleaks.nu --path ./src
```
### gitleaks.sh (Bash)
Bash script with the same capabilities:
```bash
# Run with auto-detected runtime
./scripts/gitleaks.sh
# Specify runtime
./scripts/gitleaks.sh --runtime docker
./scripts/gitleaks.sh -R container
# Generate report
./scripts/gitleaks.sh --report ./report.json
# Use custom config
./scripts/gitleaks.sh --config ./.gitleaks.toml
```
## Container Runtimes
The scripts support three container runtimes with automatic detection:
### Detection Priority
1. **Apple Container** (macOS 26+) - Native macOS containerization
2. **Docker** - Docker Desktop or Docker Engine
3. **Colima** - Lightweight container runtime via mise
### Apple Container (macOS 26+)
Native container support in macOS 26 and later:
```bash
# Check status
container system status
# Start runtime
container system start
# Run gitleaks
container run -v $(pwd):/code zricethezav/gitleaks detect --source="/code" -v
```
### Docker
Docker Desktop or Docker Engine:
```bash
# Check status
docker info >/dev/null 2>&1
# Start (macOS)
open -a Docker
# Run gitleaks
docker run -v $(pwd):/code zricethezav/gitleaks detect --source="/code" -v
```
### Colima via mise
Lightweight runtime managed through mise:
```bash
# Check status
mise exec colima@latest -- colima status
# Start runtime
mise exec colima@latest -- colima start
# Run gitleaks
mise exec colima@latest -- docker run -v $(pwd):/code zricethezav/gitleaks detect --source="/code" -v
```
Using `mise exec` provides automatic installation and version management without requiring global installation.
## Pre-Commit Integration
Add gitleaks to pre-commit hooks:
```yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
```
Install and run:
```bash
pre-commit install
pre-commit run gitleaks --all-files
```
## CI/CD Integration
### GitHub Actions
```yaml
name: Gitleaks
on: [push, pull_request]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### GitLab CI
```yaml
gitleaks:
stage: security
image: zricethezav/gitleaks:latest
script:
- gitleaks detect --source="." -v
allow_failure: false
```
## Baseline Management
Create a baseline to ignore known false positives:
```bash
# Generate baseline
gitleaks detect --source="." -v --baseline-path=.gitleaks-baseline.json
# Scan using baseline
gitleaks detect --source="." -v --baseline-path=.gitleaks-baseline.json
```
Add `.gitleaks-baseline.json` to version control to track acknowledged findings.
## Best Practices
### Shift-Left Security
- Enable gitleaks in pre-commit hooks to catch secrets before they eRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.