{"id":13574293,"url":"https://github.com/protectai/llm-guard","last_synced_at":"2025-05-13T18:14:33.539Z","repository":{"id":187060312,"uuid":"671629770","full_name":"protectai/llm-guard","owner":"protectai","description":"The Security Toolkit for LLM Interactions","archived":false,"fork":false,"pushed_at":"2025-05-13T10:23:58.000Z","size":5569,"stargazers_count":1665,"open_issues_count":29,"forks_count":211,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-05-13T11:30:26.570Z","etag":null,"topics":["adversarial-machine-learning","chatgpt","large-language-models","llm","llm-security","llmops","prompt-engineering","prompt-injection","security-tools","transformers"],"latest_commit_sha":null,"homepage":"https://llm-guard.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/protectai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-27T19:03:13.000Z","updated_at":"2025-05-13T10:23:56.000Z","dependencies_parsed_at":"2023-08-08T20:48:47.289Z","dependency_job_id":"a0054837-d881-492c-a2ef-9327e87b5359","html_url":"https://github.com/protectai/llm-guard","commit_stats":{"total_commits":479,"total_committers":16,"mean_commits":29.9375,"dds":0.1983298538622129,"last_synced_commit":"242b9c0a20c5d3133a245a3c210fd70ae449b2dc"},"previous_names":["laiyer-ai/llm-guard","protectai/llm-guard"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protectai%2Fllm-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protectai%2Fllm-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protectai%2Fllm-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protectai%2Fllm-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protectai","download_url":"https://codeload.github.com/protectai/llm-guard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253936869,"owners_count":21987234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial-machine-learning","chatgpt","large-language-models","llm","llm-security","llmops","prompt-engineering","prompt-injection","security-tools","transformers"],"created_at":"2024-08-01T15:00:49.798Z","updated_at":"2025-05-13T18:14:33.497Z","avatar_url":"https://github.com/protectai.png","language":"Python","funding_links":[],"categories":["🛡️ エージェントセキュリティ","🛡️ Security \u0026 Compliance","*Ops for AI","Prompts","🛡️ LLM Defensive Tools \u0026 Resources","3. LLM \u0026 GenAI Security","LLM Guardrails / Security","Tools of Trade","[↑](#table-of-contents)Tools \u003ca name=\"tools\"\u003e\u003c/a\u003e","A01_文本生成_文本对话","开源工具","\u003ca id=\"tools\"\u003e\u003c/a\u003e🛠️ Tools","Tools","🛡 AI Safety and Guardrails","Python","Defensive (D3FEND-aligned lifecycle)","🔑 Secrets and Data Leakage","Safety and Security Testing","Alignment \u0026 Training","8. MLOps / LLMOps \u0026 Production","SDK, Libraries, Frameworks","Security Tools","Security \u0026 Safety","Safety \u0026 Governance","Tools and Code","Defense \u0026 Security Controls","Security and Privacy Considerations"],"sub_categories":["その他の標準","3. The Enterprise / High-Scale Stack (The 1%)","LLMOps","3.2 Tools \u0026 Frameworks","Defensive / Scanning","Jailbreak \u0026 Policy Enforcement (Guardrails)","大语言对话模型及数据","安全护栏","Model Security","Security","Benchmarks","🛡️ Detection Engineering","Prevention Tools","Red Teaming","Guardrails \u0026 Output Safety","Python library, sdk or frameworks","Guardrails \u0026 Runtime Protection","Resources","Sandboxing \u0026 Execution","Red Teaming and Prompt Security","Input/Output Guardrails","Comparison Guides"],"readme":"# LLM Guard - The Security Toolkit for LLM Interactions\n\nLLM Guard by [Protect AI](https://protectai.com/llm-guard) is a comprehensive tool designed to fortify the security of Large Language Models (LLMs).\n\n[**Documentation**](https://llm-guard.com/) | [**Playground**](https://huggingface.co/spaces/ProtectAI/llm-guard-playground) | [**Changelog**](https://llm-guard.com/changelog/)\n\n[![GitHub\nstars](https://img.shields.io/github/stars/protectai/llm-guard.svg?style=social\u0026label=Star\u0026maxAge=2592000)](https://GitHub.com/protectai/llm-guard/stargazers/)\n[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![PyPI - Python Version](https://img.shields.io/pypi/v/llm-guard)](https://pypi.org/project/llm-guard)\n[![Downloads](https://static.pepy.tech/badge/llm-guard)](https://pepy.tech/project/llm-guard)\n[![Downloads](https://static.pepy.tech/badge/llm-guard/month)](https://pepy.tech/project/llm-guard)\n\n\u003ca href=\"https://join.slack.com/t/laiyerai/shared_invite/zt-28jv3ci39-sVxXrLs3rQdaN3mIl9IT~w\"\u003e\u003cimg src=\"https://github.com/protectai/llm-guard/blob/main/docs/assets/join-our-slack-community.png?raw=true\" width=\"200\" alt=\"Join Our Slack Community\"\u003e\u003c/a\u003e\n\n## What is LLM Guard?\n\n![LLM-Guard](https://github.com/protectai/llm-guard/blob/main/docs/assets/flow.png?raw=true)\n\nBy offering sanitization, detection of harmful language, prevention of data leakage, and resistance against prompt\ninjection attacks, LLM-Guard ensures that your interactions with LLMs remain safe and secure.\n\n## Installation\n\nBegin your journey with LLM Guard by downloading the package:\n\n```sh\npip install llm-guard\n```\n\n## Getting Started\n\n**Important Notes**:\n\n- LLM Guard is designed for easy integration and deployment in production environments. While it's ready to use\n  out-of-the-box, please be informed that we're constantly improving and updating the repository.\n- Base functionality requires a limited number of libraries. As you explore more advanced features, necessary libraries\n  will be automatically installed.\n- Ensure you're using Python version 3.9 or higher. Confirm with: `python --version`.\n- Library installation issues? Consider upgrading pip: `python -m pip install --upgrade pip`.\n\n**Examples**:\n\n- Get started with [ChatGPT and LLM Guard](./examples/openai_api.py).\n- Deploy LLM Guard as [API](https://llm-guard.com/api/overview/)\n\n## Supported scanners\n\n### Prompt scanners\n\n- [Anonymize](https://llm-guard.com/input_scanners/anonymize/)\n- [BanCode](./docs/input_scanners/ban_code.md)\n- [BanCompetitors](https://llm-guard.com/input_scanners/ban_competitors/)\n- [BanSubstrings](https://llm-guard.com/input_scanners/ban_substrings/)\n- [BanTopics](https://llm-guard.com/input_scanners/ban_topics/)\n- [Code](https://llm-guard.com/input_scanners/code/)\n- [Gibberish](https://llm-guard.com/input_scanners/gibberish/)\n- [InvisibleText](https://llm-guard.com/input_scanners/invisible_text/)\n- [Language](https://llm-guard.com/input_scanners/language/)\n- [PromptInjection](https://llm-guard.com/input_scanners/prompt_injection/)\n- [Regex](https://llm-guard.com/input_scanners/regex/)\n- [Secrets](https://llm-guard.com/input_scanners/secrets/)\n- [Sentiment](https://llm-guard.com/input_scanners/sentiment/)\n- [TokenLimit](https://llm-guard.com/input_scanners/token_limit/)\n- [Toxicity](https://llm-guard.com/input_scanners/toxicity/)\n\n### Output scanners\n\n- [BanCode](./docs/output_scanners/ban_code.md)\n- [BanCompetitors](https://llm-guard.com/output_scanners/ban_competitors/)\n- [BanSubstrings](https://llm-guard.com/output_scanners/ban_substrings/)\n- [BanTopics](https://llm-guard.com/output_scanners/ban_topics/)\n- [Bias](https://llm-guard.com/output_scanners/bias/)\n- [Code](https://llm-guard.com/output_scanners/code/)\n- [Deanonymize](https://llm-guard.com/output_scanners/deanonymize/)\n- [JSON](https://llm-guard.com/output_scanners/json/)\n- [Language](https://llm-guard.com/output_scanners/language/)\n- [LanguageSame](https://llm-guard.com/output_scanners/language_same/)\n- [MaliciousURLs](https://llm-guard.com/output_scanners/malicious_urls/)\n- [NoRefusal](https://llm-guard.com/output_scanners/no_refusal/)\n- [ReadingTime](https://llm-guard.com/output_scanners/reading_time/)\n- [FactualConsistency](https://llm-guard.com/output_scanners/factual_consistency/)\n- [Gibberish](https://llm-guard.com/output_scanners/gibberish/)\n- [Regex](https://llm-guard.com/output_scanners/regex/)\n- [Relevance](https://llm-guard.com/output_scanners/relevance/)\n- [Sensitive](https://llm-guard.com/output_scanners/sensitive/)\n- [Sentiment](https://llm-guard.com/output_scanners/sentiment/)\n- [Toxicity](https://llm-guard.com/output_scanners/toxicity/)\n- [URLReachability](https://llm-guard.com/output_scanners/url_reachability/)\n\n## Community, Contributing, Docs \u0026 Support\n\nLLM Guard is an open source solution.\nWe are committed to a transparent development process and highly appreciate any contributions.\nWhether you are helping us fix bugs, propose new features, improve our documentation or spread the word,\nwe would love to have you as part of our community.\n\n- Give us a ⭐️ github star ⭐️ on the top of this page to support what we're doing,\n  it means a lot for open source projects!\n- Read our\n  [docs](https://llm-guard.com/)\n  for more info about how to use and customize LLM Guard, and for step-by-step tutorials.\n- Post a [Github\n  Issue](https://github.com/protectai/llm-guard/issues) to submit a bug report, feature request, or suggest an improvement.\n- To contribute to the package, check out our [contribution guidelines](CONTRIBUTING.md), and open a PR.\n\nJoin our Slack to give us feedback, connect with the maintainers and fellow users, ask questions,\nget help for package usage or contributions, or engage in discussions about LLM security!\n\n\u003ca href=\"https://join.slack.com/t/laiyerai/shared_invite/zt-28jv3ci39-sVxXrLs3rQdaN3mIl9IT~w\"\u003e\u003cimg src=\"https://github.com/protectai/llm-guard/blob/main/docs/assets/join-our-slack-community.png?raw=true\" width=\"200\" alt=\"Join Our Slack Community\"\u003e\u003c/a\u003e\n\n### Production Support\n\nWe're eager to provide personalized assistance when deploying your LLM Guard to a production environment.\n\n- [Send Email ✉️](mailto:community@protectai.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotectai%2Fllm-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotectai%2Fllm-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotectai%2Fllm-guard/lists"}