# Threat Agent - Installation & Scanning

## Getting Ready to Scan

Before running a scan with Threat Agent you should create an API key and collect your Organization ID and Entity ID from your profile screen as shown below. These can be set as environment variables or passed directly as arguments to Threat Agent during a scan.&#x20;

<figure><img src="/files/PUaiwi1O2v74B81b8K6f" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FsYCBvkQ9tL4bJFdvWLv" alt=""><figcaption></figcaption></figure>

## Threat Agent Deployment Types

Threat Agent can be deployed in two ways.&#x20;

1. **Download and install directly on host -** This requires that you have all your dependency managers  installed on you host as they will be required by Threatrix to perform a scan
2. **Docker Deployment -** If you're familiar with Docker and your deployment environment supports it, this is the easiest way to get up and running with our Threat Agent.&#x20;

## Host install and scanning

### 1. Download Threat Agent CLI

```
curl -LJO https://github.com/threatrix/threat-matrix/releases/download/agent-release-latest/threat-agent-latest.jar
```

### 2. Run Threat Agent CLI

```
java -jar threat-agent-latest.jar --oid={ORGID} --eid={ENTITYID} --api-key={AIPKEY} $PATH_TO_PROJECT
```

## Docker Scanning

```
sudo docker run --rm --name threatrix-threat-agent -v $(pwd):/app threatrix/threat-agent \
 --oid={ORGID} \
 --eid={ENTITYID} \
 --api-key={API_KEY} $PATH_TO_PROJECT
```

## Command line options

<table data-header-hidden><thead><tr><th width="203"></th><th width="130">Type</th><th width="118">Required</th><th></th></tr></thead><tbody><tr><td><strong>Argument/Flag</strong></td><td><strong>Type</strong></td><td></td><td><strong>Description</strong></td></tr><tr><td>--app-name</td><td>argument</td><td>Optional</td><td>Set or override the default project name</td></tr><tr><td>--api-key</td><td>argument</td><td>Required</td><td>API Key from your user profile</td></tr><tr><td>--api-url</td><td>argument</td><td>Optional</td><td>Threatrix API url (no need to change unless you have a self-hosted Threatrix server)</td></tr><tr><td>--oid</td><td>argument</td><td>Required</td><td>OrganizationID from user profile</td></tr><tr><td>--eid</td><td>argument</td><td>Required</td><td>EntityID from user profile</td></tr><tr><td>--scpId</td><td>argument</td><td>Optional</td><td>Existing AICertify or CodeCertify projectId</td></tr><tr><td>--repo-owner</td><td>argument</td><td>Optional</td><td>Repository Owner</td></tr><tr><td>--repo-name</td><td>argument</td><td>Optional</td><td>Repository Name</td></tr><tr><td>--branch</td><td>argument</td><td>Optional</td><td>Current Branch</td></tr><tr><td>--scm</td><td>argument</td><td>Optional</td><td><p>Indicates the sourced control management system</p><p> to which the build is attached. Possible options are</p><ul><li>GITHUB</li><li>GITLAB</li><li>BITBUCKET</li></ul></td></tr><tr><td>--scm-access-token</td><td>argument</td><td>Optional</td><td><p>The token required to create pull/merge request scan</p><p>reports.</p></td></tr><tr><td>--verbose</td><td>flag</td><td>Optional</td><td>Activate debugging</td></tr><tr><td>--progress</td><td>flag</td><td>Optional</td><td>Show progress during scan</td></tr></tbody></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.threatrix.io/threat-agent/install-config.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.
