Clay Security Basics

VerifiedSafe

Apply Clay security best practices for secrets and access control. Use when securing API keys, implementing least privilege access, or auditing Clay security configuration.

Sby Skills Guide Bot
SecurityIntermediate
7/26/2026
Claude CodeCodex
#secrets-management#api-keys#access-control#clay#least-privilege

Recommended for

Automated summary

This skill provides security best practices for protecting Clay API keys and access, covering secret rotation, least privilege, and audit logging.

Strengths

  • Covers the full secret lifecycle: environment-variable storage, rotation, and revocation
  • Includes a recommended scope table per environment (dev, staging, production) to enforce least privilege
  • Ships concrete TypeScript snippets, including webhook signature verification with timingSafeEqual
  • Provides a reusable security checklist and an audit-logging pattern

Limitations

  • Highly Clay-specific: examples don't transfer directly to other platforms
  • Relies on manual dashboard steps rather than automated exposed-key scanning
  • The audit-logging example is basic (console plus track) and does not address regulatory compliance in depth
When to use it

Use it when setting up or auditing API key management and permission scoping for a Clay project.

When not to use it

Avoid it if you need a general cross-platform security framework or automated secret scanning in CI.

Security analysis

Safe
Quality score82/100

The skill only contains defensive security guidance: storing API keys in environment variables, rotating secrets, applying least privilege, verifying webhook signatures, and audit logging. The single curl call targets api.clay.com's health endpoint with the user's own token for verification—a legitimate use—and there are no destructive commands, exfiltration, obfuscated payloads, or attempts to disable safety controls.

No concerns found

How this analysis is made

Examples

Secure Clay API keys
Help me move my Clay API keys into environment variables and add the right .gitignore entries so nothing gets committed.
Least privilege per environment
Apply least privilege to my Clay setup: give me recommended scopes for dev, staging, and production, and a service account pattern for read vs write.
Audit Clay security config
Audit my Clay security configuration against your checklist, and tell me if my webhook signature verification is correct.

name: clay-security-basics description: | Apply Clay security best practices for secrets and access control. Use when securing API keys, implementing least privilege access, or auditing Clay security configuration. Trigger with phrases like "clay security", "clay secrets", "secure clay", "clay API key security". allowed-tools: Read, Write, Grep version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io compatible-with: claude-code, codex, openclaw

Clay Security Basics

Overview

Security best practices for Clay API keys, tokens, and access control.

Prerequisites

  • Clay SDK installed
  • Understanding of environment variables
  • Access to Clay dashboard

Instructions

Step 1: Configure Environment Variables

# .env (NEVER commit to git)
CLAY_API_KEY=sk_live_***
CLAY_SECRET=***

# .gitignore
.env
.env.local
.env.*.local

Step 2: Implement Secret Rotation

set -euo pipefail
# 1. Generate new key in Clay dashboard
# 2. Update environment variable
export CLAY_API_KEY="new_key_here"

# 3. Verify new key works
curl -H "Authorization: Bearer ${CLAY_API_KEY}" \
  https://api.clay.com/health

# 4. Revoke old key in dashboard

Step 3: Apply Least Privilege

| Environment | Recommended Scopes | |-------------|-------------------| | Development | read:* | | Staging | read:*, write:limited | | Production | Only required scopes |

Output

  • Secure API key storage
  • Environment-specific access controls
  • Audit logging enabled

Error Handling

| Security Issue | Detection | Mitigation | |----------------|-----------|------------| | Exposed API key | Git scanning | Rotate immediately | | Excessive scopes | Audit logs | Reduce permissions | | Missing rotation | Key age check | Schedule rotation |

Examples

Service Account Pattern

const clients = {
  reader: new ClayClient({
    apiKey: process.env.CLAY_READ_KEY,
  }),
  writer: new ClayClient({
    apiKey: process.env.CLAY_WRITE_KEY,
  }),
};

Webhook Signature Verification

import crypto from 'crypto';

function verifyWebhookSignature(
  payload: string, signature: string, secret: string
): boolean {
  const expected = crypto.createHmac('sha256', secret).update(payload).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}

Security Checklist

  • [ ] API keys in environment variables
  • [ ] .env files in .gitignore
  • [ ] Different keys for dev/staging/prod
  • [ ] Minimal scopes per environment
  • [ ] Webhook signatures validated
  • [ ] Audit logging enabled

Audit Logging

interface AuditEntry {
  timestamp: Date;
  action: string;
  userId: string;
  resource: string;
  result: 'success' | 'failure';
  metadata?: Record<string, any>;
}

async function auditLog(entry: Omit<AuditEntry, 'timestamp'>): Promise<void> {
  const log: AuditEntry = { ...entry, timestamp: new Date() };

  // Log to Clay analytics
  await clayClient.track('audit', log);

  // Also log locally for compliance
  console.log('[AUDIT]', JSON.stringify(log));
}

// Usage
await auditLog({
  action: 'clay.api.call',
  userId: currentUser.id,
  resource: '/v1/resource',
  result: 'success',
});

Resources

Next Steps

For production deployment, see clay-prod-checklist.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/clay-security-basics-ms1aw5qq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/clay-security-basics-ms1aw5qq/download' --output '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md.part' && mv '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md.part' '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Grep

Original excerpt: Prerequisites
  • Clay SDK installed
  • Understanding of environment variables
  • Access to Clay dashboard

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md' && test -s '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/clay-security-basics' && cp -R '.skill-downloads/clay-security-basics-ms1aw5qq' '.claude/skills/clay-security-basics'

Codex
test -f '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md' && test -s '.skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/clay-security-basics' && cp -R '.skill-downloads/clay-security-basics-ms1aw5qq' '.agents/skills/clay-security-basics'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/clay-security-basics-ms1aw5qq'

openskills read 'clay-security-basics-ms1aw5qq'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/clay-security-basics-ms1aw5qq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills