Prompt Assembly
Prompt assembly is runtime work. It turns product identity, role, memory,
skills, references, surface context, and recent messages into loop-ready
agent.AgentMessage values.
System Prompt Fragments
Stable system fragments define Anyy identity, runtime rules, capability projection, skill index, and durable profile hints.
Keep stable fragments deterministic where possible so provider cache policy can reuse them.
Role Prompt
The default profile identity lives in $ANYY_HOME/SOUL.md. Named role
identity lives under roles/<role_id>/SOUL.md.
Role text shapes persona and working style. It does not grant tools, secrets, provider credentials, channel access, or memory ownership.
Memory Injection
Memory context comes from profile memory files and memory indexes. MEMORY.md
stores durable assistant memory; USER.md stores profile-level facts about the
person/operator.
Memory is context. Model-visible memory edits still go through memory tools and runtime policy.
Context Files
Workspace files, artifacts, URLs, folders, git references, and result references
are expanded by internal/references and rendered by context assembly.
Expanded references are untrusted data. Keep them out of product identity and stable policy text.
Tool Instructions
Tool descriptors define callable behavior. Prompt assembly may summarize visible toolsets and active skills, but tool authorization is enforced later by tool governance and runtime hooks.
Do not rely on prompt wording as the only guard for state-changing operations.
Provider Prompt Adapter
Provider prompt adaptation happens on provider-call copies. Native-provider guidance, cache hints, reasoning replay policy, and unsupported-field cleanup must not mutate persisted messages.