---
schema_version: "1"
id: d9e864bc8175273cab5975d7bb8cd29c53cb1db4a6593f947ba628b5111160cf
title: Create a Filter to Control Access to Subagents and Actions in the Legacy Builder
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_asset_filters.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_asset_filters.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a558eae0a27ac0354a43395adf8e20d2711a56db4a8ad9f036619a7e1bc93bb0
description: Create filters for subagents and actions to make sure that your agent can use them in a conversation only when certain conditions are met. You can limit access based on any variable you specify. For agents on customer channels, we recommend using filters to require authentication for subagents and actions that perform tasks for a user.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Create a Filter to Control Access to Subagents and Actions in the Legacy Builder

Create filters for subagents and actions to make sure that your agent can use them in a conversation only when certain conditions are met. You can limit access based on any variable you specify. For agents on customer channels, we recommend using filters to require authentication for subagents and actions that perform tasks for a user.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions. <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;release=264.0.0&amp;type=5" title="Learn about agent types and default templates for specific clouds and common use cases.">Required add-on licenses vary by agent type.</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d140980e78">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d140980e78 ">To create and manage filters:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d140980e78 ">Manage AI Agents AND <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;type=5&amp;language=en_US" target="_blank">the required permissions for your agent
                type</a></td>

          </tr>
        </tbody>
      </table>

Before you begin, from the Context panel, add any variables that you want to use in filter conditions to your agent.

- [Messaging Context Variables](https://help.salesforce.com/s/articleView?id=service.agent_context_variables.htm&type=5&language=en_US)
- [Custom Variables](https://help.salesforce.com/s/articleView?id=ai.agent_variables_create.htm&release=264.0.0&type=5 "Control how an agent uses subagents and actions by mapping an action output to a custom variable. For example, when you assign a variable to an action input, your agent can use only the assigned variable to fill the value of the input.")

1. From the Agentforce Agents Setup page, launch your agent in Agentforce Builder.
2. If your agent is active, [deactivate it](https://help.salesforce.com/s/articleView?id=ai.copilot_setup_activate_deactivate.htm&release=264.0.0&type=5 "Activate your agent to make it available to your customers or employees. When an agent is deployed to one or more channels, including the Agentforce panel, activating the agent makes it immediately available to your users.").
3. From the sidebar, select **Context**.
4. From the Context panel, select the **Filters** tab, and then click **New**.
5. Enter a name, API name, and description for your filter.
6. Specify whether any condition or all conditions must be met for an agent to use a subagent or action with this filter applied.
7. To create a condition, specify a variable, an operator, and a value.
    
    You can create multiple conditions. Context, conversation, and custom variables are supported.
8. Save your changes.
9. To use your filter, apply it to one or more subagents or actions.
    1. From the Subagents panel, click the name of the subagent that you want to modify.
    2. To add the filter to the subagent, on the subagent's details panel, click ![Filter icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/agent_filter_icon.png).
    3. To add the filter to an action in the subagent, select the **This Subagent's Actions** tab, and then click the name of the action that you want to modify. On the action’s details panel, click ![Filter icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/agent_filter_icon.png).
    4. Search for and select the filter that you want to apply, and then save your changes. Your filter is applied to the subagent or action in this agent only.

To test your filter, restart the preview conversation to apply your changes.

To view the filters applied to a subagent or action, or to add or remove a filter, from the Subagents panel, open the details panel for that asset.

To edit or delete a filter, from the Context panel, select the **Filters** tab, and then open the filter that you want to modify. You can also view all of the assets that are currently using the filter.

#### See Also

- [_Video_: Control Agentforce Decision-Making with Variables and Filters](https://youtu.be/sOnECEt7iWs)