---
title: "Can I Automate Agent Assignment based on Target Type?"
url: "https://dm0bkdes5q7a2ls.productfruits.help/en/article/05dc6fb4-bc70-4896-badf-16cf100e2a40"
language: "en"
last_updated: "2026-04-30T15:07:28.179Z"
---

# Can I Automate Agent Assignment based on Target Type?

Use Agent Tags and Scan Templates to approximate automatic Agent assignment.

While the Spirion Console does not currently have a single "Auto-Assign" toggle that matches agents to targets based on type, you can achieve this level of automation using **Agent Tags** and **Scan Templates**.

By aligning your organizational logic with these two features, you can create a "set it and forget it" workflow that effectively automates the assignment process.

## 1\. The "Tag-to-Target" Strategy (Recommended)

The most effective way to automate this is to create a naming and tagging convention that links your worker fleet to your data assets.

### Step 1: Tag your Agents by Capability

Assign tags to your agents based on what they are optimized to scan.

-   Tag: `DB_Workers` (Agents with ODBC drivers and high RAM).
-   Tag: `Cloud_Workers` (Agents with high-speed internet egress for M365/SaaS).
-   Tag: `FileShare_Workers` (Agents network-close to your NAS/SAN).

### Step 2: Create Type-Specific Scans

When you create a scan for a "SQL Database" target, assign the `DB_Workers` **Agent Tag** instead of individual agent names.

-   **The Result:** Any time you install a new Agent and give it the `DB_Workers` tag, it is **automatically** enrolled in every database scan you have scheduled.
-   You never have to edit the scan definition again.

## 2\. Use Scan Templates for Consistency

If you frequently add new targets of the same type (for example, new SharePoint sites or new departmental file shares), use **Scan Templates**.

-   **How it works:** Create a "Master Template" for each target type (e.g., `Template_SharePoint_Scan`). In that template, pre-assign the correct **Agent Tags** (e.g., `Cloud_Workers`).
-   **The Automation:** When a new SharePoint site is added to your environment, simply "Clone" the template. The correct agents are already assigned, ensuring that your "Cloud Workers" are always the ones handling SharePoint data.

## 3\. Advanced Automation via Web API

For large-scale environments, you can fully automate this process using the **Spirion Web API**.

-   **The Workflow:**
-   1.  Write a script that polls your **Data Asset Inventory** for new targets.
    2.  If the script detects a new target of type `Database`, it uses the API to create a new scan (or update an existing one).
    3.  The script automatically includes the `DB_Workers` agent tag in the API payload for that scan.
-   **Benefit:** This creates a "Zero-Touch" onboarding process where new data assets are discovered, categorized, and assigned to the correct worker fleet without human intervention.

## Best Practices for Automated Assignment

-   **Avoid "Universal" Tags:** Don't give every agent a `General_Worker` tag and assign it to everything. This leads to "Agent Contention," where an agent might try to scan a massive database and a local workstation at the same time, causing performance degradation.
-   **Monitor "Agent Health" by Tag:** Use the **Agents** page to filter by tag. If your `DB_Workers` are consistently showing high CPU usage, you know you need to deploy more Agents with that specific tag.
-   **Proximity is Still King:** Even with automation, ensure your tags reflect geography or network segments (e.g., `DB_Workers_EMEA`). Automating an assignment that pulls data across an ocean will always result in poor performance.

## Summary

You can "automate" assignment by moving away from **Individual Agent Assignment** and moving toward **Tag-Based Assignment**.

By combining **Agent Tags** with **Scan Templates**, you ensure that the right type of worker is always assigned to the right type of data, even as your environment grows.
