{"id":15044528,"url":"https://github.com/elastic/llm-detection-proxy","last_synced_at":"2025-07-13T23:34:37.157Z","repository":{"id":235909532,"uuid":"785390437","full_name":"elastic/llm-detection-proxy","owner":"elastic","description":"A proxy tool for detecting and logging LLM queries to Elasticsearch.","archived":false,"fork":false,"pushed_at":"2024-08-09T14:30:11.000Z","size":132,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-09T00:56:42.433Z","etag":null,"topics":["elastic","enrichment","flask","kibana","llm","proxy","security"],"latest_commit_sha":null,"homepage":"","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/elastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T19:47:57.000Z","updated_at":"2025-04-17T00:19:24.000Z","dependencies_parsed_at":"2025-02-04T23:33:34.195Z","dependency_job_id":"875d0007-524d-4c6b-98e1-470a752d0f48","html_url":"https://github.com/elastic/llm-detection-proxy","commit_stats":null,"previous_names":["elastic/llm-detection-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elastic/llm-detection-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fllm-detection-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fllm-detection-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fllm-detection-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fllm-detection-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/llm-detection-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fllm-detection-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265221860,"owners_count":23730086,"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":["elastic","enrichment","flask","kibana","llm","proxy","security"],"created_at":"2024-09-24T20:50:41.411Z","updated_at":"2025-07-13T23:34:37.126Z","avatar_url":"https://github.com/elastic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Detection Proxy\n\nThis repository contains the LLM Detection Proxy, a proof-of-concept tool developed at Elastic during our quarterly OnWeek session. The project is designed to integrate security practices within the lifecycle of Large Language Models (LLMs), allowing for the detection, alerting, and triage of malicious activities in LLM workflows.\n\n![Untitled-2024-04-09-1014-2](https://github.com/elastic/llm-detection-proxy/assets/1636709/2fd6b3af-3c8c-4678-aa18-61d5606ba263)\n\n## Installation\n\nBefore running the application, ensure the following dependencies are installed:\n\n1. **Python 3.12** - The proxy is written in Python and requires Python 3.12.\n2. **Poetry** - This project uses Poetry for dependency management.\n\nInstall the required dependencies by running:\n\n```bash\npoetry install\n```\n\n## Configuration\n\nYou must set the following environment variables before starting the Flask application:\n\n- `AZURE_OPENAI_API_KEY` - The API key for Azure OpenAI.\n- `AZURE_OPENAI_ENDPOINT` - The endpoint URL for Azure OpenAI.\n- `AZURE_DEPLOYMENT_NAME` - The deployment name for the Azure OpenAI instance.\n- `ELASTIC_USER` - The username for the Elastic instance.\n- `ELASTIC_PASSWORD` - The password for the Elastic instance.\n\n## Running the Proxy\n\nTo start the Flask server, use the following command:\n\n```bash\npoetry run flask run --port=5000\n```\n\nThis will start the Flask server on `http://localhost:5000`.\n\n## Integration with Elastic\n\nEnsure you have Kibana and Elasticsearch running locally. Follow the guide on [setting up a local Kibana instance](https://www.elastic.co/guide/en/kibana/current/development-getting-started.html) and [creating a connector for OpenAI in Kibana](https://www.elastic.co/guide/en/kibana/current/openai-action-type.html).\n\n## Disclaimer\n\nThis proxy is a **proof of concept** and is **not maintained** as a production-grade tool by Elastic. It is intended for experimental use and to illustrate potential security integrations with LLMs.\n\n## About the Project\n\nAs we continue to explore integrating security within LLMs at Elastic, this project serves as a demonstration of how embedding security into LLM workflows can provide a path forward for creating safer and more reliable applications. This project is part of ongoing research and is reflective of our commitment to security in all facets of technology development.\n\nThis repository is linked to a blog post that discusses the broader context of this work. [Read more about our work on LLMs and security on our blog.](#)\n\n## Contact\n\nFor more information, please contact Mika Ayenson at [Mika.ayenson@elastic.co](mailto:Mika.ayenson@elastic.co).\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fllm-detection-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fllm-detection-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fllm-detection-proxy/lists"}