| name | clay-security-basics |
| description | 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".
|
| allowed-tools | Read, Write, Edit, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","clay","api","security","audit"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
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
CLAY_API_KEY=clay_ent_your_api_key_here
CLAY_WEBHOOK_URL=https://app.clay.com/api/v1/webhooks/your-id
.env
.env.local
.env.*.local
*.key
For production, use your platform's secrets manager:
gh secret set CLAY_API_KEY --body "clay_ent_your_key"
echo -n "clay_ent_your_key" | gcloud secrets create clay-api-key --data-file=-
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:
import crypto from 'crypto';
const CLAY_WEBHOOK_SECRET = process.env.CLAY_WEBHOOK_SECRET!;
function verifyClayCallback(
payload: string,
signature: string | undefined
): {
(!signature || !) ;
expected = crypto
.(, )
.(payload)
.();
crypto.(
.(signature, ),
.(expected, )
);
}
() {
signature = req.[] ;
rawBody = .(req.);
(!(rawBody, signature)) {
.(, req.);
res.().({ : });
}
();
}