> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/prezero/static-analysis-sast/workflows/circleci.md).

# CircleCI

This article shows you how to integrate Qwiet AI by Harness into your CircleCI workflow to provide automated code analysis.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

This tutorial assumes that you have:

* Successfully [set up CircleCI](https://circleci.com/docs/2.0/getting-started/#section=getting-started) to build your application
* [Set up Qwiet AI by Harness](broken://spaces/uPVBkglG6gsk2SsnsKgG/pages/fDfomI4jhzwCNFxmGSLc) onto the host where CircleCI installed.

## Step 1: Create your environment variables <a href="#step-1-create-your-environment-variables" id="step-1-create-your-environment-variables"></a>

On the host where you've installed Qwiet AI by Harness, create an [environment variable](https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project) containing authentication information for Qwiet. Name this variable `SHIFTLEFT_ACCESS_TOKEN`, and set its value to [the CI token you create using the Qwiet dashboard](/sast-and-sca/prezero/integrations/tokens.md).

## Step 2: Update your config file <a href="#step-2-update-your-config-file" id="step-2-update-your-config-file"></a>

To integrate Qwiet AI by Harness into your CircleCI workflow, you must edit the [.circleci/config.yml](https://circleci.com/docs/2.0/configuration-reference/) file.

For example, you could add the following to the [`steps` portion of your config file](https://circleci.com/docs/2.0/configuration-reference/#steps) to build and analyze a Java application:

```
steps:
    - run:
        name: Build the application and analyze
        command: |
            # build the application
            mvn clean package
            # create a directory for Qwiet and move the JAR file in
            mkdir -p /tmp/workspace/target 
            mv target/hello-shiftleft-0.0.1.jar /tmp/workspace/target/
            # download Qwiet and move
            curl https://cdn.shiftleft.io/download/sl > /usr/local/bin/sl && chmod a+rx /usr/local/bin/sl
            # run code analysis
            sl analyze --wait --tag branch=$CIRCLE_BRANCH --app <YOUR_APP> /tmp/workspace/target/<PATH_TO_JAR_OR_WAR> 
```

![](/files/CRrxFX9wuboXxDrdB2dv)

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)
