> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vijil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and Manage Targets

> Create, scan, schedule, and delete Targets from the Console or the command line.

A [Target](https://docs.vijil.ai/concepts/discovery/target.md) is a place you want looked at, and the unit findings
group under.

## Create a Target

> [!NOTE]
>
> The Console calls this object a **Target** on the **Targets** tab and a **scan surface** in
> the **New Scan** modal. The command line calls it a **deployment**, so every command that
> acts on a Target uses the `deployment-*` name. All three are the same object.

> [tab] Console
>
> **1. Open the New Scan Modal**
>
> Open **Discover** in the sidebar and press **+ New Scan**. If the modal shows tabs,
> stay on **Scan surfaces**.
>
> **2. Add a Scan Surface**
>
> Press **+ Add new scan surface** below the list of existing Targets.
>
> **3. Name It**
>
> Enter a **Scan surface name**, for example `prod-eks-us-west-2`, and press **Create
> scan surface**. **Back** returns you to the list without creating anything.
>
> **4. Copy the Credentials**
>
> The modal changes to **Scan surface created** and shows two values, each with a copy
> button:
>
> | Value | Use it for |
> | - | - |
> | **Scan surface ID** | The Target identifier. Every Collector and every command that acts on this Target needs it. |
> | **Enrollment code** | A credential the Console mints for you, so the first Collector can enroll without a trip to the **Scanners** sub-tab. |
>
> > [!WARNING]
> >
> > The Console shows the enrollment code in full **once**. Copy it before you press
> > **Done**, because it cannot be retrieved later. If minting fails, press **Retry mint**.
>
> Press **Done**. The new Target appears on the **Targets** tab.
>
> The enrollment code the Console mints allows **any** scanner kind and expires after **24
> hours**. For a narrower code, such as one limited to `endpoint_macos`, generate it on the
> [Scanners sub-tab](https://docs.vijil.ai/owner-guide/discover/collectors.md#choose-a-credential) instead, and
> revoke the one the Console minted.
>
> The Console creates `scanner` Targets only. To create a `dlp` Target fed by Dome
> telemetry, use the command line.

> [tab] CLI
>
> ```bash theme={null}
> vijil discover deployment-create --name "laptops" --type scanner --json
> ```
>
> | Flag | Description |
> | - | - |
> | `--name` | Display name for the Target |
> | `--type` | `scanner` for anything that scans, `dlp` for a Target fed by Dome telemetry |
> | `--json` | Output as JSON |
>
> > [!WARNING]
> >
> > The response contains a live credential, an `install_token` in plaintext. Never pipe this
> > command to a file or into a continuous integration log. Copy the `id` and let the rest
> > scroll away.
>
> The `id` in the response is the Target identifier. Every command that acts on this Target
> needs it.

## The Targets Tab

Open **Discover** in the sidebar and choose the **Targets** tab. Filter chips across the top
count Targets by kind: **All**, Endpoint, Browser, Network, Cloud, and Source code. A
Kubernetes cluster counts under **Network**, because the in-cluster Collector and the
network scanner report as the same scanner kind.

| Column | What it shows |
| - | - |
| **Source** | The Target name you gave it |
| **Kind** | What kind of Collector reports into it. A dash means none has reported yet. |
| **Last scan** | How long ago the most recent scan ran |
| **Agents** | How many Collectors report into this Target |
| **Actions** | Copy the Target identifier, or [delete the Target](#delete-a-target). Source code rows show only a delete icon, which removes the code scan. |

A chevron at the start of each row expands it to show that Target's findings, grouped into
`AI`, `Non-AI`, and `Uncertain`.

> [!WARNING]
>
> The **Agents** column counts **Collectors**. A Target showing three agents has three
> scanners installed against it. This column is separate from the
> [Agent Registry](https://docs.vijil.ai/owner-guide/register-agents/registering-agents.md).

## Inside a Target

Click a Target to open it. The identifier sits under the title with a copy button, and the
top right shows connection state and a **Scan now** button.

Two counters sit across the top:

| Counter | Meaning |
| - | - |
| **In scope** | Discovered and probed in this environment |
| **External providers** | Providers the network can reach. A provider appears here even when nobody uses it. |

After the first scan, a line beneath the counters summarizes the most recent scan: when it
ran, which Collector kind reported it, and how many Collectors it covered.

Below that sit two panels, **Usage insights** and **Agent activity**. Both fill only from
Vijil [Dome](https://docs.vijil.ai/concepts/platform/dome.md) telemetry pointed at this Target, and both stay empty
on a Target that only runs scans.

> [!WARNING]
>
> The word "Agent" carries two meanings on this screen. In the **Agent activity** panel it
> means an AI Agent. In the **Agents** column and the connection badge it means a Collector.

Below them, five sub-tabs:

| Sub-tab | What it holds |
| - | - |
| **Scan history** | Every scan run against this Target and what each returned |
| **Schedule** | Recurring scan configuration |
| **Scanners** | Scanner tokens and enrollment codes for this Target |
| **Policies** | Rules that say what this scope allows |
| **Violations** | Findings that breached those rules |

The header badge reads **Agent online**, **Agent stale**, **No agent reporting**, or **No
agent connected**.

## Run a Scan

Press **Scan now** on the Target, or:

```bash theme={null}
vijil discover scan-now <target-id>
```

You can also press **+ New Scan** on **Discover**. If the modal shows tabs, stay on
**Scan surfaces**. The modal calls Targets "scan surfaces". Pick one and press **Scan**.
When there are more than five, a filter box above the list matches by name or identifier.
If the Target you want is not in the list, press **+ Add new scan surface** below it to
[create one](#create-a-target) without leaving the modal.

Collectors poll every 30 seconds by default, so expect a short delay before the scan starts.

**Scan now** reaches only Collectors that checked in within the last 24 hours. If none
have, the Console tells you that it queued nothing. If the Target has no Collector
connected, the Console asks you to confirm first.

## Schedule Recurring Scans

Open the **Schedule** sub-tab, or use the command line:

```bash theme={null}
vijil discover config-get <target-id>
vijil discover config-set <target-id> --body @schedule.json
```

`--body` takes a JSON object inline, or `@file` to read one from a file.

Schedule a recurring scan for any Target you intend to keep.

## Delete a Target

> [tab] Console
>
> **1. Find the Target**
>
> Open **Discover** and choose the **Targets** tab.
>
> **2. Press the Trash Icon**
>
> In the **Actions** column of the Target's row, press the trash icon labeled
> **Delete scan surface**.
>
> **3. Confirm**
>
> The **Delete scan surface?** dialog names the Target and lists what goes with it.
> Press **Delete** to confirm, or **Cancel** to keep it.
>
> The Console confirms with **Scan surface deleted**, and the row disappears from the list.

> [tab] CLI
>
> ```bash theme={null}
> vijil discover deployment-delete <target-id>
> ```
>
> The command asks for confirmation. Pass `--yes` in a script.

> [!WARNING]
>
> Deleting a Target cannot be undone. It removes the Target's Collectors, enrollment codes,
> policies, and scan history.

You can skip revoking the credentials first. Any Collector still installed on a machine
loses its ability to report, so uninstall those separately.

## Next Steps

> [card] [Install a Collector](https://docs.vijil.ai/owner-guide/discover/collectors.md)
>
> Credentials and install steps for each kind.

> [card] [Review Discovered Resources](https://docs.vijil.ai/owner-guide/discover/reviewing-resources.md)
>
> Read what a scan returned.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.