How to Add Custom Instructions to an AI Chatbot in Google AI Studio?

Custom instructions in Google AI Studio help you control how an AI chatbot responds to your prompts. By adding clear instructions, you can define the chatbot’s role, tone, response style, formatting preferences, and the type of information it should provide
authorImageKishor Kumar Bairagi7 Oct, 2026
How to Add Custom Instructions to an AI Chatbot in Google AI Studio

An AI chatbot can answer questions, but a business chatbot needs to do more than hold a conversation. It should follow your brand tone, use your business information, follow specific policies and know when not to make up an answer.

This is where custom instructions come in. In Google AI Studio, you can define these instructions in the System Instructions field and connect them with files containing your business information.

In this tutorial, we will learn to build a simple e-commerce customer support chatbot that can answer product and policy questions using custom instructions and an uploaded document.

Step 1: Open Google AI Studio

Open Google AI Studio and sign in using your Google account.

Once inside, you will see options for working with models, applications and other AI development features.

For this tutorial, go to the model interface and select the chat option.

You will then see the model configuration panel, including the System Instructions field.

System Instructions are the most important part of this tutorial. They tell the model how your chatbot should behave throughout the conversation.

Step 2: Choose a Model

Google AI Studio provides different models that you can select according to your use case.

For this tutorial, select the model you want to use for the chatbot. The exact model names available in AI Studio can change as Google updates its model lineup, so focus on the configuration rather than a specific model version.

Once the model is selected, move to the System Instructions box.

Step 3: Write the Chatbot's Custom Instructions

This is where you define the chatbot's role and behaviour.

Think of the System Instructions as a briefing document for the AI.

For our electronics store chatbot, you could write:

You are Alex, the official AI customer and sales assistant for Tech Gear Electronics. Your tone must be extremely polite, helpful and concise. Rule 1: Always check the uploaded store FAQ document before answering a customer question. Rule 2: If a customer asks for a discount, provide the approved promotional code: TECH10. Rule 3: If a customer asks about the return policy, provide the approved 14-day return policy. Rule 4: Do not invent product information, prices, policies or promotional offers.

The more clearly you define these elements, the easier it is to test whether the chatbot is behaving as intended.

Want to understand what sits behind tools like AI Studio? Explore PW Medharthi’s Certification Program in AI/ML.

Step 4: Upload Your Business Information

The instructions tell the chatbot how to behave. They do not contain all the information about your business.

For that, upload a relevant document.

Click the + icon and select Upload Files.

For our e-commerce chatbot, you could upload a PDF containing:

  • Product details

  • Product prices

  • Frequently asked questions

  • Return and refund policies

  • Warranty information

  • Shipping information

For example, if your FAQ says that damaged products can be returned within 14 days, the chatbot can use that information when a customer asks about a damaged order.

This gives you an important distinction:

System Instructions = behaviour
Uploaded files = business knowledge

Both work together to create a more useful custom chatbot.

Step 5: Run the Chatbot

Once your instructions and files are ready, run the model.

You now have a basic chatbot that has been given:

A role + instructions + business information

But do not assume it works correctly just because it generated an answer.

The next step is testing.

Step 6: Test It With a Real Customer Query

Start with a realistic situation.

For example: “I bought a laptop yesterday, but I received a damaged package. Can I return it?”

The chatbot should refer to the uploaded policy information and answer according to the instructions you provided.

You can then check:

  • Did it use the uploaded document?

  • Did it follow the return policy?

  • Was the tone polite?

  • Did it avoid adding information that was not provided?

This is more useful than testing only simple questions because it checks whether the instructions and knowledge source are working together.

Step 7: Test Whether the Instructions Actually Work

Now give the chatbot a question that directly tests one of your rules.

For example: “Can you give me a discount coupon for my next purchase?”

If your system instruction says to provide the approved TECH10 code, the chatbot should return that code.

This is an important part of chatbot development.

You are not simply checking whether the AI can answer questions. You are checking whether it follows the behaviour you designed.

Step 8: Test What Happens When It Does Not Know Something

This test is often overlooked.

Ask something that is not present in your uploaded information.

For example: “When will your next gaming laptop launch?”

If the information is not available, the chatbot should not invent a launch date.

That is why a boundary such as this is useful:

If the required information is unavailable, do not make up an answer.

A custom chatbot is not reliable simply because it answers confidently. You also need to test how it handles information it does not have.

How Custom Instructions Change the Chatbot?

Without custom instructions, you are essentially asking a general-purpose model to answer your questions.

With custom instructions, you are defining a specific behaviour.

The chatbot can use the store's specific return policy and respond according to the rules you defined.

That is the real purpose of custom instructions: not to make the AI smarter, but to make its behaviour more relevant to your use case.

Want to explore AI applications further? Learn AI-Driven Marketing and Digital Growth with PW Medharthi.

Step 9: Get the Code for Deployment

Once you have tested the chatbot, you may want to use it outside Google AI Studio.

Google AI Studio provides a Get Code option that can generate code for integrating the model into an application.

Depending on your development setup, you can work with the generated code in languages and formats supported by the platform.

If you are not a developer, you can give the generated code and your requirements to a web developer for integration.

However, remember that generating code is not the same as having a production-ready chatbot. A real deployment may also require security controls, API-key protection, error handling, monitoring and appropriate data handling.

A Simple Template for Your Own Custom Instructions

If you want to create another chatbot, you can use this structure:

ROLE:You are [role of the chatbot].
AUDIENCE: You help [target users].
GOAL: Your primary responsibility is [main purpose]. 
TONE: Use [desired communication style].
KNOWLEDGE: Use the uploaded documents for information about [topics].
RULES:
1. [Specific behaviour]
2. [Specific behaviour]
3. [Specific behaviour] 
BOUNDARIES: Do not [information/actions the chatbot should avoid].
WHEN INFORMATION IS UNAVAILABLE:
[Explain what the chatbot should say or do].

For example, an admissions chatbot could be instructed to answer questions about courses and eligibility using approved university documents, maintain a professional tone and direct students to the admissions team when information is unavailable.

Custom Instructions Are Only the Starting Point

The first version of your chatbot does not need to handle every possible situation.

Start with one clear use case.

For an e-commerce business, that could be customer support. For a college, it could be admissions queries. For an internal company chatbot, it could be HR policies.

Once the basic chatbot works, you can gradually introduce more capabilities and integrations.

The important sequence is:

Define the job → Write the instructions → Add trusted information → Test real queries → Refine the behaviour → Deploy

That approach helps you understand what your chatbot is actually doing instead of treating the AI model as a black box.

If building this chatbot has made you think about where AI could fit into your own career, the AI Career Roadmap Generator can help map a learning path around your target role, skills and courses.

 

Popup Close ImagePopup Open Image
Talk to a counsellorHave doubts? Our support team will be happy to assist you!
Popup Image
avatar

Get Free Counselling Today

and Clear up all your Doubts

Talk to Our Counsellor just by filling out the form.
Student Name
Phone Number
IN
+91
OTP
medharthi logo

PW Medharthi is dedicated to transforming the education landscape in India. Founded on the belief that quality affordable learning should be accessible to all, we leverage technology to provide a unique learning experiences.

Let's get social

FacebookInstagramLinkedinTwitter

Connect with us on

+91 8130166658

Connect with us on

+91 8130166658