# llm-provider-key-literal-v1

> llm-provider-key-literal-v1: 17 Keryn rules for generic (13 error, 4 warning).

Source: https://keryn.dev/rules/llm-provider-key-literal-v1/

17 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**How to read a rule**

- **Severity**: How bad the finding is if it is real: `error` fails a default gate, `warning` and `info` do not.

- **Confidence**: **P0** exploitable as written; **P1** dangerous in context; **P2** a heuristic or a posture check: confirm by reading the code.

- **False-positive risk**: **low**: an exact API or flag, so hits are almost always real; **medium**: the pattern is legitimate in many programs, so check each hit; **high**: it finds a lead to confirm, so expect benign hits.

- **Edge**: The relationship the finding sits on. **reaches**: content or traffic gets to a thing; **calls**: one thing invokes another; **reads**: one thing reads from another; **writes**: one thing writes to another; **sends**: data leaves for another party; **grants**: authority is given or left unchecked; **depends_on**: something relies on a component it does not verify; **trusts**: one party believes another without evidence. The boundary it crosses, when there is one: **user->prompt** (untrusted input reaching a prompt); **model->code** (model output reaching code, a shell, a query or a page); **secret->outside** (a secret leaving the trusted side); **supply-chain** (code, models or prompts pulled in from outside).

- **Taxonomy chips**: References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

## keryn.keyliteral.openai

`error` generic openai

A OpenAI API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://developers.openai.com/api/reference/overview#authentication](https://developers.openai.com/api/reference/overview#authentication)

## keryn.keyliteral.anthropic

`error` generic anthropic

A Anthropic API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://platform.claude.com/docs/en/api/overview](https://platform.claude.com/docs/en/api/overview)

## keryn.keyliteral.google-ai-studio

`error` generic gemini

A Google AI Studio (Gemini API) API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://ai.google.dev/gemini-api/docs/api-key](https://ai.google.dev/gemini-api/docs/api-key)

## keryn.keyliteral.huggingface

`error` generic huggingface

A Hugging Face API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://huggingface.co/docs/hub/security-tokens](https://huggingface.co/docs/hub/security-tokens)

## keryn.keyliteral.groq

`warning` generic groq

A Groq API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://console.groq.com/docs/quickstart](https://console.groq.com/docs/quickstart)

## keryn.keyliteral.xai

`error` generic xai

A xAI API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.x.ai/developers/quickstart](https://docs.x.ai/developers/quickstart)

## keryn.keyliteral.replicate

`error` generic replicate

A Replicate API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://replicate.com/docs/reference/http#authentication](https://replicate.com/docs/reference/http#authentication)

## keryn.keyliteral.perplexity

`error` generic perplexity

A Perplexity API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.perplexity.ai/docs/getting-started/overview](https://docs.perplexity.ai/docs/getting-started/overview)

## keryn.keyliteral.openrouter

`error` generic openrouter

A OpenRouter API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://openrouter.ai/docs/api_reference/authentication](https://openrouter.ai/docs/api_reference/authentication)

## keryn.keyliteral.fireworks

`error` generic fireworks

A Fireworks AI API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.fireworks.ai/api-reference/introduction](https://docs.fireworks.ai/api-reference/introduction)

## keryn.keyliteral.voyage

`error` generic voyageai

A Voyage AI API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.voyageai.com/docs/api-key-and-installation](https://docs.voyageai.com/docs/api-key-and-installation)

## keryn.keyliteral.langsmith

`error` generic langsmith

A LangSmith API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.langchain.com/langsmith/create-account-api-key](https://docs.langchain.com/langsmith/create-account-api-key)

## keryn.keyliteral.langfuse

`error` generic langfuse

A Langfuse API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://langfuse.com/faq/all/where-are-langfuse-api-keys](https://langfuse.com/faq/all/where-are-langfuse-api-keys)

## keryn.keyliteral.pinecone

`warning` generic pinecone

A Pinecone API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.pinecone.io/admin/projects/manage-api-keys](https://docs.pinecone.io/admin/projects/manage-api-keys)

## keryn.keyliteral.tavily

`warning` generic tavily

A Tavily API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://docs.tavily.com/documentation/api-credits](https://docs.tavily.com/documentation/api-credits)

## keryn.keyliteral.elevenlabs

`error` generic elevenlabs

A ElevenLabs API key is written into source or configuration as a literal. Anyone who can read the repository, a build log or a shipped bundle can spend your quota and read what the key can reach; git history keeps it after deletion. Revoke this key, then load its replacement from a secret store or environment variable.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure)

**Fix:** Revoke and rotate the key now, remove it from history, and read the replacement at runtime from an environment variable or secret manager. Add a secret-scanning pre-commit hook or CI step so a new literal is caught before merge.

**References:** [https://elevenlabs.io/docs/api-reference/authentication](https://elevenlabs.io/docs/api-reference/authentication)

## keryn.keyliteral.assigned-literal-provider-key

`warning` generic openai, anthropic, gemini, cohere, mistral, together, deepseek

A literal of 24 or more characters is assigned to a name that identifies an LLM provider credential (openai, anthropic, gemini, cohere, mistral, groq, together, deepseek, fireworks, Hugging Face ... key/token/secret). That is almost certainly a real secret committed to the repository. Revoke it and load the replacement from the environment or a secret store.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain)

**Fix:** Revoke and rotate the credential, purge it from history, and read it at runtime (os.environ, process.env, a secrets manager). Placeholders such as &lt;your-key&gt;, xxxx or $&#123;VAR&#125; are fine.

**References:** [https://developers.openai.com/api/reference/overview#authentication](https://developers.openai.com/api/reference/overview#authentication) · [https://docs.cohere.com/reference/about](https://docs.cohere.com/reference/about) · [https://docs.mistral.ai/](https://docs.mistral.ai/)
