Skip to main content

How to create a Monitoring Agent

Tess Geri avatar
Written by Tess Geri
Updated over 3 weeks ago

Objective

Learn how to create a Monitoring Agent in Sweep to identify configuration risks, enforce best practices, and maintain org health across your Salesforce environment.

What It Is

Sweep’s Monitoring Agent continuously scans your Salesforce org for potential issues, performance bottlenecks, and best-practice violations.

Monitoring Agents can be tailored to specific objects (like Account or Lead) or metadata types (like Flows, Validation Rules, or Apex Classes).

Each agent provides actionable insights and can be updated or resolved directly from the workspace.

Step 1: Open the Agentic Layer

Go to the top navigation bar and click Agentic Layer.

Step 2: Create a new Monitoring Agent

Click + Create New in the top right corner.

In the modal that appears, select Monitoring and click Launch agent.

Step 3: Choose how you want to begin monitoring

You now have two options:

Option A - Start with an Object

Monitor a specific object such as Lead, Account, Case, Opportunity, or any custom object.

Option B - Start with a Metadata Type

Monitor a metadata type across the entire org - such as Flows, Apex Classes, Validation Rules, Layouts, or Custom Metadata.

Option A: Start by Choosing an Object

Step 4: Select the object

Open the dropdown and choose the object you want to monitor.

Step 5: Select the configurations to monitor

Sweep automatically pulls all related configurations for the chosen object - such as:

  • Automations (Flows, PB, Workflows)

  • Apex classes

  • Validation rules

  • Page layouts

  • And more

You can choose all of them or only the ones you care about.

Step 6: Select best practices

This step defines what types of issues your Monitoring Agent should look for.

You can:

➤ Use Sweep’s Recommended Best Practices

These include widely accepted Salesforce hygiene and performance guidelines.

➤ Use Custom Best Practices (your own rules)

You can create bespoke rules that reflect internal naming conventions, governance policies, or custom requirements.

Once you’ve chosen the best practices, click Create Agent.

Option B: Start by Choosing a Metadata Type

If you prefer to monitor a metadata type (e.g., all Flows, all Apex Classes, all Layouts), start by selecting the metadata type from the dropdown.

Sweep will then scan every object where this metadata type exists.

You will then go through the same steps:

  • Choose configurations

  • Choose best practices

  • Create the agent

Step 7: View and manage detected issues

Once the agent is created, Sweep automatically scans your configurations.

You’ll see a table of detected issues, with filters for:

  • Metadata type

  • Issue type

  • Impact (High / Medium / Low)

  • Status (Open / Resolved / Dismissed)

New issues are labeled NEW, so you can easily spot recently discovered items.

Step 8: Open an issue to see full detail

Click any issue to expand it and view:

  • The violated best practice

  • The exact evidence from your metadata

  • A clear explanation of what is wrong

  • How to fix it

Step 9: Manage issue lifecycle

You can update an issue’s status at any time:

Open → unresolved and still relevant

Resolved → fixed manually or automatically

Dismissed → not relevant or intentionally ignored

Sweep continuously re-scans to detect:

  • Newly created issues

  • Automatically resolved issues

  • Changes in configuration that affect existing issues

Step 10: Edit the agent anytime

On the left panel, you can modify:

  • The configurations being monitored

  • The best practices (recommended or custom)

Whenever you update settings, Sweep automatically re-scans and refreshes the table.

Step 11: Ask the agent anything

Your Monitoring Agent can answer questions such as:

  • “Which issues should I fix first?”

  • “Explain why this issue is high impact.”

  • “How do I fix this best practice violation?”

  • “Show me all issues related to Apex on Lead.”

  • “Which issues were added in the last 7 days?”

The chat panel at the bottom lets you investigate any issue deeply and interactively.

Did this answer your question?