Configure an agent

When you download and install an agent, you will need to configure the agent so it works properly with your application and your agent language. To configure the agent:

  1. Download the agent-specific YAML configuration file from Contrast. This file is already populated with the API configuration values needed to connect Contrast.

  2. In addition to the standard configuration for your agent that appears in this file, each agent has unique properties that may need to be configured individually.

    You can use a YAML template for your agent language to adapt the config file to your particular situation.

    Select the language to access the YAML template and learn more about agent-specific configuration: Java, .NET, .NET Core, Node.js, Python, Ruby).

  3. Be sure the config file is called contrast_security.yaml and is in the proper place for your agent. Read more about the order of precedence.


You can use environment variables, YAML properties or command line to specify every configuration option supported by the contrast_security.yaml file. If you consistently use just one of these methods, you may avoid confusion and simplify troubleshooting.

Environment variable names are derived from the YAML path by replacing path segment delimiters (.) with double underscores (__).

For example:

YAML path

Environment variable




Also, since YAML is a natural superset of JSON, you can configure your agent using JSON in your YAML file.