<a id="flink-sql-drop-agent"></a>

# DROP AGENT Statement in Confluent Cloud for Apache Flink

Remove an agent from the environment.

## Syntax

```sql
DROP AGENT [IF EXISTS] agent_name
```

## Description

The DROP AGENT statement removes a Streaming Agent from the current environment.
After it is dropped, the agent cannot be used in queries and all its
configuration is permanently deleted.

## Parameters

- **IF EXISTS** (Optional): Prevents error if agent doesn’t exist
- **agent_name** (STRING): Name of the agent to remove

## Examples

Remove an agent:

```sql
DROP AGENT old_agent;
```

Remove an agent safely (no error if it doesn’t exist):

```sql
DROP AGENT IF EXISTS old_agent;
```

## Related content

- [ALTER AGENT Statement](alter-agent.md#flink-sql-alter-agent)
- [CREATE AGENT Statement](create-agent.md#flink-sql-create-agent)
- [SHOW AGENTS Statement](show.md#flink-sql-show-agents)

#### NOTE
This website includes content developed at the [Apache Software Foundation](https://www.apache.org/)
under the terms of the [Apache License v2](https://www.apache.org/licenses/LICENSE-2.0.html).
