/hex-pack:hex-security-basicsfrom hex-pack
Applies Hex security best practices for API key management, webhook verification, input validation, and data protection. Use when securing Hex projects or auditing access controls.
Ships in hex-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Hex is a collaborative data analytics platform where notebooks query production databases, generate visualizations, and share results across teams. Security concerns center on API token management (read vs run scopes), protecting database connection credentials embedded in Hex projects, and ensuring query results containing sensitive business data are not leaked through logs or exports. A compromised run-scope token can trigger arbitrary queries against connected databases.
function createHexClient(scope: "read" | "run"): { token: string; baseUrl: string } {
const envVar = scope === "run" ? "HEX_RUN_TOKEN" : "HEX_READ_TOKEN";
const token = process.env[envVar];
if (!token) {
throw new Error(`Missing ${envVar} — store in secrets manager, never in code`);
}
// Run tokens can trigger queries — use read tokens for monitoring
console.log(`Hex client initialized with ${scope} scope (token suffix: ${token.slice(-4)})`);
return { token, baseUrl: "https://app.hex.tech/api/v1" };
}
import crypto from "crypto";
import { Request, Response, NextFunction } from "express";
function verifyHexWebhook(req: Request, res: Response, next: NextFunction): void {
const signature = req.headers["x-hex-signature"] as string;
const secret = process.env.HEX_WEBHOOK_SECRET!;
const expected = crypto.createHmac("sha256", secret).update(req.body).digest("hex");
if (!signature || !crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
res.status(401).send("Invalid signature");
return;
}
next();
}
import { z } from "zod";
const HexRunRequestSchema = z.object({
project_id: z.string().uuid(),
input_params: z.record(z.string(), z.unknown()).optional(),
notify_on_completion: z.boolean().default(false),
update_cache: z.boolean().default(false),
});
function validateHexRunRequest(data: unknown) {
return HexRunRequestSchema.parse(data);
}
const HEX_SENSITIVE_FIELDS = ["db_connection_string", "query_results", "api_token", "input_params", "export_url"];
function redactHexLog(record: Record<string, unknown>): Record<string, unknown> {
const redacted = { ...record };
for (const field of HEX_SENSITIVE_FIELDS) {
if (field in redacted) redacted[field] = "[REDACTED]";
}
return redacted;
}
hex_token_* patterns| Vulnerability | Risk | Mitigation |
|---|---|---|
| Leaked run-scope token | Arbitrary queries against production databases | Secrets vault + least-privilege scoping |
| Database credentials in notebooks | Connection strings exposed to all collaborators | Hex workspace-managed connections |
| Query results in logs | Sensitive business data leaked | Field-level redaction pipeline |
| Overly broad notebook sharing | Confidential analytics visible to wrong teams | Per-notebook permission scoping |
| No token expiration | Indefinite access from compromised token | 90-day expiration policy |
Return a security receipt with environment, project scope, secret-reference version, validation/authorization outcomes, rotation/revocation state, correlation ID, and rollback action. Never include tokens, SQL, output, or raw events.
env=staging; project=proj-sandbox-12; secret_ref=runner-v12; parameter_validation=pass; access=least-privilege; rollback=run-cancelled is an auditable control result.
See hex-prod-checklist.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
hex, security, secrets-management, access-control, api-keys, webhook-security
18 skills in this plugin
/hex-ci-integrationConfigure Hex CI/CD integration with GitHub Actions and testing.
Use when setting up automated testing, configuring CI pipelines,
or integrating Hex tests into your build process.
Trigger with phrases like "hex CI", "hex GitHub Actions",
"hex automated tests", "CI hex".
/hex-common-errorsDiagnose and fix Hex common errors and exceptions.
Use when encountering Hex errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "hex error", "fix hex",
"hex not working", "debug hex".
/hex-core-workflow-aExecute Hex primary workflow: Core Workflow A.
Use when implementing primary use case,
building main features, or core integration tasks.
Trigger with phrases like "hex main workflow",
"primary task with hex".
/hex-core-workflow-bExecute Hex secondary workflow: Core Workflow B.
Use when implementing secondary use case,
or complementing primary workflow.
Trigger with phrases like "hex secondary workflow",
"secondary task with hex".
/hex-cost-tuningOptimize Hex costs through tier selection, sampling, and usage monitoring.
Use when analyzing Hex billing, reducing API costs,
or implementing usage monitoring and budget alerts.
Trigger with phrases like "hex cost", "hex billing",
"reduce hex costs", "hex pricing", "hex expensive", "hex budget".
/hex-debug-bundleCollect Hex debug evidence for support tickets and troubleshooting.
Use when encountering persistent issues, preparing support tickets,
or collecting diagnostic information for Hex problems.
Trigger with phrases like "hex debug", "hex support bundle",
"collect hex logs", "hex diagnostic".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin hex-packOther plugins' skills for the same job