Skip to main content

Use Assess CLI with Python agents

Use this procedure if you are using Contrast Python agents and want tto find vulnerabilities while running API or end-to-end testing..

Before you begin


  1. Install the agent using pip:

    pip install contrast-agent


    If you have a  requirements.txt  file, you can add  contrast-agent  to that file, and install with  pip install -r requirements.txt .


    Do not create a configuration (YAML) file for the agent. The Assess CLI creates this file automatically.

  2. Verify that  autoconf  is installed on the system where you will run the agent.

  3. Open a terminal window and enter the Assess CLI command:

    contrast assess

    This command generates the agent configuration file that the Contrast CLI and the agent share. CLI commands describes the options for this command, including the path for the configuration file.

    You see output similar to this:

    ✔Configuration file found at "user_path"

    ⠼ Waiting for the session to be created.

  4. Run your application using your IDE or a second terminal window.

  5. Exercise your application, either interactively or using automated API or end-to-end tests.

  6. In the terminal window where you entered the Assess CLI command, view the results.