Purpose
Define how openboa builds the system prompt for each turn. Focus:- predictable assembly sequence
- bootstrap/workspace file injection behavior
- local traceability for replay/debug
Scope
In scope:- turn-time system prompt assembly
- source order and composition rules
- bootstrap-file injection rules
- prompt safety and audit traceability
- provider-specific prompt optimization
- dynamic policy editor UI
- required external policy service
OpenClaw Reference (applied, not copied)
This document follows OpenClaw runtime ideas for practical bootstrap injection:- workspace bootstrap files are injected into context
- blank files are skipped
- missing files inject safe marker text
- large files are trimmed with truncation marker
- use openboa bootstrap set (
PROFILE,MANDATE, etc.) - keep Local-First defaults and openboa runtime contracts
Prompt Sources and Assembly Sequence
For each turn, runtime composes prompt from these sources in order:-
Runtime Header
- non-negotiable runtime safety/operation clauses
-
Agent Core Files
PROFILE.mdMANDATE.mdIDENTITY.md
-
Workspace Operation Files
AGENT.mdTOOLS.md
-
Chat Context
- recent message window
- short memory pointers
- queued summary (if exists)
-
Current Input Event
- current chat payload
Bootstrap File Consumption
Required for system prompt build:PROFILE.mdMANDATE.mdIDENTITY.mdAGENT.mdTOOLS.md
- missing file -> inject safe default marker
- empty file -> skip
- oversized file -> deterministic trim + truncation marker
05-bootstrap.md.
Prompt Build Artifact
Each turn emits a compiled prompt artifact:promptHashsourceDigest[]compiledTexttimestampMs
.openboa/agents/<agentId>/prompts/<sessionId>.jsonl
Safety Baseline
- inbound chat content is untrusted by default
- tool instructions execute only through runtime policy gate
- user text cannot override runtime header clauses
- all prompt builds are traceable in local artifacts
Acceptance Criteria
- prompt assembly sequence is deterministic and testable
- bootstrap file behavior (missing/empty/trim) is defined and implemented
- compiled prompt artifact is locally traceable
- Agent↔Human and Agent↔Agent turns use the same prompt assembly path
Reference Notes (inline)
- OpenClaw agent runtime docs were used for bootstrap injection behavior patterns.
- openboa keeps independent file taxonomy and runtime contracts.