security-ai-keys

Audit applications for exposed AI API keys using ripgrep pattern matching.

35|1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/jal-co/jalco-pi-mono --skill security-ai-keys-jal-co
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-ai-keys
Source: https://github.com/jal-co/jalco-pi-mono/tree/main/pi/.pi/agent/skills/security-ai-keys
Command: npx skills add https://github.com/jal-co/jalco-pi-mono --skill security-ai-keys-jal-co

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps prevent the accidental exposure and leakage of sensitive AI API keys, which can lead to unauthorized access, service abuse, and significant financial or reputational damage.

Core Features & Use Cases

  • Proactive Auditing: Scans code, configuration files, and build artifacts for patterns matching common AI API keys.
  • Vulnerability Identification: Detects keys in client-side code, environment variables, logs, and cloud credential files.
  • Use Case: Before deploying a new feature that integrates with OpenAI, run this skill to ensure no API keys are hardcoded or exposed in the frontend build.

Quick Start

Run a quick audit for leaked AI API keys in the current directory.

Frequently Asked Questions about security-ai-keys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan my codebase for leaked AI API keys before deployment?

To scan for leaked AI API keys, audit your application's client-side code, environment variables, and build artifacts to identify exposed credentials. This process utilizes ripgrep pattern matching to detect keys for providers like OpenAI, Anthropic, and Gemini.

What is AI API key leakage and how does it happen in build artifacts?

AI API key leakage occurs when sensitive credentials are accidentally exposed in client-side code, environment variables, or build artifacts. This vulnerability happens when hardcoded keys are bundled into frontend outputs, allowing unauthorized access and service abuse.

Can I detect exposed OpenAI and Anthropic keys in my environment variables?

Yes, you can detect exposed OpenAI and Anthropic keys in environment variables by running an audit against common key formats and provider-specific endpoints. The scan identifies vulnerabilities and recommends redaction and rotation strategies.

What's the best way to audit cloud credentials for Gemini API exposure?

The best way to audit cloud credentials for Gemini API exposure is scanning configuration files and cloud credential files using ripgrep. This identifies matching key formats and recommends redaction strategies to prevent unauthorized access.

Why do I need to redact and rotate API keys found in client-side code?

You need to redact and rotate API keys found in client-side code because exposed keys lead to unauthorized access, service abuse, and significant financial or reputational damage. Rotation invalidates compromised keys, while redaction prevents future leakage.