

# Removing AWS Ops Agent for networking

Removing the Networking specialist stops its use and deletes the network scope. You can add the Networking specialist again later. If you add it again to the same Agent Space and the network scope still exists, AWS Ops Agent for networking reuses that scope.

To remove the Networking specialist, you need the `aidevops:DisassociateService` and `networkmanager:DeleteNetworkScope` permissions.

## Remove the Networking specialist (console)
<a name="ops-agent-networking-removing-console"></a>

**To remove the Networking specialist (console)**

1. Open the AWS Ops Agent console and open your Agent Space.

1. Choose the **Capabilities** tab.

1. Under **Specialists**, select the **Networking specialist**.

1. Choose **Remove**.

1. In the **Remove specialist?** dialog box, choose **Remove**.

If the removal fails, the console shows the reason. For more information, see [Troubleshooting AWS Ops Agent for networking](ops-agent-networking-troubleshooting.md).

## Remove the Networking specialist (AWS CLI)
<a name="ops-agent-networking-removing-cli"></a>

Run the following command.

```bash
aws devops-agent disassociate-service --agent-space-id <agent-space-id> --association-id <association-id>
```

By default, the removal fails if resources can't be removed. Use `--orphaned-resource-handling allow-orphan` only if you accept leaving resources behind.

## Changing the Regions
<a name="ops-agent-networking-removing-regions"></a>

To change the Regions that AWS Ops Agent for networking analyzes, remove the Networking specialist, and then add it again with the new Regions. To add the Networking specialist, see [Getting started with AWS Ops Agent for networking](ops-agent-networking-getting-started.md).

## Delete the Agent Space and roles (organization mode)
<a name="ops-agent-networking-removing-delete-agent-space"></a>

1. Disassociate the organizational unit (OU) and monitor associations.

1. Run `delete-agent-space`. The StackSet and the member-account roles are removed in the background within minutes.

1. Detach `AIDevOpsAgentAccessPolicy` and `AIDevOpsOrganizationsAccessPolicy`, and delete `DevOpsAgentMonitorRole`.

## Turn off trusted access
<a name="ops-agent-networking-removing-trusted-access"></a>

To turn off trusted access, sign in with the management account, open **Agent spaces settings**, select the services, and choose **Disable**. Turn off network security analysis before AWS Network Manager. You can't turn off AWS Network Manager while network security analysis policies remain.