SnowPro Specialty: Gen AI free question 2 / 10 · Domain 1: Snowflake for Gen AI Overview
A CI job runs CoCo CLI in batch mode with cortex -p and passes "/sql SELECT COUNT() FROM orders" as the prompt, expecting the /sql command to run the query. What does the CLI reference say about this?
- It runs after it is pre-approved with --allowed-tools.
- It does not work, because batch mode has no prompt.
- It runs once plan mode approves it in the terminal.
- It runs when --output-format stream-json is also set.
Show the answer and explanation
Answer: B
Why this is correct
Under "Batch mode", the reference says batch mode runs a single prompt without starting an interactive session: CoCo processes the request, prints the result, and exits. It then says slash commands don't work in batch mode because there's no interactive prompt. Slash commands such as /sql are typed at the interactive prompt and control CoCo's behaviour without being sent to the model, so a batch job has to state the request in natural language or run the SQL another way.
Why the other options are wrong
"It runs once plan mode approves it in the terminal." … Batch mode prints a result and exits without a conversation, and exec runs with plan mode disabled. There is no terminal step in which plan mode could approve the command.
"It runs after it is pre-approved with --allowed-tools." … The --allowed-tools option pre-approves tool calls that would otherwise need approval. Slash commands are not tool calls the model makes; they are typed at the interactive prompt.
"It runs when --output-format stream-json is also set." … stream-json changes how the output is written, so a script can parse it. It does not change which kinds of input batch mode accepts.
Batch mode in pipelines
Use -p for an inline prompt, or cortex exec with --file for a prompt in a file or on standard input. Tool calls that need approval are denied in batch mode unless they are pre-approved, because there is nobody at a prompt to approve them.
Go to the SnowPro Specialty: Gen AI practice app (10 free questions; purchase unlocks all questions)