# Source: https://docs.snyk.io/integrations/snyk-studio-agentic-integrations/quickstart-guides-for-snyk-studio/antigravity-guide.md

# Antigravity guide

Add Snyk Studio to Google Antigravity to secure code generated with agentic workflows through a Large Language Model (LLM). This can be achieved in several ways. When you use it for the first time, Snyk Studio will ask for trust and trigger authentication if necessary.

### Install Antigravity

Visit the [Google Antigravity](https://antigravity.google/) website to download the correct version of the IDE.

### Install using the Snyk Studio plugin

{% hint style="warning" %}
The Snyk MCP server cannot be manually installed. Use the Snyk Security plugin in Google Antigravity.
{% endhint %}

* Click [this link](antigravity:extension/snyk-security.snyk-vulnerability-scanner) to open the Snyk Security plugin in Google Antigravity directly.
* Click **Install**.

If asked to trust the publisher, select **Trust Publisher & Install.**

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fgit-blob-3633c3e49583234ae694b21f8be8e4e37d05437c%2FScreenshot%202025-11-24%20at%2012.08.02%E2%80%AFPM.png?alt=media" alt="Popup in Snyk Security plugin asking for trust verification" width="410"><figcaption><p>Popup in Snyk Security plugin asking for trust verification</p></figcaption></figure>

## Set up Snyk Studio

{% hint style="info" %}
As a one-time setup, you may need to authenticate and trust the current Project directory. If required, the agentic workflow will likely manage this automatically.
{% endhint %}

### Enable "Secure At Inception"

On installation completion, a modal prompts you to opt in to Snyk Studio's "[Secure at inception](https://docs.snyk.io/discover-snyk/getting-started/glossary#secure-at-inception)." This action automatically configures the necessary rules to scan any new AI generated code. Additional options are available on the **Settings** page for the plugin.

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fgit-blob-dbda5302c4c790a67fe757a02f2c29e2ef81b028%2FScreenshot%202025-11-24%20at%2012.08.20%E2%80%AFPM.png?alt=media" alt="Modal prompting you to opt in to Secure at inception" width="404"><figcaption><p>Modal prompting you to opt in to Secure at inception</p></figcaption></figure>

### Authenticate

When you have made a selection regarding Secure at inception, you will be asked to authenticate. You can authenticate at two points in this process:

* Immediately after plugin install
* Before your first Snyk code scan

As part of the authentication flow, you will be asked to either sign up or sign in on the Snyk website. A browser window will open.

For new users, select the preferred sign up method and agree to the terms on the next screen. On successful authentication, you will be instructed to return to your IDE.

{% hint style="info" %}
To use Snyk Studio, specifically Snyk's SAST scanning capabilities, you need to enable [Snyk Code](https://docs.snyk.io/scan-with-snyk/snyk-code). Snyk Code analyzes your code for vulnerabilities and temporarily clones the repository and or uploads your code. Cloned or uploaded code is cached according to our [data retention policy](https://docs.snyk.io/snyk-data-and-governance/how-snyk-handles-your-data). With the Snyk Free Plan, Snyk Code offers unlimited scans for open source projects, and limited tests for 1st-party code. For more details, visit [Plans and Pricing](https://snyk.io/plans/).
{% endhint %}

For existing users, select the login method associated with your account. If you do not have access to Snyk Code, your LLM will prompt you to enable it prior to your first scan. You can also [enable it directly in Snyk's Settings](https://docs.snyk.io/implementation-and-setup/enterprise-implementation-guide/phase-2-configure-account/set-visibility-and-configure-an-organization-template/enable-snyk-code).

{% hint style="info" %}
If you are enabling Snyk Code for the first time, you must import or re-import existing projects in order to properly scan them.
{% endhint %}

### Run Snyk Studio

On authentication, Snyk Studio will be triggered whenever new code is generated by the LLM. If Snyk Studio is not enabled, restart your IDE and try generating code again.

{% hint style="info" %}
Free users are limited to a set number of scans. If you reach the allotment, we recommend [reaching out to sales](https://snyk.io/contact-us/) to unlock additional thresholds.
{% endhint %}

## Examples

### Scanning for security vulnerabilities

In the chat, you can tag specific files or functions and ask \[add MCP guide name] to scan your code for safely deploying to production:

{% code title="prompt" overflow="wrap" %}

```
Scan this directory for code security & dependency vulnerabilities and security issues
```

{% endcode %}

Google Antigravity indicates that this request is related to security vulnerability scanning and calls the Snyk MCP Server for various scans.

Google Antigravity is then able to gather all the security scanning results, both code (SAST) and dependencies (SCA), and based on recommendations and contextual information provided by the Snyk MCP Server, it is now able to provide code changes that address some or all of the security vulnerabilities that were found.

### "Secure at inception" rules

To practice [Secure at inception](https://docs.snyk.io/discover-snyk/getting-started/glossary#secure-at-inception), Snyk recommends adopting rules that align the LLM for secure code generation and workflows.

The following is a suggested instruction for Google Antigravity's rules if you choose to implement on your own instead of controlling then through Snyk's Secure At inception setting. Add these to your environment's global rules file or you must add them again in every project.

{% code title="Antigravity rule" overflow="wrap" %}

```
Always run Snyk Code scanning tool for new first party code generated.
Always run Snyk SCA scanning tool for new dependencies or dependency updates.
If any security issues are found based on newly introduced or modified code or dependencies, attempt to fix the issues using the results context from Snyk.
Rescan the code after fixing the issues to ensure that the issues were fixed and that there are no newly introduced issues.
Repeat this process until no issues are found.
```

{% endcode %}