Gemini calls the system prompt "system instructions" — same concept, different name. If you've been hunting for "Gemini system prompt" and finding nothing useful, that's why. This guide covers exactly how to set system instructions in the Gemini API, in Google AI Studio, and in Vertex AI, with copy-paste examples and a free generator that produces Gemini-ready instructions in two minutes.
Generate a Gemini-ready system instruction in 2 minutes.
Open System Prompt Generator →In the generateContent API, system instructions go in the system_instruction parameter, separate from the messages array:
{
"system_instruction": {
"parts": [
{"text": "You are a helpful coding assistant. Always explain your reasoning in code comments. Never use deprecated APIs."}
]
},
"contents": [
{"role": "user", "parts": [{"text": "Write a Python function to parse JSON."}]}
]
}
The structure is similar to Anthropic's Claude API: a top-level system field, separate from the conversation messages. This separation lets the model treat the system instruction with stronger weight than user-turn content.
Google AI Studio is the fastest way to test Gemini without writing code:
This is the easiest place to iterate. Edit the system instruction, re-run the same user message, see the difference. No API key, no code, no deployment cycle.
For enterprise apps, Vertex AI is the production endpoint. The system instructions parameter works the same way:
from vertexai.generative_models import GenerativeModel
model = GenerativeModel(
model_name="gemini-2.5-pro",
system_instruction="You are a senior data analyst. Always validate the data type before computing statistics. Always cite the column you're analyzing."
)
response = model.generate_content("Compute the average of the price column.")
print(response.text)
Vertex AI also supports prompt grounding (attaching documents that the model can cite), function calling, and structured outputs — all of which interact with the system instruction.
Gemini accepts plain prose, but a numbered or bulleted structure works better than dense paragraphs. Suggested template:
You are [ROLE]. Your primary goal is [GOAL]. Capabilities: 1. [Capability 1] 2. [Capability 2] 3. [Capability 3] Rules: - [Rule 1] - [Rule 2] - [Rule 3] Output format: - [Format requirement 1] - [Format requirement 2] If you don't know the answer, say "I don't have enough information for that" rather than guessing.
The free system prompt generator produces output in this exact structure when you pick a use case and toggle rules.
| Use case | System instruction length | Notes |
|---|---|---|
| Personal assistant | 100-300 tokens | Identity + 3-5 rules |
| Customer chatbot | 300-800 tokens | Identity + capabilities + 8-12 rules + output format |
| Coding assistant | 400-1000 tokens | Add code style preferences and stack details |
| Domain expert | 800-2000 tokens | Add domain knowledge, terminology, and few-shot examples |
| Complex agent | 2000-5000 tokens | Add tool descriptions, planning rules, and handoff logic |
Gemini's 1M and 2M token context windows mean you have room to be thorough. Don't compress aggressively if it costs clarity. The system instructions count against your input token budget on every request unless you use context caching.
Generate Gemini-ready system instructions now.
Open System Prompt Generator →