Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    llm-provider-key-literal-v1

    View as Markdown

    17 rules · Keryn Software Licence · rules 0.8.0 · all packs

    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.

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02 LLM03

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    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 authority is given or left unchecked.

    CWE-798 LLM02

    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

    keryn.keyliteral.assigned-literal-provider-key

    Section titled “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 authority is given or left unchecked.

    CWE-798 LLM02 LLM03

    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 <your-key>, xxxx or ${VAR} are fine.

    References: https://developers.openai.com/api/reference/overview#authentication · https://docs.cohere.com/reference/about · https://docs.mistral.ai/