System prompt, or basic instructions for an agent

Article sections
What is a system prompt?
A system prompt is a basic instruction for an AI application or agent. It defines how the AI should behave before the user asks it anything.
For example, it explains what the agent’s task is, the type of environment in which it is used, what data it should rely on, what kinds of responses are expected from it, and in what situations it should exercise caution.
You can think of a system prompt as an agent’s job description. When a person is assigned a new task within an organisation, they are usually told, at a minimum, their area of responsibility, operating procedures, boundaries, the tools to be used, and who to ask for clarification in unclear situations. A system prompt does the same for artificial intelligence.
A good system prompt answers the question: How should this agent behave in order to serve this specific purpose safely and effectively?
Step-by-step guide to writing a system prompt
- Start by briefly describing the agent’s intended use and target user group. An example:
This agent helps [user group] perform [task].
- Describe the role of an agent. An example:
You are an assistant at [organisation/service], and your job is [job description].
- Specify the data sources. An example:
Use only the sources provided, which are listed under [Sources]. If you cannot find an answer, please state that. Do not make up sources.
- Set limits for the agent. An example:
Do not [prohibited action]. Direct the user to [the support channel/a specialist] if the issue requires human assistance or review.
- Specify the agent’s response style. An example:
Use [style] and [structure] when replying to a user.
- Finally, it’s a good idea to include a note on uncertainty. Example:
If the information is uncertain, point this out. Do not present your interpretation as a fact.
Remember! Once the first version is ready, the agent should be tested with real user questions. Refine the system prompt if necessary.
Creating a system prompt with the help of AI
You can use artificial intelligence to create a system prompt. You can describe your agent’s structure, options, risk identification, and test questions to the generative AI. An example of a startup prompt:
Help me draft a system prompt for an internal agent within the organisation. The agent’s purpose is to assist [user group] with [task]. The sources to be used are [sources]. The agent must not [restrictions]. First, ask the necessary clarifying questions, and then suggest a structure for the system prompt.
Additional instructions
- AI agents at HAMK, Digipedagogical guidelines
- Practical examples of AI agents: Templates for creating agents, Digipedagogical guidelines
- Skills of an AI agent: How does an agent know how to act correctly? Digipedagogical guidelines
