Skip to content

Commit ff9bce7

Browse files
committed
docs guardrails
1 parent a87cb87 commit ff9bce7

8 files changed

Lines changed: 63 additions & 70 deletions

new-docs/src/content/docs/codacy-api/examples/adding-people-to-codacy-programmatically.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Substitute the placeholders with your own values:
3232

3333
- **EMAIL#1...N:** Email addresses of the people to be added. For example, `no-reply@codacy.com`.
3434

35+
3536
## Example: Adding people from a file containing emails
3637

3738
We provide an example Bash script that adds all emails in a text file to Codacy. We suggest that you adapt the script to your specific scenario.

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-faq.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
title: FAQs
33
---
44

5-
# FAQs
6-
75
## How do I install Codacy Guardrails?
8-
Please have a look at our [documentation](codacy-guardrails-getting-started.md)
6+
Please have a look at our [documentation](codacy-guardrails-getting-started.md).
97

108
## Does Guardrails only work with AI-generated code?
119
No. While Guardrails does scan and autofix AI code as part of the agent flow, it scans any code shown in your IDE in real-time, regardless of how it was written.
@@ -19,7 +17,6 @@ Yes, local scanning via Codacy CLI works offline. API-based features (like query
1917
## Which AI security and quality standards can I enforce with Guardrails?
2018
Codacy Guardrails detects and autoremediate security risks and quality issues in JavaScript, TypeScript, Python, and Java, including:
2119

22-
2320
- SAST vulnerabilities
2421
- Hardcoded secrets
2522
- Insecure dependencies
@@ -52,7 +49,6 @@ Codacy Guardrails is a free IDE Extension for local scanning of AI-generated and
5249

5350
Check our [Team and Organization plans](https://www.codacy.com/pricing) to unlock:
5451

55-
5652
- Central configuration and enforcement of AI coding standards across teams and projects
5753
- Query and autofix existing problems across your codebase from the AI chat panel
5854
- Generate custom security and code quality reports using AI prompts
@@ -77,7 +73,6 @@ Without an AI coding agent, you can still use the IDE extension for local analys
7773

7874
If you wish to continue using a previous version a little longer, you can do so by:
7975

80-
8176
1. Open the Extensions tab
8277

8378
2. Select `Codacy`

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-getting-started.md

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
title: Getting Started
33
---
44

5-
# Getting Started
6-
75
Codacy Guardrails is a brand new way of enforcing code security and quality standards for AI-generated code, built into the free Codacy IDE Extension for VSCode, Copilot, Cursor, and Windsurf. Guardrails help developers ship safer, cleaner AI code by applying best practices and blocking insecure patterns while the code is being generated.
86

97
Besides real-time AI code scanning, Guardrails users can now prompt all their Codacy findings, without ever leaving the AI chat panel inside their IDE.
108

119
**New to Codacy Guardrails?** [Check our blog post](https://blog.codacy.com/codacy-guardrails-free-real-time-enforcement-of-security-and-quality-standards)
1210

13-
<iframe width="560" height="315" src="https://www.youtube.com/embed/uVyRWnnJu-0?si=Pnbk65EvpvvJRXX4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
11+
<iframe width="560" height="315" style="height: 315px" src="https://www.youtube.com/embed/uVyRWnnJu-0?si=Pnbk65EvpvvJRXX4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1412

1513

1614
# VSCode-based IDEs
@@ -27,9 +25,10 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co
2725
- Linux
2826
- Windows (via WSL)
2927

30-
!!! important
31-
**For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows.
32-
We currently only support VSCode, Cursor, and Windsurf on Windows.
28+
:::caution
29+
**For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows.
30+
We currently only support VSCode, Cursor, and Windsurf on Windows.
31+
:::
3332

3433

3534
### Supported IDEs
@@ -38,8 +37,9 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co
3837
- Cursor
3938
- Windsurf
4039

41-
!!! note
42-
For Visual Studio Code, the Insiders version is recommended for its faster performance and compatibility with Codacy Guardrails. However, since it's a beta version, you may encounter occasional issues.
40+
:::note
41+
For Visual Studio Code, the Insiders version is recommended for its faster performance and compatibility with Codacy Guardrails. However, since it's a beta version, you may encounter occasional issues.
42+
:::
4343

4444
### Built-in Scanners
4545

@@ -52,7 +52,7 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co
5252
- [Lizard](https://docs.codacy.com/release-notes/cloud/cloud-2025-02-adding-ruff-lizard/#lizard)
5353
- Revive
5454

55-
## How to install - Quick Guide {: id="how-to-install-quick-guide"}
55+
## How to install - Quick Guide {#how-to-install-quick-guide}
5656

5757
#### Note for Windows users:
5858
To take advantage of Codacy Guardrails on Windows, you might need to setup WSL first, [check the steps here.](#how-to-install-wsl)
@@ -80,11 +80,13 @@ It will create a folder in your local repository called **.codacy** with all nee
8080
- The configuration from all built-in scanners
8181
- Codacy CLI script to run analysis locally
8282

83-
!!! note
84-
If you don't want this folder to be part of your repository in future commits but continue working with it locally, please add **.codacy** to your .gitignore file
83+
:::note
84+
If you don't want this folder to be part of your repository in future commits but continue working with it locally, please add **.codacy** to your .gitignore file
85+
:::
8586

86-
!!! note
87-
The IDE extension will ignore any CLI version already installed (e.g. through brew or other package manager) on the machine.
87+
:::note
88+
The IDE extension will ignore any CLI version already installed (e.g. through brew or other package manager) on the machine.
89+
:::
8890

8991

9092
### 3. Check if the Codacy MCP Server is properly setup
@@ -95,8 +97,9 @@ If you don't want Guardrails to automatically generate the instructions file, go
9597

9698
![Guardrails instructions setting](images/guardrails-instructions-setting.png)
9799

98-
!!! warning
99-
The absence of the instructions file will impact the Guardrails experience.
100+
:::warning
101+
The absence of the instructions file will impact the Guardrails experience.
102+
:::
100103

101104
You can later generate the instructions manually from the Guardrails section of the extension.
102105

@@ -106,7 +109,7 @@ You can later generate the instructions manually from the Guardrails section of
106109
* Remember that for you to be able to interact with Codacy MCP server, you must be on the `Agent` mode of the chat, not the default `Ask` mode.
107110
* If you're still having issues with the MCP server, try to run the command `Preferences: Open User Settings (JSON)`, look for the Codacy MCP server settings and right on top of it you'll should see a `Start` option. Click on it and, if unsuccessful, go to `View > Debug Console` and check for errors. Don't forget to ensure you have `node.js` and `npx` installed and set up.
108111

109-
## How to install - WSL {: id="how-to-install-wsl"}
112+
## How to install - WSL {#how-to-install-wsl}
110113

111114
### 1. Install or update [WSL.](https://learn.microsoft.com/en-us/windows/wsl/install)
112115

@@ -117,7 +120,7 @@ You can later generate the instructions manually from the Guardrails section of
117120

118121
## How to install - Manually
119122

120-
### 1. Install and activate the Codacy CLI for local analysis {: id="install-cli"}
123+
### 1. Install and activate the Codacy CLI for local analysis {#install-cli}
121124

122125
#### Download
123126

@@ -150,12 +153,13 @@ Before running the analysis, install the specified tools:
150153
codacy-cli install
151154
```
152155

153-
### 2. Install MCP Server {: id="install-mcp-server"}
156+
### 2. Install MCP Server {#install-mcp-server}
154157

155158
If you want to use MCP Server with a NPM package you should download it from [here](https://www.npmjs.com/package/@codacy/codacy-mcp)
156159

157-
!!! important
158-
You can find some limitations using this approach because the AI doesn't automatically analyse the code generated unless there's a rule set for it to do so. When using the IDE extension (VS Code, Cursor, or Windsurf), we create those AI rules for the workspace, but if you are installing the MCP manually, you will need to create those rules by yourself. <a href="mailto:support@codacy.com">Let us know if you you plan to use this approach, so we can provide more information</a>
160+
:::caution
161+
You can find some limitations using this approach because the AI doesn't automatically analyse the code generated unless there's a rule set for it to do so. When using the IDE extension (VS Code, Cursor, or Windsurf), we create those AI rules for the workspace, but if you are installing the MCP manually, you will need to create those rules by yourself. <a href="mailto:support@codacy.com">Let us know if you you plan to use this approach, so we can provide more information</a>
162+
:::
159163

160164
#### Setup
161165

@@ -238,8 +242,9 @@ c. Open the Copilot chat and switch the mode to `Agent`. You can check that the
238242
- Linux
239243
- Windows (via WSL)
240244

241-
!!! important
242-
**For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. **Only local analysis** are supported for Windows, as MCP support for JetBrains IDEs is still not completely done.
245+
:::caution
246+
**For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. **Only local analysis** are supported for Windows, as MCP support for JetBrains IDEs is still not completely done.
247+
:::
243248

244249

245250
### Supported IDEs
@@ -249,8 +254,9 @@ c. Open the Copilot chat and switch the mode to `Agent`. You can check that the
249254
- PhpStorm
250255
- Others in the suite
251256

252-
!!! note
253-
For JetBrains IDEs, IntelliJ isn't the only supported editor, but is our primary focus. If you use other editors such as PyCharm and run into any issues, feel free to open an issue in our extension's [repository](https://github.com/codacy/codacy-intellij-extension). Check the [extension page](https://tinyurl.com/codacy-jetbrains-extension) on the marketplace to see the full list of supported IDEs.
257+
:::note
258+
For JetBrains IDEs, IntelliJ isn't the only supported editor, but is our primary focus. If you use other editors such as PyCharm and run into any issues, feel free to open an issue in our extension's [repository](https://github.com/codacy/codacy-intellij-extension). Check the [extension page](https://tinyurl.com/codacy-jetbrains-extension) on the marketplace to see the full list of supported IDEs.
259+
:::
254260

255261
### Built-in Scanners
256262

@@ -263,18 +269,18 @@ c. Open the Copilot chat and switch the mode to `Agent`. You can check that the
263269
- [Lizard](https://docs.codacy.com/release-notes/cloud/cloud-2025-02-adding-ruff-lizard/#lizard)
264270
- Revive
265271

266-
## How to install - JetBrains Quick Guide {: id="how-to-install-quick-guide-jetbrains"}
272+
## How to install - JetBrains Quick Guide {#how-to-install-quick-guide-jetbrains}
267273

268274
#### Note for Windows users:
269275
To take advantage of Codacy Guardrails on Windows, you need to set up WSL first; [check the steps here](#how-to-install-wsl). **Only local analysis** are supported for Windows, as MCP support for JetBrains IDEs is still not completely done.
270276

271277
### 1. Install the extension
272278

273-
274279
You can either install the dependency from the [JetBrains marketplace](https://tinyurl.com/codacy-jetbrains-extension) or search for it directly in your Codacy plugin's settings.
275280

276-
!!! note
277-
If you don’t see the Codacy plugin icon on the left taskbar after installing it, go to View > Tool Windows > Codacy
281+
:::note
282+
If you don’t see the Codacy plugin icon on the left taskbar after installing it, go to View > Tool Windows > Codacy
283+
:::
278284

279285
![Install Extension](images/install-codacy-extension-jetbrains.png)
280286

@@ -290,11 +296,13 @@ It will create a folder in your local repository called **.codacy** with all nee
290296
- The configuration from all built-in scanners
291297
- Codacy CLI script to run analysis locally
292298

293-
!!! note
294-
If you don't want this folder to be part of your repository in future commits but continue working with it locally, please add **.codacy** to your .gitignore file
299+
:::note
300+
If you don't want this folder to be part of your repository in future commits but continue working with it locally, please add **.codacy** to your .gitignore file
301+
:::
295302

296-
!!! note
297-
The IDE extension will ignore any CLI version already installed (for example, through brew or other package manager) on the machine.
303+
:::note
304+
The IDE extension will ignore any CLI version already installed (for example, through brew or other package manager) on the machine.
305+
:::
298306

299307

300308
### 3. Install MCP Server
@@ -311,8 +319,9 @@ In your IntelliJ settings, search the settings for the agent of your choice (Jun
311319

312320
![Codacy MCP Server is enabled](images/mcp-settings-extension-jetbrains.png)
313321

314-
!!! note
315-
You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP.
322+
:::note
323+
You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP.
324+
:::
316325

317326
#### c. Confirm the settings of your Codacy extension
318327

@@ -327,8 +336,9 @@ Install the guidelines by clicking on **Install AiAgent Guidelines** on the Coda
327336

328337
![Install Agent Guidelines](images/codacy-extension-activate-cli-jetbrains.png)
329338

330-
!!! note
331-
You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP.
339+
:::note
340+
You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP.
341+
:::
332342

333343
### 4. Restart your IDE to apply changes
334344

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-how-to-configure-rules.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: How to customize the analysis rules for Codacy Guardrails
33
---
44

5-
# How to customize the analysis rules for Codacy Guardrails
6-
75
By default, if no API token is provided in the [MCP Server setup](codacy-guardrails-getting-started.md/#3-install-mcp-server), Codacy uses a predefined configuration that includes all recommended rules (or [code patterns](../repositories-configure/configuring-code-patterns.md) that you can find on many parts of our product) from the supported built-in scanners.
86

97
However, when an API token is used, Codacy automatically retrieves the current rule configuration directly from your repository.
@@ -15,9 +13,9 @@ You can configure your rules in one of two ways:
1513

1614
- Using the [Codacy UI](#using-the-codacy-ui)–for quick, manual adjustments.
1715

18-
!!! note
19-
If you're already using a configuration file, please we recommend you can follow the first way. Otherwise, the second way is the best for you, so you can configure directly in the Codacy platform.
20-
16+
:::note
17+
If you're already using a configuration file, please we recommend you can follow the first way. Otherwise, the second way is the best for you, so you can configure directly in the Codacy platform.
18+
:::
2119

2220
## Using configuration files
2321

@@ -73,17 +71,13 @@ To use a configuration file for a static analysis tool:
7371

7472
2. Open the repository **Code patterns** page, select the tool of interest, and activate the toggle to use a configuration file.
7573

76-
!!! note
77-
- After activating a configuration file for a tool, Codacy uses that configuration file even if you [exclude it from Codacy analysis](../repositories-configure/ignoring-files.md).
78-
79-
- When [using a tool configuration file alongside a coding standard](../organizations/using-coding-standards.md#using-with-tool-configuration), the configuration file controls the code patterns, while the coding standard controls whether the tool is enabled or disabled.
80-
81-
- Codacy uses the version of the configuration file **in the branch being analyzed**. For example, if you open a pull request that includes changes to the configuration file, the analysis results take those changes into account.
82-
83-
- If Codacy analyzes a branch that doesn't include the configuration file, Codacy reverts to using the code patterns configured for the tool before you selected the option **Configuration file** on the Code patterns page.
84-
85-
- For performance reasons, when you update pattern settings using a configuration file, Codacy may display outdated messages for issues identified previously by those patterns.
86-
74+
:::note
75+
- After activating a configuration file for a tool, Codacy uses that configuration file even if you [exclude it from Codacy analysis](../repositories-configure/ignoring-files.md).
76+
- When [using a tool configuration file alongside a coding standard](../organizations/using-coding-standards.md#using-with-tool-configuration), the configuration file controls the code patterns, while the coding standard controls whether the tool is enabled or disabled.
77+
- Codacy uses the version of the configuration file **in the branch being analyzed**. For example, if you open a pull request that includes changes to the configuration file, the analysis results take those changes into account.
78+
- If Codacy analyzes a branch that doesn't include the configuration file, Codacy reverts to using the code patterns configured for the tool before you selected the option **Configuration file** on the Code patterns page.
79+
- For performance reasons, when you update pattern settings using a configuration file, Codacy may display outdated messages for issues identified previously by those patterns.
80+
:::
8781

8882

8983
![Using a configuration file](images/code-patterns-config-file.png)
@@ -135,6 +129,7 @@ Select the coding standards that you want to follow or stop following and click
135129

136130
![Customize applied coding standards](images/code-patterns-cs-customize-modal.png)
137131

138-
!!! note
139-
- Scanners and rules enabled by a coding standard are enforced and can't be disabled.
140-
- You can add extra scanners and rules, if these aren't enabled by any applied coding standard.
132+
:::note
133+
- Scanners and rules enabled by a coding standard are enforced and can't be disabled.
134+
- You can add extra scanners and rules, if these aren't enabled by any applied coding standard.
135+
:::

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-how-to-use.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: Using Codacy Guardrails
33
---
44

5-
# Using Codacy Guardrails
6-
75
## Recommended configurations
86

97
<table>
@@ -63,7 +61,6 @@ c. After a new analysis, It shows us that it has 0 issues in the code
6361

6462
Once your repository is connected to Codacy, you can go beyond traditional static analysis and start interacting with your codebase using natural language prompts.
6563

66-
6764
a. Let's run a quick example with the prompt:
6865

6966
```text
@@ -72,7 +69,6 @@ Can you list all security issues in my repository?
7269

7370
![Prompt list the security issues in my repository](images/prompt-list-security-issues-repository.png)
7471

75-
7672
b. Right after running this prompt, there is a MCP tool call to search all security issues in my repository. Click in **Run tool**
7773

7874
![List the security issues in my repository](images/run-mcp-tool-list-security-issues.png)

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-limitations.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: Limitations
33
---
44

5-
# Limitations
6-
75
## Limitations with Windows
86

97
Windows WSL (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. Additionally, at this point we're only supporting VSCode and VSCode-based IDEs on Windows.

new-docs/src/content/docs/codacy-guardrails/codacy-guardrails-troubleshooting.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: Troubleshooting
33
---
44

5-
# Troubleshooting
6-
75
## Node
86

97
### Claude Desktop

0 commit comments

Comments
 (0)