Skip to main content

detect_llm_api_keys

scan python files for llm api keys (designed for pre-commit)

License: MIT python

Publish to PyPI GitHub tag (with filter) Read the Docs

Code Climate maintainability Code Climate issues Code Climate technical debt coverage

pre-commit Ruff Checked with mypy Code style: black

security: bandit Known Vulnerabilities

🤖 This README was written by GPT-4. 🤖

Introduction

detect_llm_api_keys is a vital tool for Python developers, especially those working with large language models (LLMs). It's a pre-commit hook that efficiently scans your Python files to detect and prevent the accidental committing of LLM API keys, enhancing the security of your projects.

Features

  • Efficient API Key Detection: Scans for keys from major providers like Anthropic, Anyscale, Microsoft Azure, LangChain, OpenAI, and Mistral AI.
  • Easy Integration: Seamlessly integrates with your existing Python projects.
  • Support for Various API Key Patterns: Recognizes a range of patterns, ensuring comprehensive protection.
  • Compatibility with nosec and noqa Comments: Respects your code's existing security annotations.

Getting Started

  1. Installation: Add detect_llm_api_keys to your .pre-commit-config.yaml file.
  2. Configuration: Customize the settings as per your project requirements.
  3. Usage: Automatically scans files upon each commit, flagging potential API key exposures.

Usage

To use detect_llm_api_keys in your project, update your .pre-commit-config.yaml as follows:

repos:
-   repo: https://github.com/joshuasundance-swca/detect_llm_api_keys
    rev: "0.0.3"
    hooks:
    -   id: detect-llm-api-keys

Collaboration and Contributions

Feedback, suggestions, and contributions are highly welcomed to enhance detect_llm_api_keys. Please feel free to open issues or submit pull requests on GitHub.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

Special thanks to the Python and Open Source communities for their invaluable support and contributions.

Metadata

Release files for detect-llm-api-keys 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detect-llm-api-keys 0.0.3
File Size Uploaded
detect_llm_api_keys-0.0.3.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for detect-llm-api-keys 0.0.3
File Interpreter ABI Platform
detect_llm_api_keys-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / detect_llm_api_keys-0.0.3.tar.gz

Download URL detect_llm_api_keys-0.0.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b6539817f2b84ee7d0817cdbd280e09a53bdb27f0766e41c58079ad579986188
BLAKE2b-256 checksum
How to use checksums
5d491baab6c020ce4788a166c9bb918f5e1ce4815212cdf2bac38fb42a3ea582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / detect_llm_api_keys-0.0.3-py3-none-any.whl

Download URL detect_llm_api_keys-0.0.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec7224f28ee441954fb7e8da4088754957011428a44a516f827c43f5fc7640bf
BLAKE2b-256 checksum
How to use checksums
69423d6d0ac2060ec4f96b3ea0bf33347f4a1a030aa3581def6f91f313534ee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page