ALTER AGENT

statementsupportedAI & ML

docs.snowflake.com ↗

Object: AGENT

Modifies the properties or specification for an existing Cortex Agent.

Syntax

supportedpartialnot supportednot scored

ALTER AGENT <name> SET
  [ COMMENT = '<string>' ]
  [ PROFILE = '<string>' ]
  [ SECURE = { TRUE | FALSE } ]

ALTER AGENT <name> MODIFY LIVE VERSION SET SPECIFICATION = <specification>

ALTER AGENT <name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]

ALTER AGENT <name> UNSET TAG <tag_name> [ , <tag_name> ... ]

Parameters

NameRequiredDescription
namerequiredString that specifies the identifier (i.e. name) for the agent to alter. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements.
SET ...optionalSets one or more specified properties or parameters for the agent:
COMMENT = commentSpecifies the description of the agent.
PROFILE = stringSpecifies the agent profile information, such as display name, avatar, and color. Format the string as follows:Copy code '{"display_name": "<display_name>", "avatar": "<avatar>", "color": "<color>"}' The following table describes the key-value pairs in the string: Key Type Description display_name String Display name for the agent. avatar String Avatar image file name or identifier. color String Color theme for the agent (such as “blue”, “green”, “red”)ExpandShow lessSee more
SECURE = { TRUE | FALSE }Sets whether the agent is secure: TRUE marks the agent as secure. The complete specification is visible only when the owner role is activated. FALSE removes the secure designation. If sharing controls require an agent in a share or Native App export to remain secure, Snowflake returns error 093932 (SHARED_AGENT_CANT_BE_UNSECURE). Revoke the agent’s grants to shares and application roles before setting this property to FALSE. For more information, see Secure agents.
MODIFY LIVE VERSION SET SPECIFICATION specificationoptionalSpecifies the VARCHAR value containing the replacement settings for an agent as either a YAML or JSON object: Dollar-quoted literal: $$ … $$ Single-quoted string: ‘…’ The maximum length of the specification object is 100,000 bytes. Important The new specification completely replaces the existing one. Fields that are not included in the new specification are removed. The YAML object should have the following structure:Copy code models: orchestration: <model_name> orchestration: capabilities: analytical_search: true tool_not_accessible: <accept | reject | legacy> budget: seconds: <number_of_seconds> tokens: <number_of_tokens> instructions: response: '<response_instructions>' orchestration: '<orchestration_instructions>' sample_questions: - question: '<sample_question>' ... tools: - tool_spec: type: '<tool_type>' name: '<tool_name>' description: '<tool_description>' input_schema: type: 'object' properties: <property_name>: type: '<property_type>' description: '<property_description>' required: <required_property_names> ... tool_resources: <tool_name>: <resource_key>: '<resource_value>' ... ... The JSON object should have the following structure:Copy code { "models": { "orchestration": "<model_name>" }, "orchestration": { "capabilities": { "analytical_search": true }, "tool_not_accessible": "<accept | reject | legacy>", "budget": { "seconds": <number_of_seconds>, "tokens": <number_of_tokens> } }, "instructions": { "response": "<response_instructions>", "orchestration": "<orchestration_instructions>", "sample_questions": [ { "question": "<sample_question>" } ] }, "tools": [ { "tool_spec": { "type": "<tool_type>", "name": "<tool_name>", "description": "<tool_description>", "input_schema": { "type": "object", "properties": { "<property_name>": { "type": "<property_type>", "description": "<property_description>" } }, "required": ["<required_property_names>"] } } } ], "tool_resources": { "<tool_name>": { "<resource_key>": "<resource_value>" } } } The following table describes the key-value pairs in this object: Key Type Description models ModelConfig An optional model configuration for the agent. Includes the orchestration model (e.g., claude-4-sonnet). If not provided, a model is automatically selected. Currently only available for the orchestration step. orchestration OrchestrationConfig An optional orchestration configuration, including budget constraints (seconds, tokens), capabilities such as analytical_search, and tool_not_accessible (accept, reject, or legacy). If tool_not_accessible is omitted, the default is accept. For details, see Inaccessible tool handling. instructions AgentInstructions Optional instructions for the agent’s behavior, including response, orchestration, and sample questions. tools array of Tool An optional list of tools available for the agent to use. Each tool includes a tool_spec with type, name, description, and input schema. Tools may have a corresponding configuration in tool_resources. tool_resources map of ToolResource An optional configuration for each tool referenced in the tools array. Keys must match the name of the respective tool.ExpandShow lessSee more
SET TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' ... ]optional
TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]Specifies the tag name and the tag string value. The tag value is always a string, and the maximum number of characters for the tag value is 256. For information about specifying tags in a statement, see Tag quotas.
UNSET TAG tag_name [ , tag_name ... ]optionalSpecifies one or more tags to unset on the agent: tag_name [ , tag_name ... ] To unset multiple properties or parameters with a single ALTER statement, separate each property or parameter with a comma. When unsetting a property or parameter, specify only the property or parameter name (unless the syntax above indicates that you should specify the value). Specifying the value returns an error.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP or MODIFY | Agent | Required to modify the agent properties or specification. OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege). Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by