Python Code Execution Tool in Snowflake Cortex Agents
Cortex Agents now feature a native tool to execute Python code in an isolated environment, allowing agents to process data and generate charts during chats.
O que mudou
The code execution tool enables agents to safely run Python scripts to perform calculations, process data, and create visualizations during an interaction. The environment runs in an isolated sandbox with access only to the current session data and a mounted workspace stage.
Use cases
Imagine you need an agent to process complex data and generate a chart based on query results.
- Run Python scripts on-demand during a chat conversation.
- Process data and perform mathematical or statistical calculations.
- Generate visualizations and charts using popular libraries.
How to use
Configure the tool in your agent specification by including the type and corresponding resources.
tools:
- tool_spec:
type: code_execution
name: code_execution
tool_resources:
code_execution:
permission_policy:
type: always_ask
What happens in this code:
- Defines the inclusion of the simple code execution tool (
code_execution) in the agent's tools list. - Configures the sandbox permission policy to
always_ask, requiring user approval before executing state-modifying tools.
Limitations and requirements
- Stage: General Availability (GA).
- The execution environment uses Python 3.12 with common pre-installed libraries such as numpy, pandas, scipy, pyarrow, matplotlib, and plotly.
- Calls to agents using owner's rights do not support code execution; use caller's rights instead.
- The sandbox is scoped to a single conversation thread, and in-memory state does not persist between separate executions.
- cortex agents
- python
- sandbox
- ai
October 5, 2026: Cortex Agent code execution tool (General availability)
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- SnowflakeGA
Geração de documentos em PDF, Word e PowerPoint no Snowflake CoWork
O Snowflake CoWork agora gera arquivos PDF, Word, PowerPoint e HTML diretamente de suas análises usando a ferramenta de execução de código do Cortex Agent.
snowflake cowork · cortex agent - SnowflakePublic Preview
Cortex Agent SDK para Python e TypeScript no Snowflake
O Cortex Agent SDK permite criar aplicações que utilizam Cortex Agents e Cortex Code em Python e TypeScript.
cortex agents · python - SnowflakeAtualização
Mensagens de erro mais detalhadas na classificação de dados sensíveis
A view DATA_CLASSIFICATION_LATEST agora traz mensagens de erro específicas e códigos do Snowflake para falhas na classificação.
data governance · trust center