|
5 | 5 |
|
6 | 6 | --- |
7 | 7 |
|
8 | | -[](https://github.com/stacklok/codegate/actions/workflows/run-on-push.yml) |
| 8 | +[](https://github.com/stacklok/codegate/releases) |
9 | 9 | | |
10 | | -[](https://opensource.org/licenses/Apache-2.0) |
| 10 | +[](https://github.com/stacklok/codegate/actions/workflows/run-on-push.yml) |
11 | 11 | | |
12 | | -[](https://discord.gg/RkzVuTp3WK) |
13 | | - |
14 | | ---- |
15 | | - |
16 | | -## Introduction |
| 12 | +[](https://opensource.org/licenses/Apache-2.0) |
| 13 | +| |
| 14 | +[](https://github.com/stacklok/codegate) |
| 15 | +| |
| 16 | +[](https://discord.gg/stacklok) |
17 | 17 |
|
18 | | -<img src="./assets/codegate.gif" style="width: 70%; height: 70%;" alt="Animated gif of CodeGate detecting a malicious package in a Continue AI chat" /> |
| 18 | +[Website](https://codegate.ai) | [Documentation](https://docs.codegate.ai) | |
| 19 | +[YouTube](https://www.youtube.com/playlist?list=PLYBL38zBWVIhrDgKwAMjAwOYZeP-ZH64n) |
| 20 | +| [Discord](https://discord.gg/stacklok) |
19 | 21 |
|
20 | | -CodeGate is a local gateway that makes AI coding assistants safer. CodeGate |
21 | | -ensures AI-generated recommendations adhere to best practices, while |
22 | | -safeguarding your code's integrity, and protecting your individual privacy. With |
23 | | -CodeGate, you can confidently leverage AI in your development workflow without |
24 | | -compromising security or productivity. CodeGate is designed to work seamlessly |
25 | | -with coding assistants, allowing you to safely enjoy all the benefits of AI code |
26 | | -generation. |
| 22 | +--- |
27 | 23 |
|
28 | | -CodeGate is developed by [Stacklok](https://stacklok.com), a group of security |
29 | | -experts with many years of experience building developer friendly open source |
30 | | -security software tools and platforms. |
| 24 | +# CodeGate: making AI coding assistance secure |
31 | 25 |
|
32 | | -Check out the CodeGate **[website](https://codegate.ai)** and |
33 | | -**[documentation](https://docs.codegate.ai)** to learn more. |
| 26 | +**By [Stacklok](https://stacklok.com)** |
34 | 27 |
|
35 | | -## Experimental 🚧 |
| 28 | +CodeGate is a **local gateway** that makes AI agents and coding assistants safer. It |
| 29 | +ensures AI-generated recommendations adhere to best practices while safeguarding |
| 30 | +your code's integrity and protecting your privacy. With CodeGate, you can |
| 31 | +confidently leverage AI in your development workflow without sacrificing |
| 32 | +security or productivity. |
36 | 33 |
|
37 | | -CodeGate is in active development and subject to **rapid change**. |
| 34 | +<picture> |
| 35 | + <source media="(prefers-color-scheme: dark)" srcset="./static/diagram-dark.png"> |
| 36 | + <img alt="CodeGate dashboard" src="./static/diagram-light.png" width="1100px" style="max-width: 100%;"> |
| 37 | +</picture> |
38 | 38 |
|
39 | | -- Features may change frequently |
40 | | -- Expect possible bugs and breaking changes |
41 | | -- Contributions, feedback, and testing are highly encouraged and welcomed! |
| 39 | +--- |
42 | 40 |
|
43 | | -## ✨ Why CodeGate? |
| 41 | +## ✨ Why choose CodeGate? |
44 | 42 |
|
45 | | -In today's world where AI coding assistants are becoming ubiquitous, security |
46 | | -can't be an afterthought. CodeGate sits between you and AI, actively protecting |
47 | | -your development process by: |
| 43 | +AI coding assistants are powerful, but they can inadvertently introduce risks. |
| 44 | +CodeGate protects your development process by: |
48 | 45 |
|
49 | 46 | - 🔒 Preventing accidental exposure of secrets and sensitive data |
50 | 47 | - 🛡️ Ensuring AI suggestions follow secure coding practices |
51 | 48 | - ⚠️ Blocking recommendations of known malicious or deprecated libraries |
52 | 49 | - 🔍 Providing real-time security analysis of AI suggestions |
53 | 50 |
|
54 | | -## 🌟 Features |
| 51 | +--- |
| 52 | + |
| 53 | +## 🚀 Quickstart |
55 | 54 |
|
56 | | -### Supported AI coding assistants and providers |
| 55 | +### Prerequisites |
57 | 56 |
|
58 | | -CodeGate works with multiple development environments and AI providers. |
| 57 | +CodeGate is distributed as a Docker container. You need a container runtime like |
| 58 | +Docker Desktop or Docker Engine. Podman and Podman Desktop are also supported. |
| 59 | +CodeGate works on Windows, macOS, and Linux operating systems with x86_64 and |
| 60 | +arm64 (ARM and Apple Silicon) CPU architectures. |
59 | 61 |
|
60 | | -- **[GitHub Copilot](https://github.com/features/copilot)** with Visual Studio |
61 | | - Code and JetBrains IDEs |
| 62 | +These instructions assume the `docker` CLI is available. If you use Podman, |
| 63 | +replace `docker` with `podman` in all commands. |
62 | 64 |
|
63 | | -- **[Continue](https://www.continue.dev/)** with Visual Studio Code and |
64 | | - JetBrains IDEs |
| 65 | +### Installation |
65 | 66 |
|
66 | | -With Continue, you can choose from several leading AI model providers: |
| 67 | +To start CodeGate, run this simple command: |
67 | 68 |
|
68 | | -- 💻 Local LLMs with [Ollama](https://ollama.com/) and |
69 | | - [llama.cpp](https://github.com/ggerganov/llama.cpp) (run AI completely |
70 | | - offline!) |
71 | | -- ⚡ [vLLM](https://docs.vllm.ai/en/latest/) (OpenAI-compatible mode, including |
72 | | - OpenRouter) |
73 | | -- 🤖 [Anthropic API](https://www.anthropic.com/api) |
74 | | -- 🧠 [OpenAI API](https://openai.com/api/) |
| 69 | +```bash |
| 70 | +docker run --name codegate -d -p 8989:8989 -p 9090:9090 -p 8990:8990 \ |
| 71 | + --mount type=volume,src=codegate_volume,dst=/app/codegate_volume \ |
| 72 | + --restart unless-stopped ghcr.io/stacklok/codegate:latest |
| 73 | +``` |
75 | 74 |
|
76 | | -🔮 Many more on the way! |
| 75 | +That’s it! CodeGate is now running locally. |
77 | 76 |
|
78 | | -- **[Aider](https://aider.chat)** |
| 77 | +### Get into action |
| 78 | +Now it's time to configure your preferred AI coding assistant to use CodeGate |
| 79 | +[See supported AI Coding Assistants and providers](#-supported-ai-coding-assistants-and-providers) |
79 | 80 |
|
80 | | -With Aider, you can choose from two leading AI model providers: |
| 81 | +⚙️ For advanced configurations and parameter references, check out the |
| 82 | +[CodeGate Install and Upgrade](https://docs.codegate.ai/how-to/install) |
| 83 | +documentation. |
81 | 84 |
|
82 | | -- 💻 Local LLMs with [Ollama](https://ollama.com/) |
83 | | -- 🧠 [OpenAI API](https://openai.com/api/) |
| 85 | +--- |
84 | 86 |
|
85 | | -- **[Cline](https://github.com/cline/cline)** |
| 87 | +## 🖥️ Dashboard |
86 | 88 |
|
87 | | -With Cline, you can choose between differnet leading AI model providers: |
| 89 | +CodeGate includes a web dashboard that provides: |
88 | 90 |
|
89 | | -- 🤖 [Anthropic API](https://www.anthropic.com/api) |
90 | | -- 🧠 [OpenAI API](https://openai.com/api/) |
91 | | -- 💻 [LM Studio](https://lmstudio.ai/) |
92 | | -- 💻 Local LLMs with [Ollama](https://ollama.com/) |
| 91 | +- A view of **security risks** detected by CodeGate |
| 92 | +- A **history of interactions** between your AI coding assistant and your LLM |
93 | 93 |
|
94 | | -- **[Kodu](https://kodu.ai)** |
| 94 | +<picture> |
| 95 | + <source media="(prefers-color-scheme: dark)" srcset="./static/dashboard-dark.webp"> |
| 96 | + <img alt="CodeGate dashboard" src="./static/dashboard-light.webp" width="1200px" style="max-width: 100%;"> |
| 97 | +</picture> |
95 | 98 |
|
96 | | -You can use Kodu with OpenAI compatible APIs: |
| 99 | +### Accessing the dashboard |
97 | 100 |
|
98 | | -- 🧠 [OpenAI API](https://openai.com/api/) |
| 101 | +Open [http://localhost:9090](http://localhost:9090) in your web browser to |
| 102 | +access the dashboard. |
99 | 103 |
|
| 104 | +To learn more, visit the |
| 105 | +[CodeGate Dashboard documentation](https://docs.codegate.ai/how-to/dashboard). |
100 | 106 |
|
101 | | -### Privacy first |
| 107 | +--- |
102 | 108 |
|
103 | | -Unlike E.T., your code never phones home! 🛸 CodeGate is designed with privacy |
104 | | -at its core: |
| 109 | +## 🔐 Features |
105 | 110 |
|
106 | | -- 🏠 Everything stays on your machine |
107 | | -- 🚫 No external data collection |
108 | | -- 🔐 No calling home or telemetry |
109 | | -- 💪 Complete control over your data |
| 111 | +### Secrets encryption |
110 | 112 |
|
111 | | -## 🚀 Quickstart |
| 113 | +CodeGate helps you protect sensitive information from being accidentally exposed |
| 114 | +to AI models and third-party AI provider systems by redacting detected secrets |
| 115 | +from your prompts using encryption. |
| 116 | +[Learn more](https://docs.codegate.ai/features/secrets-encryption) |
112 | 117 |
|
113 | | -Check out the quickstart guides to get up and running quickly! |
| 118 | +### Dependency risk awareness |
114 | 119 |
|
115 | | -- [Quickstart guide for GitHub Copilot with VS Code](https://docs.codegate.ai/quickstart) |
116 | | -- [Quickstart guide for Continue with VS Code and Ollama](https://docs.codegate.ai/quickstart-continue) |
| 120 | +LLMs’ knowledge cutoff date is often months or even years in the past. They |
| 121 | +might suggest outdated, vulnerable, or non-existent packages (hallucinations), |
| 122 | +exposing you and your users to security risks. |
117 | 123 |
|
118 | | -## 🎯 Usage |
| 124 | +CodeGate scans direct, transitive, and development dependencies in your package |
| 125 | +definition files, installation scripts, and source code imports that you supply |
| 126 | +as context to an LLM. |
| 127 | +[Learn more](https://docs.codegate.ai/features/dependency-risk) |
119 | 128 |
|
120 | | -### IDE integration |
| 129 | +### Security reviews |
121 | 130 |
|
122 | | -Simply open the Continue or Copilot chat in your IDE to start interacting with |
123 | | -your AI assistant - now protected by CodeGate! |
| 131 | +CodeGate performs security-centric code reviews, identifying insecure patterns |
| 132 | +or potential vulnerabilities to help you adopt more secure coding practices. |
| 133 | +[Learn more](https://docs.codegate.ai/features/security-reviews) |
124 | 134 |
|
125 | | -<picture> |
126 | | - <source media="(prefers-color-scheme: dark)" srcset="./static/continue-extension-dark.webp"> |
127 | | - <img alt="Continue chat in VS Code" src="./static/continue-extension-light.webp" width="720px" style="max-width: 100%;"> |
128 | | -</picture> |
| 135 | +--- |
| 136 | + |
| 137 | +## 🤖 Supported AI coding assistants and providers |
| 138 | + |
| 139 | +### [Aider](https://docs.codegate.ai/how-to/use-with-aider) |
129 | 140 |
|
130 | | -Refer to the CodeGate docs for more information: |
| 141 | +- **Local / self-managed:** |
| 142 | + - Ollama |
| 143 | +- **Hosted:** |
| 144 | + - OpenAI and compatible APIs |
131 | 145 |
|
132 | | -- [Using CodeGate](https://docs.codegate.ai/how-to) |
133 | | -- [CodeGate features](https://docs.codegate.ai/features) |
| 146 | +🔥 Getting started with CodeGate and aider - |
| 147 | +[watch on YouTube](https://www.youtube.com/watch?v=VxvEXiwEGnA) |
| 148 | + |
| 149 | +### [Cline](https://docs.codegate.ai/how-to/use-with-cline) |
| 150 | + |
| 151 | +- **Local / self-managed:** |
| 152 | + - Ollama |
| 153 | + - LM Studio |
| 154 | +- **Hosted:** |
| 155 | + - Anthropic |
| 156 | + - OpenAI and compatible APIs |
| 157 | + |
| 158 | +### [Continue](https://docs.codegate.ai/how-to/use-with-continue) |
| 159 | + |
| 160 | +- **Local / self-managed:** |
| 161 | + - Ollama |
| 162 | + - llama.cpp |
| 163 | + - vLLM |
| 164 | +- **Hosted:** |
| 165 | + - Anthropic |
| 166 | + - OpenAI and compatible APIs |
| 167 | + |
| 168 | +### [GitHub Copilot](https://docs.codegate.ai/how-to/use-with-copilot) |
| 169 | + |
| 170 | +- The Copilot plugin works with **Visual Studio Code (VS Code)** (JetBrains is |
| 171 | + coming soon!) |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## 🛡️ Privacy first |
| 176 | + |
| 177 | +Unlike other tools, with CodeGate **your code never leaves your machine**. |
| 178 | +CodeGate is built with privacy at its core: |
| 179 | + |
| 180 | +- 🏠 **Everything stays local** |
| 181 | +- 🚫 **No external data collection** |
| 182 | +- 🔐 **No calling home or telemetry** |
| 183 | +- 💪 **Complete control over your data** |
| 184 | + |
| 185 | +--- |
134 | 186 |
|
135 | 187 | ## 🛠️ Development |
136 | 188 |
|
137 | | -Check out the developer reference guides: |
| 189 | +Are you a developer looking to contribute? Dive into our technical resources: |
| 190 | + |
| 191 | +- [Development guide](https://github.com/stacklok/codegate/blob/main/docs/development.md) |
| 192 | +- [CLI commands and flags](https://github.com/stacklok/codegate/blob/main/docs/cli.md) |
| 193 | +- [Configuration system](https://github.com/stacklok/codegate/blob/main/docs/configuration.md) |
| 194 | +- [Logging system](https://github.com/stacklok/codegate/blob/main/docs/logging.md) |
138 | 195 |
|
139 | | -- [Development guide](./docs/development.md) |
140 | | -- [CLI commands and flags](./docs/cli.md) |
141 | | -- [Configuration system](./docs/configuration.md) |
142 | | -- [Logging system](./docs/logging.md) |
| 196 | +--- |
143 | 197 |
|
144 | 198 | ## 🤝 Contributing |
145 | 199 |
|
146 | | -We welcome contributions! Whether you'd like to submit bug reports, feature requests, or code |
147 | | -contributions, please feel free to contribute to making CodeGate better. We thank you! |
| 200 | +We welcome contributions! Whether you're submitting bug reports, feature |
| 201 | +requests, or code contributions, your input makes CodeGate better for everyone. |
| 202 | +We thank you ❤️! |
| 203 | + |
| 204 | +Start by reading our |
| 205 | +[Contributor guidelines](https://github.com/stacklok/codegate/blob/main/CONTRIBUTING.md). |
148 | 206 |
|
149 | | -Start by reading the [Contributor Guidelines](./CONTRIBUTING.md). |
| 207 | +--- |
| 208 | + |
| 209 | +## 🌟 Support us |
| 210 | + |
| 211 | +Love CodeGate? Starring this repository and sharing it with others helps |
| 212 | +CodeGate grow 🌱 |
| 213 | + |
| 214 | +[](https://github.com/stacklok/codegate) |
150 | 215 |
|
151 | 216 | ## 📜 License |
152 | 217 |
|
153 | | -This project is licensed under the terms specified in the [LICENSE](LICENSE) |
154 | | -file. |
| 218 | +CodeGate is licensed under the terms specified in the |
| 219 | +[LICENSE file](https://github.com/stacklok/codegate/blob/main/LICENSE). |
| 220 | + |
| 221 | +--- |
155 | 222 |
|
156 | 223 | <!-- markdownlint-disable-file first-line-heading no-inline-html --> |
0 commit comments