/groq-pack:groq-security-basicsfrom groq-pack
Guides through Groq API key security practices: storage, rotation, git leak prevention, and audit. Use when securing Groq API keys or auditing configuration.
Ships in groq-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.
Read when SKILL.md points to them.
Security practices for Groq API keys and data flowing through Groq's inference API. Groq uses a single API key type (gsk_ prefix) with full access -- there are no scoped tokens -- so key management and rotation are critical.
This skill walks through six hardening steps end to end. The essentials live here; deep code and full command sequences are extracted into references/ for progressive disclosure:
gsk_ and grant full API accessWork through the six steps in order. Each summary below is enough to act on; drill into the linked reference for the full code.
Keep the key out of source. Use a .env.local (git-ignored) for development
and a platform secret manager (Vercel / AWS / GCP / GitHub Actions) for
production. Use Write to create the .env.local and .gitignore entries:
echo "GROQ_API_KEY=gsk_dev_key_here" > .env.local
echo -e ".env\n.env.local\n.env.*.local" >> .gitignore
Full per-platform commands: references/examples.md Example 1.
Both keys work simultaneously, so rotation is zero-downtime: create a
date-named key, deploy it, verify with a 200 from /v1/models, monitor 24h,
then delete the old key. Full sequence: references/examples.md Example 2.
Install a pre-commit hook that blocks any staged gsk_ key. Use Read to
confirm .gitignore excludes the .env files, then use Grep to sweep the
existing tree and history for keys already committed:
grep -rnE "gsk_[a-zA-Z0-9]{20,}" . --exclude-dir=.git
Hook + history-scan commands: references/examples.md Examples 3-4.
Never expose the key to client code. Proxy inference through your backend so the key stays server-side, and validate/limit user input before calling Groq. Full Next.js route handler: references/implementation.md § Server-Side Key Usage Pattern.
Sanitize user input to strip override phrases (ignore previous instructions,
you are now, system:) and pair it with a hardened system prompt that
refuses role changes. Full code: references/implementation.md § Prompt Injection Defense.
Log every completion with token counts, latency, and status so abuse and cost
spikes trace back to a user. Full auditedCompletion implementation:
references/implementation.md § Audit Logging.
Applying this skill produces a hardened Groq integration:
.env.local (dev) and secret-manager entry (prod) — no key in source.git/hooks/pre-commit hook that exits non-zero on any staged gsk_ keyGroqAuditEntry) on every completion401 Unauthorized from /v1/models — the rotated key is wrong or not yet propagated to the secret manager. Re-check the Authorization: Bearer value before deleting the old key.chmod +x .git/hooks/pre-commit); hooks are not copied by git clone, so re-install per checkout.Grep finds a key already in history — rotate the key immediately (Step 2); scrubbing history alone is not enough because the key was exposed.GROQ_API_KEY reference — any bundler that inlines the key (e.g. a NEXT_PUBLIC_ prefix) leaks it; move the call server-side (Step 4).429 spike can indicate abuse.Lean summaries are in Instructions; full copy-ready code lives in the references:
.env files in .gitignoreFor production deployment, work through the groq-prod-checklist skill, which
covers deployment gates, monitoring, and spend controls beyond this security
baseline.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin groq-pack24 skills in this plugin
/groq-ci-integrationConfigure Groq CI/CD integration with GitHub Actions, testing, and model validation.
Use when setting up automated testing, configuring CI pipelines,
or integrating Groq tests into your build process.
Trigger with phrases like "groq CI", "groq GitHub Actions",
"groq automated tests", "CI groq".
/groq-common-errorsDiagnose and fix Groq API errors with real error codes and solutions.
Use when encountering Groq errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "groq error", "fix groq",
"groq not working", "debug groq", "groq 429".
/groq-core-workflow-aOther plugins' skills for the same job