WriteMyAIPromptFree, no sign-up

AI prompt for writing a system prompt for a chatbot

This is a ready-made AI prompt for writing a system prompt for a chatbot, written for Claude and free to copy. System prompts fail two ways: rules stated as preferences get overridden by a persistent user, and no fallback means the bot invents an answer when it does not know. Both surface only in production. The prompt below handles that: it is compiled as a agentic / tool use task, so it carries the structure and the constraints that kind of work needs.

The prompt

Written for Claude. Compiled as a agentic / tool use task — instructions for a model that plans, calls tools, and acts over multiple steps.

<role>
You are an autonomous agent operating with the tools described below.
</role>

<context>
What it can access: {{knowledge}}. What it must never do: {{boundaries}}. Who talks to it: {{users}}.
</context>

<task>
Write a system prompt for a chatbot that {{purpose}}.
</task>

<constraints>
- State the identity, then the facts it knows, then how it answers, then hard boundaries, then the fallback.
- Every boundary must be stated as absolute behaviour, not as a preference.
- Include what it does when it does not know something.
- Assume the prompt will become public. Include no secrets.
- Use one tool at a time. Before each call, state in one line what you expect it to return and why you need it.
- Never fabricate a tool result. If a call fails, report the failure rather than continuing as though it succeeded.
- If a step fails twice, stop and report what you tried instead of retrying indefinitely.
- Do not take destructive or irreversible actions without stating what you are about to do first.
</constraints>

<approach>
Before answering: restate the problem in your own words, list what you know and what you are assuming, consider at least two approaches and say why you chose the one you did, then answer. If you spot a mistake part-way through, correct it explicitly instead of quietly starting over.
</approach>

<output_format>
Respond in Markdown. Use descriptive headings, and keep paragraphs to three sentences or fewer.
</output_format>

<success_criteria>
Before you finish, check the output against every item below and fix anything that fails.

- Every likely user request is either handled or explicitly refused.
</success_criteria>

Now, write a system prompt for a chatbot that {{purpose}}.

Open this in the prompt builder to add your own context and see what would improve it most.

What makes writing a system prompt for a chatbot hard to prompt for

System prompts fail two ways: rules stated as preferences get overridden by a persistent user, and no fallback means the bot invents an answer when it does not know. Both surface only in production.

Why this prompt works

Background comes before the instruction
The model reads the situation before it learns what to do with it, which stops the instruction being diluted by everything that follows. The task is then restated as the final line, where models weight it most heavily.
Rules a agentic / tool use task assumes but nobody writes down
Use one tool at a time. Before each call, state in one line what you expect it to return and why you need it. Never fabricate a tool result. If a call fails, report the failure rather than continuing as though it succeeded. These are added automatically because leaving them implicit is the most common reason this kind of output disappoints.
Success criteria the model checks itself against
Stating how the output will be judged gives the model something concrete to verify before it finishes. Prompts without criteria produce work that is plausible but incomplete, because nothing defined when it was done.

What to replace

PlaceholderWhat to put there
{{knowledge}}Your knowledge.
{{boundaries}}Your boundaries.
{{users}}Your users.
{{purpose}}Your purpose.

Check the output before you use it

  • Try to talk it past each boundary. Rules phrased as preferences will not hold.
  • Confirm there is a defined behaviour for "I do not know".
  • Read it assuming a user has extracted it — is anything in there you would not publish?

The same prompt for other models

Identical content, packaged the way each model reads most reliably.

ChatGPT

## Role

You are an autonomous agent operating with the tools described below.

## Context

What it can access: {{knowledge}}. What it must never do: {{boundaries}}. Who talks to it: {{users}}.

## Task

Write a system prompt for a chatbot that {{purpose}}.

## Constraints

- State the identity, then the facts it knows, then how it answers, then hard boundaries, then the fallback.
- Every boundary must be stated as absolute behaviour, not as a preference.
- Include what it does when it does not know something.
- Assume the prompt will become public. Include no secrets.
- Use one tool at a time. Before each call, state in one line what you expect it to return and why you need it.
- Never fabricate a tool result. If a call fails, report the failure rather than continuing as though it succeeded.
- If a step fails twice, stop and report what you tried instead of retrying indefinitely.
- Do not take destructive or irreversible actions without stating what you are about to do first.

## Approach

Before answering: restate the problem in your own words, list what you know and what you are assuming, consider at least two approaches and say why you chose the one you did, then answer. If you spot a mistake part-way through, correct it explicitly instead of quietly starting over.

## Output format

Respond in Markdown. Use descriptive headings, and keep paragraphs to three sentences or fewer.

## Success criteria

Before you finish, check the output against every item below and fix anything that fails.

- Every likely user request is either handled or explicitly refused.

Now, write a system prompt for a chatbot that {{purpose}}.

Gemini

**Task**

Write a system prompt for a chatbot that {{purpose}}.

**Role**

You are an autonomous agent operating with the tools described below.

**Context**

What it can access: {{knowledge}}. What it must never do: {{boundaries}}. Who talks to it: {{users}}.

**Constraints**

- State the identity, then the facts it knows, then how it answers, then hard boundaries, then the fallback.
- Every boundary must be stated as absolute behaviour, not as a preference.
- Include what it does when it does not know something.
- Assume the prompt will become public. Include no secrets.
- Use one tool at a time. Before each call, state in one line what you expect it to return and why you need it.
- Never fabricate a tool result. If a call fails, report the failure rather than continuing as though it succeeded.
- If a step fails twice, stop and report what you tried instead of retrying indefinitely.
- Do not take destructive or irreversible actions without stating what you are about to do first.

**Approach**

Before answering: restate the problem in your own words, list what you know and what you are assuming, consider at least two approaches and say why you chose the one you did, then answer. If you spot a mistake part-way through, correct it explicitly instead of quietly starting over.

**Output format**

Respond in Markdown. Use descriptive headings, and keep paragraphs to three sentences or fewer.

**Success criteria**

Before you finish, check the output against every item below and fix anything that fails.

- Every likely user request is either handled or explicitly refused.

Now, write a system prompt for a chatbot that {{purpose}}.

Common questions

Can users see my chatbot system prompt?
Assume yes. Extraction attempts succeed often enough that instructions not to reveal it are unreliable. Anything genuinely secret — keys, internal URLs, unpublished policy — must not be in the prompt at all.
How long should a chatbot system prompt be?
Long enough that every behaviour you care about is covered, and no longer. Twelve well-chosen rules are followed more reliably than forty, because forty inevitably contain contradictions the model has to resolve on its own.
Which AI model is best for writing a system prompt for a chatbot?
All of them handle this; what changes is the packaging. This page shows the same prompt written for Claude, ChatGPT, Gemini. Claude follows XML-delimited structure most reliably, ChatGPT works best with markdown headings, and Gemini prefers the task stated before the material. The content of the prompt is identical in each.
Can I change this prompt for my own situation?
Yes, and you should. Replace the placeholders with your own details, then open it in the builder to add context specific to you. The builder scores what you supply and tells you exactly which missing piece would improve it most.
Why does this prompt include rules I did not ask for?
Because agentic / tool use tasks carry requirements that experienced practitioners apply automatically and rarely write down. The compiler adds them so the output does not fail on something obvious. Every added rule is listed on the how it works page.

Browse all ready-made prompts, the full prompt library, or read the guides.