| name | exa-security-basics |
| description | Secure Exa API keys, implement content moderation, and manage domain restrictions.
Use when securing API keys, auditing Exa security configuration,
or implementing content safety filtering.
Trigger with phrases like "exa security", "exa secrets",
"secure exa", "exa API key security", "exa content moderation".
|
| allowed-tools | Read, Write, Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","exa","api","security"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Exa Security Basics
Overview
Security best practices for Exa API integrations. Exa authenticates via the x-api-key header. Key security concerns include API key protection, content moderation for search results, domain filtering to prevent exposure to malicious sources, and query sanitization.
Prerequisites
- Exa API key from dashboard.exa.ai
- Understanding of environment variable management
.gitignore configured for secrets
Instructions
Step 1: API Key Management
EXA_API_KEY=your-api-key-here
.env
.env.local
.env.*.local
import Exa from "exa-js";
function createSecureClient(): Exa {
const apiKey = process.env.EXA_API_KEY;
if (!apiKey) {
throw new Error("EXA_API_KEY not configured");
}
if (apiKey.startsWith("sk_") && apiKey.length < 20) {
throw new Error("EXA_API_KEY appears malformed");
}
return new Exa(apiKey);
}
Step 2: Enable Content Moderation
const exa = (process..);
results = exa.(
,
{
: ,
: ,
: ,
}
);