clay-security-basics
Apply Clay security best practices for API keys, webhook secrets, and data access control. Use when securing Clay integrations, rotating API keys, auditing access, or implementing webhook authentication. Trigger with phrases like "clay security", "clay secrets", "secure clay", "clay API key security", "clay webhook security".
Best use case
clay-security-basics is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Apply Clay security best practices for API keys, webhook secrets, and data access control. Use when securing Clay integrations, rotating API keys, auditing access, or implementing webhook authentication. Trigger with phrases like "clay security", "clay secrets", "secure clay", "clay API key security", "clay webhook security".
Teams using clay-security-basics should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/clay-security-basics/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How clay-security-basics Compares
| Feature / Agent | clay-security-basics | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Apply Clay security best practices for API keys, webhook secrets, and data access control. Use when securing Clay integrations, rotating API keys, auditing access, or implementing webhook authentication. Trigger with phrases like "clay security", "clay secrets", "secure clay", "clay API key security", "clay webhook security".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Clay Security Basics
## Overview
Security best practices for Clay integrations covering API key management, webhook endpoint security, provider credential isolation, and lead data protection. Clay handles sensitive PII (emails, phone numbers, LinkedIn profiles) at scale, making security critical.
## Prerequisites
- Clay account with admin access
- Understanding of environment variables and secrets management
- Access to deployment platform's secrets manager
## Instructions
### Step 1: Secure API Key Storage
```bash
# .env (NEVER commit to git)
CLAY_API_KEY=clay_ent_your_api_key_here
CLAY_WEBHOOK_URL=https://app.clay.com/api/v1/webhooks/your-id
# .gitignore — add these patterns
.env
.env.local
.env.*.local
*.key
```
For production, use your platform's secrets manager:
```bash
# GitHub Actions
gh secret set CLAY_API_KEY --body "clay_ent_your_key"
# Google Cloud Secret Manager
echo -n "clay_ent_your_key" | gcloud secrets create clay-api-key --data-file=-
# AWS Secrets Manager
aws secretsmanager create-secret \
--name clay/api-key \
--secret-string "clay_ent_your_key"
```
### Step 2: Authenticate Incoming Webhook Callbacks
When Clay's HTTP API columns call your endpoint, validate the request origin:
```typescript
// src/middleware/clay-auth.ts
import crypto from 'crypto';
const CLAY_WEBHOOK_SECRET = process.env.CLAY_WEBHOOK_SECRET!;
function verifyClayCallback(
payload: string,
signature: string | undefined
): boolean {
if (!signature || !CLAY_WEBHOOK_SECRET) return false;
const expected = crypto
.createHmac('sha256', CLAY_WEBHOOK_SECRET)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expected, 'hex')
);
}
// Express middleware
function clayAuthMiddleware(req: any, res: any, next: any) {
const signature = req.headers['x-clay-signature'] as string;
const rawBody = JSON.stringify(req.body);
if (!verifyClayCallback(rawBody, signature)) {
console.warn('Rejected unauthorized Clay callback from', req.ip);
return res.status(401).json({ error: 'Invalid signature' });
}
next();
}
```
### Step 3: Isolate Provider API Keys
Connect provider keys directly in Clay (Settings > Connections) rather than passing them through your application. This keeps provider credentials out of your codebase:
| Provider | Where to Store Key | Why |
|----------|-------------------|-----|
| Apollo | Clay Settings > Connections | 0 credits when using own key |
| Clearbit | Clay Settings > Connections | 0 credits when using own key |
| Hunter.io | Clay Settings > Connections | 0 credits when using own key |
| HubSpot | Clay Settings > Connections | CRM sync uses Clay's OAuth |
| Salesforce | Clay Settings > Connections | CRM sync uses Clay's OAuth |
### Step 4: API Key Rotation Procedure
```bash
# 1. Generate new key in Clay Settings > API
# 2. Update all integrations with new key
# 3. Test connectivity
curl -s -X POST "https://api.clay.com/v1/people/enrich" \
-H "Authorization: Bearer $NEW_CLAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com"}' | jq .status
# 4. Once confirmed working, revoke old key in Clay dashboard
# 5. Update deployment secrets
gh secret set CLAY_API_KEY --body "$NEW_CLAY_API_KEY"
```
### Step 5: Protect Enriched Lead Data
```typescript
// src/clay/data-protection.ts
const PII_FIELDS = ['email', 'phone', 'personal_email', 'home_address', 'linkedin_url'];
/** Strip PII from enriched data before logging or analytics */
function redactPII(row: Record<string, unknown>): Record<string, unknown> {
const redacted = { ...row };
for (const field of PII_FIELDS) {
if (field in redacted) {
redacted[field] = '[REDACTED]';
}
}
return redacted;
}
/** Hash email for deduplication without storing plaintext */
function hashEmail(email: string): string {
return crypto.createHash('sha256').update(email.toLowerCase().trim()).digest('hex');
}
// Usage: log enriched data safely
console.log('Enriched:', redactPII(enrichedRow));
```
### Step 6: Security Checklist
- [ ] API keys stored in environment variables or secrets manager
- [ ] `.env` files in `.gitignore`
- [ ] Webhook callback endpoints validate request signatures
- [ ] Provider API keys connected in Clay UI (not in application code)
- [ ] API key rotation procedure documented and tested
- [ ] Enriched PII data redacted in application logs
- [ ] Clay workspace uses separate API keys per integration
- [ ] Least privilege: viewers can't run enrichments or export data
- [ ] No hardcoded Clay URLs or keys in source code
- [ ] git-secrets or similar scanning enabled in CI
## Error Handling
| Security Issue | Detection | Mitigation |
|----------------|-----------|------------|
| API key in git history | `git log -p --all -S 'clay_ent_'` | Rotate key immediately, use BFG to scrub |
| Unauthorized webhook calls | Missing signature validation | Add HMAC verification middleware |
| Over-permissioned users | Viewers running enrichments | Audit roles in Settings > Members |
| PII in application logs | grep logs for email patterns | Add PII redaction to log pipeline |
## Resources
- [Clay Plans & Billing](https://university.clay.com/docs/plans-and-billing)
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
## Next Steps
For production deployment, see `clay-prod-checklist`.Related Skills
performing-security-testing
Test automate security vulnerability testing covering OWASP Top 10, SQL injection, XSS, CSRF, and authentication issues. Use when performing security assessments, penetration tests, or vulnerability scans. Trigger with phrases like "scan for vulnerabilities", "test security", or "run penetration test".
checking-session-security
Analyze session management implementations to identify security vulnerabilities in web applications. Use when you need to audit session handling, check for session fixation risks, review session timeout configurations, or validate session ID generation security. Trigger with phrases like "check session security", "audit session management", "review session handling", or "session fixation vulnerability".
finding-security-misconfigurations
Configure identify security misconfigurations in infrastructure-as-code, application settings, and system configurations. Use when you need to audit Terraform/CloudFormation templates, check application config files, validate system security settings, or ensure compliance with security best practices. Trigger with phrases like "find security misconfigurations", "audit infrastructure security", "check config security", or "scan for misconfigured settings".
responding-to-security-incidents
Analyze and guide security incident response, investigation, and remediation processes. Use when you need to handle security breaches, classify incidents, develop response playbooks, gather forensic evidence, or coordinate remediation efforts. Trigger with phrases like "security incident response", "ransomware attack response", "data breach investigation", "incident playbook", or "security forensics".
analyzing-security-headers
Analyze HTTP security headers of web domains to identify vulnerabilities and misconfigurations. Use when you need to audit website security headers, assess header compliance, or get security recommendations for web applications. Trigger with phrases like "analyze security headers", "check HTTP headers", "audit website security headers", or "evaluate CSP and HSTS configuration".
generating-security-audit-reports
Generate comprehensive security audit reports for applications and systems. Use when you need to assess security posture, identify vulnerabilities, evaluate compliance status, or create formal security documentation. Trigger with phrases like "create security audit report", "generate security assessment", "audit security posture", or "PCI-DSS compliance report".
workhuman-security-basics
Workhuman security basics for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman security basics".
wispr-security-basics
Wispr Flow security basics for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr security basics".
windsurf-security-basics
Apply Windsurf security best practices for workspace isolation, data privacy, and secret protection. Use when securing sensitive code from AI indexing, configuring telemetry, or auditing Windsurf security posture. Trigger with phrases like "windsurf security", "windsurf secrets", "windsurf privacy", "windsurf data protection", "codeiumignore".
webflow-security-basics
Apply Webflow API security best practices — token management, scope least privilege, OAuth 2.0 secret rotation, webhook signature verification, and audit logging. Use when securing API tokens, implementing least privilege access, or auditing Webflow security configuration. Trigger with phrases like "webflow security", "webflow secrets", "secure webflow", "webflow API key security", "webflow token rotation".
vercel-security-basics
Apply Vercel security best practices for secrets, headers, and access control. Use when securing API keys, configuring security headers, or auditing Vercel security configuration. Trigger with phrases like "vercel security", "vercel secrets", "secure vercel", "vercel headers", "vercel CSP".
veeva-security-basics
Veeva Vault security basics for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva security basics".