# Agent Configuration Parameters

The Go Agent supports various configuration parameters that control its behavior in different usage modes. This page summarizes the different approaches you can use to apply configuration parameters and adds context to the detailed parameter reference table, found: [Go Agent Parameter Reference Table](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/agent-configuration-parameters/go-agent-parameter-reference-table.md)

### Usage Mode-Specific Parameters

The Go Agent operates in two distinct usage modes, and many configuration parameters apply only to specific modes:

* **Coverage Listener Mode** - Parameters used when instrumenting applications to collect coverage data.
* **Test Runner Mode** - Parameters used when instrumenting test frameworks that run separately from the application to collect test execution details
* **Both modes** - Parameters used in either agent operating mode.

The [Go Agent Parameter Reference Table](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/agent-configuration-parameters/go-agent-parameter-reference-table.md) table indicates which usage mode each parameter applies to, helping you focus on the relevant settings for your specific implementation.

### Ways to Configure Agent Parameters

The Go Agent supports three different ways to set configuration parameters:

* **Environment Variables** - Set via shell environment (e.g., `SL_TOKEN=your-token`)
* **CLI Flags** - Provided as command-line arguments (e.g., `--token=your-token`)
* **Configuration File** - Specified in a YAML file (default: `.slconfig.yaml`)

Not all parameters can be set using all three methods. The [reference table](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/agent-configuration-parameters/go-agent-parameter-reference-table.md) shows exactly which methods are available for each parameter, with empty cells indicating that method is not supported for that parameter.

#### When Using a Configuration File

The agent automatically loads configuration from `.slconfig.yaml` if this file exists in the directory where you run agent commands. To use a different configuration file name, specify it with the `--config` flag as part of the `slgoagent config` command:

```bash
./slgoagent config --config=custom-config.yaml --token="./token-file.txt"
```

When the same parameter is set using multiple methods, the following precedence order applies (highest to lowest priority):

1. **Environment Variables** (highest priority)
2. **CLI Flags** (medium priority)
3. **Configuration File** (lowest priority)
4. **Default Values** (used only when parameter is not set by any other method)

### Default Values

Many parameters have built-in default values that are used when the parameter is not explicitly configured. If a default value exists for a parameter, it will be shown in the reference table.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/agent-configuration-parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
