A3S Docs
A3S CodeExamples

Prompt Slots

Customize agent personality with slot-based system prompt — role, guidelines, response style, and extra instructions

Prompt Slots

Customize the agent's behavior without overriding core agentic capabilities. The slot-based system prompt preserves tool usage strategy, autonomous behavior, and completion criteria while letting you inject custom personality, guidelines, and response style.

Prompt slots are additive — the core agentic prompt (tool usage, completion criteria, autonomous behavior) is always preserved. You cannot accidentally break the agent's ability to use tools.

Slot Positions

Prop

Type

Custom Role

Set a persona for the agent:

import { Agent } from '@a3s-lab/code';

const agent = await Agent.create('~/.a3s/config.hcl');
const session = agent.session('/my-project', {
  role: 'You are a senior Rust developer specializing in async programming.',
});

const result = await session.send('What is your area of expertise?');
console.log(result.text);

Run: node examples/test_prompt_slots.ts Source: sdk/node/examples/test_prompt_slots.ts

from a3s_code import Agent, SessionOptions

agent = Agent.create("~/.a3s/config.hcl")

opts = SessionOptions()
opts.role = "You are a senior Rust developer specializing in async programming."
session = agent.session("/my-project", options=opts)

result = session.send("What is your area of expertise?")
print(result.text)

Run: python examples/test_prompt_slots.py Source: sdk/python/examples/test_prompt_slots.py

Role + Guidelines + Response Style

Combine multiple slots for a fully customized code reviewer:

const session = agent.session('/my-project', {
  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.',
});

const result = await session.send('Review the file app.py and list any issues.');
console.log(result.text);
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("/my-project", options=opts)

result = session.send("Review the file app.py and list any issues.")
print(result.text)

Extra Instructions

The extra slot appends freeform instructions at the end of the prompt. This is backward-compatible with the legacy system_prompt field:

const session = agent.session('/my-project', {
  extra: "Always end your response with '— A3S'",
});
opts = SessionOptions()
opts.extra = "Always end your response with '— A3S'"
session = agent.session("/my-project", options=opts)

Tools Still Work

Prompt slots only affect the system prompt — core tool behavior is fully preserved:

API Reference

Prop

Type

On this page