> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/implementation-guides/team-implementation-guide/phase-5-rolling-out-the-prevention-stage/add-and-configure-snyk-to-your-ci-cd-pipeline.md).

# Add and configure Snyk to your CI/CD pipeline

How to add Snyk to your CI/CD pipeline as a gatekeeper that fails builds on new vulnerabilities

Using Snyk as a gatekeeper in your build pipeline prevents the introduction of new vulnerabilities, based on the "fail" criteria you set.

After your teams understand the vulnerabilities in their applications and develop a process for fixing them early in the development cycle, you can configure Snyk to fail your builds if Snyk detects vulnerabilities, to prevent introducing vulnerabilities into your applications.

## No import requirement

A benefit of adding tests to your pipeline is that you do not need to import the repository to Snyk using the source control integration (which is required for Snyk PR Checks). You can also use pipeline tests as an additional gate, even if you are testing PRs, to further decrease the chance of new vulnerabilities entering your production builds.

## Pipeline options

When adding Snyk to a build pipeline, there are common options:

* Using the specific [pipeline integration](https://docs.snyk.io/developer-tools/integrations/snyk-ci-cd-integrations) for your tool.
* Using the [Snyk CLI](https://docs.snyk.io/developer-tools/snyk-cli) and running the specific commands directly.

Each option has benefits. An existing pipeline integration can be faster and easier to configure, but the Snyk CLI gives you a greater range of options and flexibility in your "fail" criteria.

## Pipeline test filters

When you run a test in your pipeline, filters determine what results in a test passing or failing. The most common is the severity threshold, which you can use to fail a build only if there are High or Critical severity vulnerabilities.

## CLI supporting tools

If you use the Snyk CLI in your pipeline, a range of supporting [Snyk Tools](https://docs.snyk.io/developer-tools/snyk-apps/snyk-tools) provide additional functionality, including [`snyk-filter`](https://docs.snyk.io/developer-tools/snyk-cli/snyk-cli/scan-and-maintain-projects-using-the-cli/cli-tools/snyk-filter), which you can use for more complex "fail" criteria, such as "fail if more than three High severity vulnerabilities are found."

## Related information

The [CI/CD Best Practices](https://www.youtube.com/watch?v=6QS9gRQ0WVU) webinar covers CI/CD checks in more detail and includes an example of how to introduce this feature gradually.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/implementation-guides/team-implementation-guide/phase-5-rolling-out-the-prevention-stage/add-and-configure-snyk-to-your-ci-cd-pipeline.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
