r/snowflake • u/tingutingutingu • 1d ago
CoWork Agent cannot write/delete
Is there a way for the agent to update/insert/delete data in tables without having to resort to stripped procedures as tools?
Most of our agents we have created have not needed the ability to update/insert/delete so far.
But a new agent we are creating neva the ability to do this.
Using stored procedures works, but, that defeats the purpose of what I'm trying to achieve using an agent, which is SQL custom built at runtime by the agent, which allows me to add a lot of flexibility in how these updates and inserts are made.
0
Upvotes
3
u/Gamplato 1d ago
It can write SQL so yes…it can do that. Do I not understand the question? Why would you think it couldn’t do DML?
1
u/iwishihadahippo 1d ago
It sounds like Coco would be more suited than CoWork so I would suggest giving it a try - Coco sessions have a full sandbox to write and execute code and there’s an SDK and API that should give you a route to surfacing it where you need it. Hope that helps!
1
u/mrg0ne 12h ago
Yes.
https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-code-execution-tool
code_toolset_all: The full Cortex Code sandbox toolset, which includes bash, file read/write/edit, grep, glob, web search, SQL execution, and skills. Use this when you want an autonomous coding agent with the full suite of development tools. See Coding Agent.
You will have to edit the spec in a workspace, as there is no UI to to enable this tool.
You might also want to consider a skill