#Prompt Slots
Prompt slots are session options that shape the agent's system prompt declaratively. Use them for host-level behavior — persona, coding standards, output style — that should not live inside each user prompt. Slots only change the edges of the system prompt: the runtime contract, the repository-tool contract, and the safety boundaries are always kept, so core tool behavior (reading, writing, running commands) is preserved.
There are five text slots (Node.js / Python names shown; Rust uses the
SystemPromptSlots::with_* builders and Go uses the PromptSlots fields):
| Slot | Effect on the system prompt |
|---|---|
role / role | Replaces the default identity line. |
guidelines / guidelines | Added to the Guidelines section. |
responseStyle / response_style | Replaces the default Response Format section. |
outputLanguage / output_language | Pins user-facing replies to a BCP-47 tag such as zh-CN. |
extra / extra | Appended verbatim at the end. |
Rust's SystemPromptSlots also has with_style, which forces one of the built-in
prompt styles.
#Basic usage
Set any subset of the slots when you open a session. They apply to every turn of that session.
use a3s_code_core::{Agent, SessionOptions, SystemPromptSlots};#[tokio::main]async fn main() -> a3s_code_core::Result<()> {let agent = Agent::new("agent.acl").await?;let slots = SystemPromptSlots::default().with_role("release-readiness reviewer").with_guidelines("Find blockers before improvements. Require command evidence for done claims.",).with_response_style("concise, findings first");let session = agent.session_builder("/repo").options(SessionOptions::new().with_prompt_slots(slots)).build().await?;let result = session.send("Is this repo ready to ship?", None).await?;println!("{}", result.text);session.close().await;agent.close().await;Ok(())}
import { Agent } from '@a3s-lab/code';async function main() {// create() accepts an .acl file path or inline ACL string.const agent = await Agent.create('agent.acl');const session = await agent.sessionAsync('/repo', {role: 'release-readiness reviewer',guidelines:'Find blockers before improvements. Require command evidence for done claims.',responseStyle: 'concise, findings first',});const result = await session.send('Is this repo ready to ship?');console.log(result.text);await session.closeAsync();await agent.close();}main().catch((err) => {console.error(err);process.exit(1);});
from a3s_code import Agent, SessionOptionsdef main():# create() accepts an .acl file path or inline ACL string.agent = Agent.create('agent.acl')opts = SessionOptions()opts.role = 'release-readiness reviewer'opts.guidelines = 'Find blockers before improvements. Require command evidence for done claims.'opts.response_style = 'concise, findings first'session = agent.session('/repo', opts)result = session.send('Is this repo ready to ship?')print(result.text)session.close()agent.close()main()
package mainimport ("context""fmt""log"code "github.com/A3S-Lab/Code/sdk/go/v9")func main() {ctx := context.Background()agent, err := code.Create(ctx, "agent.acl")if err != nil {log.Fatal(err)}defer agent.Close(context.Background())session, err := agent.Session(ctx, "/repo", &code.SessionOptions{PromptSlots: &code.PromptSlots{Role: "release-readiness reviewer",Guidelines: "Find blockers before improvements. " +"Require command evidence for done claims.",ResponseStyle: "concise, findings first",},})if err != nil {log.Fatal(err)}defer session.Close(context.Background())result, err := session.Run(ctx, "Is this repo ready to ship?")if err != nil {log.Fatal(err)}fmt.Println(result.Text)}
#Each slot in turn
The slots compose independently. A persona-only session, a reviewer with strict guidelines, and a session that appends a freeform instruction all use the same option set.
use a3s_code_core::{Agent, SessionOptions, SystemPromptSlots};#[tokio::main]async fn main() -> a3s_code_core::Result<()> {let agent = Agent::new("agent.acl").await?;let role_only = agent.session_builder("/repo").options(SessionOptions::new().with_prompt_slots(SystemPromptSlots::default().with_role("You are a senior Rust developer who specializes in async programming.",),)).build().await?;role_only.close().await;let reviewer = agent.session_builder("/repo").options(SessionOptions::new().with_prompt_slots(SystemPromptSlots::default().with_role("You are a Python code reviewer.").with_guidelines("Always check for type hints. Flag any use of `eval()`.").with_response_style("Reply in bullet points. Be concise."),)).build().await?;reviewer.close().await;let extra_only = agent.session_builder("/repo").options(SessionOptions::new().with_prompt_slots(SystemPromptSlots::default().with_extra("Always end your response with '-- A3S'"),)).build().await?;extra_only.close().await;let file_manager = agent.session_builder("/repo").options(SessionOptions::new().with_prompt_slots(SystemPromptSlots::default().with_role("You are a minimalist file manager.").with_guidelines("Only create files when explicitly asked."),)).build().await?;let result = file_manager.send("Create test.txt with 'prompt slots work', then read it back.",None,).await?;println!("{}", result.text);file_manager.close().await;agent.close().await;Ok(())}
import { Agent } from '@a3s-lab/code';const agent = await Agent.create('agent.acl');const workspace = '/repo';// 1. Custom role only.const roleOnly = await agent.sessionAsync(workspace, {role: 'You are a senior Rust developer who specializes in async programming.',});await roleOnly.closeAsync();// 2. Role + guidelines + response style.const reviewer = await agent.sessionAsync(workspace, {role: 'You are a Python code reviewer.',guidelines: 'Always check for type hints. Flag any use of `eval()`.',responseStyle: 'Reply in bullet points. Be concise.',});await reviewer.closeAsync();// 3. Extra freeform instructions only.const extraOnly = await agent.sessionAsync(workspace, {extra: "Always end your response with '-- A3S'",});await extraOnly.closeAsync();// Core tool behavior is preserved regardless of the slots.const fileManager = await agent.sessionAsync(workspace, {role: 'You are a minimalist file manager.',guidelines: 'Only create files when explicitly asked.',});const result = await fileManager.send("Create a file called test.txt with the content 'prompt slots work'. Then read it back.",);console.log(result.text);await fileManager.closeAsync();await agent.close();
from a3s_code import Agent, SessionOptionsagent = Agent.create('agent.acl')workspace = '/repo'# 1. Custom role only.opts = SessionOptions()opts.role = 'You are a senior Rust developer who specializes in async programming.'agent.session(workspace, opts).close()# 2. Role + guidelines + response style.opts = SessionOptions()opts.role = 'You are a Python code reviewer.'opts.guidelines = 'Always check for type hints. Flag any use of `eval()`.'opts.response_style = 'Reply in bullet points. Be concise.'agent.session(workspace, opts).close()# 3. Extra freeform instructions only.opts = SessionOptions()opts.extra = "Always end your response with '-- A3S'"agent.session(workspace, opts).close()# Core tool behavior is preserved regardless of the slots.opts = SessionOptions()opts.role = 'You are a minimalist file manager.'opts.guidelines = 'Only create files when explicitly asked.'session = agent.session(workspace, opts)result = session.send("Create a file called test.txt with the content 'prompt slots work'. Then read it back.",)print(result.text)session.close()agent.close()
package mainimport ("context""fmt""log"code "github.com/A3S-Lab/Code/sdk/go/v9")func open(ctx context.Context,agent *code.Agent,slots code.PromptSlots,) *code.Session {session, err := agent.Session(ctx, "/repo", &code.SessionOptions{PromptSlots: &slots,})if err != nil {log.Fatal(err)}return session}func main() {ctx := context.Background()agent, err := code.Create(ctx, "agent.acl")if err != nil {log.Fatal(err)}defer agent.Close(context.Background())roleOnly := open(ctx, agent, code.PromptSlots{Role: "You are a senior Rust developer who specializes in async programming.",})roleOnly.Close(ctx)reviewer := open(ctx, agent, code.PromptSlots{Role: "You are a Python code reviewer.",Guidelines: "Always check for type hints. Flag any use of `eval()`.",ResponseStyle: "Reply in bullet points. Be concise.",})reviewer.Close(ctx)extraOnly := open(ctx, agent, code.PromptSlots{Extra: "Always end your response with '-- A3S'",})extraOnly.Close(ctx)fileManager := open(ctx, agent, code.PromptSlots{Role: "You are a minimalist file manager.",Guidelines: "Only create files when explicitly asked.",})defer fileManager.Close(context.Background())result, err := fileManager.Run(ctx,"Create test.txt with 'prompt slots work', then read it back.",)if err != nil {log.Fatal(err)}fmt.Println(result.Text)}
Slots customize personality and house rules; they do not disable tools or change the
agent's core loop. Keep task-specific requests in the send message and reserve the slots
for behavior that should hold across every turn of the session.
A runnable version ships at sdk/node/examples/skills/test_prompt_slots.ts.