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

# ALTER AGENT Statement in Confluent Cloud for Apache Flink

Modify an existing agent’s configuration. Use the [CREATE AGENT](create-agent.md#flink-sql-create-agent) statement to create an agent.

## Syntax

```sql
ALTER AGENT [IF EXISTS] [[catalog_name.]database_name.]<agent_name>
SET MODEL <model_identifier>
| SET PROMPT <prompt_string>
| ADD|REMOVE TOOL <tool_identifier>
| SET (<key1>=<val1>[,<key>=<val>]*);
```

## Description

The ALTER AGENT statement enables you to modify the configuration of an
existing Streaming Agent. You can update agent properties, like
`max_iterations`, `description`, `tools`, and other configuration
options.

## Parameters

- **agent_name** (STRING): Name of the agent to modify
- **key1=value1** (STRING): Agent configuration options to update

## Available Configuration Options

- **max_iterations**: Maximum loop iterations (INTEGER)
- **description**: Human-readable description (STRING)

## Examples

Modify an agent’s configuration:

```sql
ALTER AGENT claim_processor SET (
  'max_iterations' = '10',
  'description' = 'Updated claims processing agent'
);
```

Add or remove a tool:

```sql
-- Add a tool
ALTER AGENT <name> ADD TOOL <tool>;

-- Remove a tool
ALTER AGENT <name> REMOVE TOOL <tool>;
```

Assign the model:

```sql
-- Set the model
ALTER AGENT <name> SET MODEL <model>
```

Assign the prompt:

```sql
-- Set the prompt
ALTER AGENT <agent> SET PROMPT <prompt>
```

Update multiple agent properties:

```sql
ALTER AGENT data_analyzer SET (
  'max_iterations' = '15',
  'description' = 'Enhanced data analysis agent',
  'tools' = 'advanced_analytics_mcp'
);
```

## Related content

- [CREATE AGENT Statement](create-agent.md#flink-sql-create-agent)
- [DROP AGENT Statement](drop-agent.md#flink-sql-drop-agent)

#### 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).
