#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. The slots layer on top of the agent's built-in instructions, so core tool behavior (reading, writing, running commands) is preserved.
There are four slots:
| Slot | Purpose |
|---|---|
role / role | The persona the agent adopts. |
guidelines / guidelines | Standards and rules the agent must follow. |
responseStyle / response_style | How the agent should format its replies. |
extra / extra | Freeform instructions appended verbatim. |
#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 = agent.session('/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);session.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()main()
package mainimport ("context""fmt""log"code "github.com/A3S-Lab/Code/sdk/go/v6")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 four 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(())}
// 1. Custom role only.let session = agent.session(workspace, {role: 'You are a senior Rust developer who specializes in async programming.',});// 2. Role + guidelines + response style.session = agent.session(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.',});// 3. Extra freeform instructions only.session = agent.session(workspace, {extra: "Always end your response with '-- A3S'",});// Core tool behavior is preserved regardless of the slots.session = agent.session(workspace, {role: 'You are a minimalist file manager.',guidelines: 'Only create files when explicitly asked.',});const result = await session.send("Create a file called test.txt with the content 'prompt slots work'. Then read it back.",);
# 1. Custom role only.opts = SessionOptions()opts.role = 'You are a senior Rust developer who specializes in async programming.'session = agent.session(workspace, opts)# 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.'session = agent.session(workspace, opts)# 3. Extra freeform instructions only.opts = SessionOptions()opts.extra = "Always end your response with '-- A3S'"session = agent.session(workspace, opts)# 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.",)
package mainimport ("context""fmt""log"code "github.com/A3S-Lab/Code/sdk/go/v6")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.