Sub topic 4
Configuration and System Settings
This chapter covers the part of an Agent Script file that sets agent-wide behaviour before any topic runs. It assumes you can read indentation-based configuration such as YAML. It also assumes you know what a prompt, a tool call and a conversation turn are. You should have read the previous chapter on the overall anatomy of a script.
The examples here are illustrative sketches. Agent Script is still evolving, so check exact key names against the current Agent Script documentation before you rely on them.
What the configuration blocks are for
A topic describes one job the agent can do. Some settings apply to the whole agent, whatever topic is active. Examples include who the agent is, how it speaks, what it says when it starts, and what it says when something goes wrong. These settings sit at the top of the script, in the configuration and system blocks.
Think of them as the defaults for every conversation. A topic can add to them with its own instructions. A topic does not need to repeat them.
The spine for this tutorial gives this sketch of a script's shape:
# Illustrative sketch of the overall shape of an Agent Script file.
# Check exact keys against the current Agent Script documentation.
system:
instructions: "You are a support agent for order questions."
variables:
order_id: mutable string = ""
start_agent topic_selector:
description: "Route the customer to the right topic"
topic order_status:
description: "Answer questions about an existing order"This chapter looks at the first block, system. It also covers the identity and deployment settings that usually sit beside it.
Two kinds of top-level settings
Top-level settings fall into two groups. Keeping them apart makes a script easier to review.
| Group | Question it answers | Examples |
|---|---|---|
| Configuration | Which agent is this, and how is it deployed? | Agent name, description, the type of agent, the user it runs as |
| System | How should the agent behave and sound in every topic? | Base instructions, welcome message, error message |
Configuration is about identity and wiring. System settings are about behaviour. Neither group contains step-by-step logic. Logic belongs in topics.
Configuration
Configuration identifies the agent. It typically holds a name and a human-readable description, and it may hold deployment details such as the type of agent or the account it acts as. These values are fixed when you publish the agent. The model does not read them as conversation instructions, and they do not change during a conversation.
Treat configuration as metadata. Keep it short, and change it only when the agent's identity or deployment changes.
System settings
System settings shape how the agent talks. In the sketch above, the system block holds one entry, instructions. These are base instructions that apply on every turn, in every topic.
Two other system settings are common in agent definitions:
- A welcome message, shown when a conversation begins.
- An error message, shown when the agent cannot continue, for example when an action fails in a way the script does not handle.
The welcome and error messages are fixed text. The model does not compose them on the spot. That makes them deterministic, which is useful because they are the first thing a customer sees and the last thing they see when something breaks.
Writing good system instructions
System instructions are prompt text. They are probabilistic in the way all prompt text is: the model reads them and usually follows them. The earlier chapters explained why that is not a guarantee. Use system instructions for things that are true in every topic and that you can tolerate the model getting slightly wrong.
Good candidates:
- The agent's role and audience.
- Tone, such as formal or friendly, and the language to reply in.
- General limits, such as "Do not discuss topics unrelated to orders."
Poor candidates:
- Anything that must happen in a fixed order.
- Anything that depends on the value of a variable.
- Any rule where a mistake has a real cost, such as issuing a refund.
Move those into topic logic, where an if statement decides what the model sees. A system instruction that says "Always ask for the order number first" is a request. A condition that checks whether order_id is empty is a rule. The remaining chapters show how to write that rule.
# Illustrative sketch: a short, stable system block.
system:
instructions: "You are a support agent for order questions. Reply in a friendly, concise tone. Do not discuss topics unrelated to orders."
messages:
welcome: "Hello. I can help with your order."
error: "Sorry, something went wrong. Please try again."In this sketch the messages entries are an assumption about how the welcome and error texts are named. Confirm the real keys in the documentation.
How system settings combine with topic instructions
On each turn the model receives more than the customer's message. The prompt is built from layers:
- The system instructions, which are the same on every turn.
- The instructions of the active topic, after any
iflogic has been resolved. - The conversation so far.
Because the system layer is always present, every word costs prompt space on every turn. A long system block also competes with topic instructions for the model's attention. Short system instructions leave more room for the topic text that matters.
The layers can conflict. If the system block says "Be brief" and a topic says "Explain each step in detail", the model has to choose, and you cannot predict which it will favour. Avoid the conflict by keeping the system block general and putting specific requirements in the topic.
Common errors
Putting rules in system instructions
The most common mistake is writing a business rule as a system instruction. For example, "Never share order details until the customer has given their order number" looks like a rule. It is a suggestion to the model. A customer who phrases the request in an unusual way may get a reply that ignores it. The fix is to gate the topic's instructions on a variable, as the later chapters on variables and conditions show.
Making the system block long
Teams often paste a full policy document into the system block. This costs prompt space on every turn and dilutes the topic text. Keep the system block to a few sentences. Put detail in the topic that needs it.
Repeating the system block in each topic
If every topic begins with "You are a support agent for orders", the repetition adds nothing. The system instructions already apply. Repeat only what is specific to the topic.
Forgetting the error path
Without an error message, a failed action may leave the customer with no useful reply. Set one, and keep it neutral so it is correct whatever failed.
Treating configuration as editable at runtime
Configuration is fixed at publish time. If you want behaviour that changes during a conversation, such as a flag set after the customer verifies their identity, use a variable. Variables are the subject of the next chapter.
A practical review checklist
Before you move on to topics, check the top of your script against these questions:
- Does the agent have a clear name and description?
- Do the system instructions fit in a few sentences?
- Does every sentence in them hold in every topic?
- Is any rule written here that should be a condition in a topic?
- Are the welcome and error messages set, and do they read well on their own?
Summary of the settings
| Setting | Group | Deterministic? | Typical content |
|---|---|---|---|
| Agent name and description | Configuration | Yes, fixed at publish | Identity and purpose |
| System instructions | System | No, read by the model | Role, tone, general limits |
| Welcome message | System | Yes, fixed text | First greeting |
| Error message | System | Yes, fixed text | Fallback when something fails |
Exercise
A script's system block says "Always ask for the order number before answering any order question." Testing shows the agent sometimes answers without asking. Why does this happen, and where should the fix go?
Show answer
System instructions are prompt text, so the model usually follows them but is not forced to. The fix is a rule in the topic: store the order number in a variable, then use an if condition in the topic's instructions so that, while the variable is empty, the only text the model sees tells it to ask for the order number.
Exercise
Sort these into "system block" or "topic logic": (a) reply in a friendly tone, (b) only offer a refund after the customer's identity is verified, (c) do not discuss unrelated topics, (d) show a fixed apology if an action fails.
Show answer
(a) system block, because it holds in every topic. (b) topic logic, because it depends on state and has a real cost if wrong. (c) system block, as a general limit. (d) system block, as the fixed error message, because it is deterministic text that applies everywhere.