GR

groq-data-handling

Configures a privacy pipeline to sanitize prompts, redact sensitive information, and track token usage for Groq integrations.

Install

mkdir -p .claude/skills/groq-data-handling && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8041" && unzip -o skill.zip -d .claude/skills/groq-data-handling && rm skill.zip

Installs to .claude/skills/groq-data-handling

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when you need to keep PII out of Groq API calls, filter model responses, audit-log conversations, or track token cost and usage for a Groq integration. Implements prompt sanitization, PII redaction, response filtering, and usage tracking. Trigger with phrases like "groq data", "groq PII", "groq GDPR", "groq data retention", "groq privacy", "groq compliance".
364 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Sanitize prompts for PII detection
  • Redact sensitive information from inputs and outputs
  • Generate audit trails using SHA-256 hashes
  • Filter model responses for compliance

How it works

The skill implements a wrapper around the Groq SDK that sanitizes messages, tracks usage metrics, and logs audit hashes to ensure data governance.

Inputs & outputs

You give it
Unsanitized user prompt
You get back
PII-redacted completion and audit log

When to use groq-data-handling

  • Implementing PII redaction for AI prompts
  • Auditing API requests and model responses
  • Ensuring GDPR and CCPA compliance
  • Tracking token usage and associated costs

About this skill

Groq Data Handling

Overview

Manage data flowing through Groq's inference API. This skill wires a privacy pipeline around the Groq SDK: sanitize prompts before they are sent, filter responses after they return, redact PII, hash-log an audit trail, and track token usage and cost. Key fact: Groq does not use API data for model training (Groq Privacy Policy).

Prerequisites

  • Node.js project with the groq-sdk package installed (npm i groq-sdk).
  • A Groq API key exported as GROQ_API_KEY. The SDK reads it automatically from the environment — new Groq() needs no explicit argument. Never hardcode the key; keep it in an untracked .env or your secret manager.
  • Node's built-in crypto module (for the audit hash) — no install needed.

Instructions

The pipeline layers in four stages; drop simple add-ons (moderation, cost reporting) on top. Each snippet below is the skeleton — the full, copy-ready code for every stage is in references/implementation.md.

  1. Sanitize input — run a PII rule table over every message before it leaves your process, flagging which categories were caught:

    function sanitizeMessages(messages: any[]): { messages: any[]; hadPII: boolean } {
      // apply PII_RULES to each message's content; return redacted copy + flag
    }
    
  2. Wrap the completion call — call safeCompletion(...) instead of the raw groq.chat.completions.create, so input and response both pass the sanitizer.

  3. Track usagetrackUsage(model, completion.usage, sessionId) records token counts and estimated cost per call using a per-model price table.

  4. AuditauditedCompletion(...) ties it together and logs a SHA-256 hash of the prompt (never the prompt text) so the audit trail carries no sensitive content.

For content moderation via Llama Guard and a daily cost report, see references/examples.md.

Groq data policy

  • Groq does not train on API request/response data.
  • Prompts and completions are processed and discarded.
  • Groq may temporarily log requests for abuse prevention.
  • For enterprise: contact Groq for DPA and SOC 2 compliance details.

Output

  • Sanitized messages/responses — text with [EMAIL], [PHONE], [SSN], [CARD], [IP] placeholders swapped in for detected PII, plus a hadPII boolean and a list of redacted categories.
  • Usage records — one JSON line per call (type: "groq_usage") with model, token counts, and estimatedCostUsd.
  • Audit entries — one JSON line per call (type: "groq_audit") carrying a prompt hash, piiDetected, responseFiltered, and the usage record.
  • Cost report — an aggregated object with totalCost, totalTokens, totalCalls, and a per-model breakdown (see the sample in references/examples.md).

Error Handling

IssueCauseSolution
PII leaks in responseModel echoes sensitive inputApply response filtering on all completions
Cost spike70B model for all requestsRoute simple tasks to 8B
Missing usage dataStreaming modeUse non-streaming for tracked requests, or estimate
Audit gapsNot all code paths use wrapperLint rule: ban direct groq.chat.completions.create
GROQ_API_KEY not setKey missing from environmentExport the key before running; the SDK throws on an unauthenticated call

Examples

Minimal end-to-end use once the helpers are in place:

const { content, audit } = await auditedCompletion(sessionId, messages);
// content is PII-filtered; audit is a hash-only record safe to persist

Resources

For enterprise access controls, see the groq-enterprise-rbac skill.

When not to use it

  • Do not use for training on API request data

Prerequisites

Node.js environmentgroq-sdk packageGROQ_API_KEY environment variable

Limitations

  • Model may echo sensitive input in responses if not filtered
  • Streaming mode may result in missing usage data

How it compares

It adds a protective privacy layer that prevents PII from reaching the API and ensures auditability, unlike raw API calls.

Compared to similar skills

groq-data-handling side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
groq-data-handling (this skill)027dReviewAdvanced
deepgram-data-handling227dReviewIntermediate
fireflies-data-handling127dCautionAdvanced
security-header-generator59moCautionIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

deepgram-data-handling

jeremylongshore

Implement audio data handling best practices for Deepgram integrations. Use when managing audio file storage, implementing data retention policies, or ensuring GDPR/HIPAA compliance for transcription data. Trigger with phrases like "deepgram data", "audio storage", "transcription data", "deepgram GDPR", "deepgram HIPAA", "deepgram privacy".

28

fireflies-data-handling

jeremylongshore

Implement Fireflies.ai PII handling, data retention, and GDPR/CCPA compliance patterns. Use when handling sensitive data, implementing data redaction, configuring retention policies, or ensuring compliance with privacy regulations for Fireflies.ai integrations. Trigger with phrases like "fireflies data", "fireflies PII", "fireflies GDPR", "fireflies data retention", "fireflies privacy", "fireflies CCPA".

11

security-header-generator

Dexploarer

Generates security HTTP headers (CSP, HSTS, CORS, etc.) for web applications to prevent common attacks. Use when user asks to "add security headers", "setup CSP", "configure CORS", "secure headers", or "HSTS setup".

599

fix-dependabot-alerts

microsoft

Fix Dependabot security alerts by updating vulnerable npm dependencies. Use when the user mentions "dependabot", "security alerts", "vulnerability", "CVE", or wants to update packages with security issues.

1872

backend-security-coder

sickn33

Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.

2446

security-best-practices

openai

Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.

732

Search skills

Search the agent skills registry