System prompts¶
System prompts let you constrain agent behavior, add domain-specific context, or set the tone and style of responses.
By default, the SDK uses a built-in system prompt that provides the agent with its core capabilities, including file editing, code search, and shell access. You can either replace this prompt entirely or append additional instructions to it.
Replace the default prompt¶
Pass a string to the systemPrompt option to fully replace the built-in system prompt. Use this when you
need complete control over the agent’s behavior and don’t want any of the default instructions.
Warning
Replacing the default prompt removes all built-in instructions, including tool usage guidance and safety guardrails. Only replace the prompt when you need full control over agent behavior.
Append to the default prompt¶
To keep the built-in capabilities while adding your own instructions, use a system prompt preset object with the
append field. The preset name is implicit, so you only need {"type": "preset", "append": ...}.
This adds your instructions after the default system prompt.
Both SDKs also provide an append-only shorthand:
Common patterns¶
Review-focused code reviewer¶
Bias the agent toward analysis-first code review behavior:
Domain-specific expert¶
Focus the agent on a particular technology or domain:
Style enforcer¶
Ensure the agent follows specific coding standards:
Best practices¶
When to append vs. replace¶
Append to the default prompt |
Replace the default prompt |
|---|---|
You want to add domain context or constraints |
You need full control over agent behavior |
You want to keep built-in tool usage guidance |
You are building a highly specialized agent |
You want to maintain safety guardrails |
The default instructions conflict with your use case |
Legal notices¶
Where your configuration of Cortex Code uses a model provided on the Model and Service Pass-Through Terms, your use of that model is further subject to the terms for that model on that page.
The data classification of inputs and outputs are as set forth in the following table.
Input data classification |
Output data classification |
Designation |
|---|---|---|
Usage Data |
Customer Data |
Covered AI Features [1] |
For additional information, refer to Snowflake AI and ML.