Skip to content
Lucas Lessa
Voltar para as notícias
SnowflakeAtualizaçãoImpacto: Médio

Code execution tools for Cortex Agents in Snowflake Native Apps

Snowflake Native App providers can now add Python and SQL sandbox execution tools to Cortex Agents.

O que mudou

This feature allows providers to add Python and SQL sandbox execution tools to Cortex Agents created inside a Snowflake Native App.

Use cases

Imagine you developed an app that needs to analyze data using custom Python scripts or run read-only queries on consumer data securely.

  • Execute Python code for calculations, transformations, and plotting.
  • Use the complete coding toolset (code_toolset_all), including bash, file manipulation, and read-only SQL queries.
  • Perform advanced analysis while keeping strict caller's rights restrictions.

How to use

Configure sandbox tools in the agent specification within your application setup script.

CREATE OR REPLACE AGENT core.my_agent
  FROM SPECIFICATION $$
models:
  orchestration: auto
tools:
  - tool_spec:
      type: "code_execution"
$$;

What happens in this code:

  1. The command creates or replaces an agent named core.my_agent within the application.
  2. The specification sets the orchestration model to automatic.
  3. The Python sandbox tool (code_execution) is integrated into the agent without direct SQL execution privileges.

Limitations and requirements

  • The sandbox does not run with the app owner's rights; restricted caller's rights (RCR) apply.
  • The snowflake_sql_execute tool supports only SELECT and SHOW statements.
  • Invoking the agent from an owner's-rights procedure removes the sandbox tools.
  • Consumers must explicitly grant caller access to workspace objects and data using GRANT CALLER commands.
Ver nota oficial do Snowflake

Snowflake Native Apps: Code execution tools for Cortex Agents

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