Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Apply Hex security best practices for secrets and access control. Use when securing API keys, implementing least privilege access, or auditing Hex security configuration. Trigger with phrases like "hex security", "hex secrets", "secure hex", "hex API key security".
.claude/skills/jeremylongshore-hex-security-basics/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 13% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -50% | 0% |
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.
typescriptfunction 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" }; }
typescriptimport 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(); }
typescriptimport { 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); }
typescriptconst 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 |
See hex-prod-checklist.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 43,206 | 29,062 | -33% | 1 | 1 | 0% | 1,926 | 5,047 | +162% | 0 | 0 | — |
case-02 | fail→pass | 20,537 | 23,206 | +13% | 1 | 1 | 0% | 4,124 | 3,917 | -5% | 0 | 0 | — |
case-03 | fail→pass | 8,339 | 8,215 | -1% | 1 | 1 | 0% | 1,403 | 1,587 | +13% | 0 | 0 | — |
case-04 | pass→pass | 14,542 | 7,086 | -51% | 1 | 1 | 0% | 1,629 | 1,306 | -20% | 0 | 0 | — |
case-05 | pass→pass | 16,610 | 14,006 | -16% | 1 | 1 | 0% | 2,069 | 2,527 | +22% | 0 | 0 | — |
case-06 | pass→pass | 14,488 | 7,530 | -48% | 1 | 1 | 0% | 1,562 | 1,409 | -10% | 0 | 0 | — |
case-07 | pass→pass | 8,637 | 2,658 | -69% | 1 | 1 | 0% | 616 | 1,349 | +119% | 0 | 0 | — |
case-08 | fail→pass | 10,814 | 1,973 | -82% | 1 | 1 | 0% | 994 | 1,303 | +31% | 0 | 0 | — |
case-09 | pass→pass | 11,344 | 6,965 | -39% | 1 | 1 | 0% | 1,095 | 1,287 | +18% | 0 | 0 | — |
case-10 | pass→pass | 15,785 | 7,325 | -54% | 1 | 1 | 0% | 1,731 | 1,322 | -24% | 0 | 0 | — |
case-11 | fail→pass | 12,644 | 22,319 | +77% | 1 | 1 | 0% | 1,200 | 1,283 | +7% | 0 | 0 | — |
case-12 | pass→pass | 14,112 | 9,436 | -33% | 1 | 1 | 0% | 1,530 | 1,689 | +10% | 0 | 0 | — |
case-13 | pass→pass | 12,997 | 11,365 | -13% | 1 | 1 | 0% | 1,290 | 1,991 | +54% | 0 | 0 | — |
case-14 | pass→pass | 6,370 | 4,320 | -32% | 1 | 1 | 0% | 1,009 | 1,502 | +49% | 0 | 0 | — |
case-15 | fail→pass | 14,449 | 6,555 | -55% | 1 | 1 | 0% | 2,363 | 1,191 | -50% | 0 | 0 | — |
case-16 | fail→pass | 23,250 | 1,797 | -92% | 1 | 1 | 0% | 1,569 | 1,234 | -21% | 0 | 0 | — |
case-17 | pass→pass | 16,845 | 12,196 | -28% | 1 | 1 | 0% | 2,702 | 3,251 | +20% | 0 | 0 | — |
case-18 | pass→pass | 26,446 | 8,708 | -67% | 1 | 1 | 0% | 1,403 | 1,441 | +3% | 0 | 0 | — |
case-19 | fail→pass | 9,733 | 10,125 | +4% | 1 | 1 | 0% | 1,603 | 1,701 | +6% | 0 | 0 | — |
case-20 | pass→pass | 21,483 | 19,509 | -9% | 1 | 1 | 0% | 2,461 | 3,306 | +34% | 0 | 0 | — |
case-21 | fail→pass | 13,702 | 11,786 | -14% | 1 | 1 | 0% | 2,036 | 2,104 | +3% | 0 | 0 | — |
case-22 | pass→pass | 10,922 | 4,660 | -57% | 1 | 1 | 0% | 1,029 | 1,695 | +65% | 0 | 0 | — |
case-23 | pass→pass | 24,849 | 24,029 | -3% | 1 | 1 | 0% | 1,459 | 1,728 | +18% | 0 | 0 | — |
case-24 | pass→pass | 6,252 | 6,092 | -3% | 1 | 1 | 0% | 1,090 | 1,875 | +72% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 22 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +33 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.