Append System Prompt
Steer any agent with a one-off system-prompt suffix — no file or YAML edits
--append-system-prompt appends an arbitrary text suffix to the assembled system prompt for a single invocation — never persisted, and applied at the very end so the cacheable prompt prefix stays intact.
Quick Start
- Append literal text
bash praisonai code --append-system-prompt "Always answer in French" - Read the suffix from a file
bash praisonai run "Refactor this module" --append-system-prompt @policy.md - Set the env var (CI-friendly)
bash export PRAISONAI_APPEND_SYSTEM_PROMPT="Be brief. No preamble." praisonai chat
How It Works
The CLI resolves the flag value, exports it as PRAISONAI_APPEND_SYSTEM_PROMPT, and the core Agent reads that single env var when it assembles its system prompt. Because every construction path — interactive TUI, one-shot prompt, YAML agents, and Python Agent(...) — funnels through the same env var, the suffix reaches all of them without a new constructor parameter.
The suffix is appended after the stable prompt prefix (and after any path-scoped glob rules), so the cacheable base prompt is preserved and prompt-cache reuse is unaffected. A whitespace-only or unset value is a no-op, and the suffix is never written to any agent definition, YAML, or session backstory.
Choosing a Form
Pick the form that matches how long the guidance should live and how it’s supplied.
| Option | Type | Default | Description |
|---|---|---|---|
--append-system-prompt | str (literal or @file) | None | Per-invocation suffix appended to the system prompt. |
PRAISONAI_APPEND_SYSTEM_PROMPT (env) | str | unset | Fallback used when the flag is omitted. |
When the value starts with @, the file contents are read (a missing file falls back to treating the raw value as literal text, so a run is never derailed).
Where It Applies
One flag, three commands, same value shape everywhere. Exporting the env var also reaches YAML and Python agents in the same process.
| Command | Flag | Env fallback |
|---|---|---|
praisonai code | --append-system-prompt | PRAISONAI_APPEND_SYSTEM_PROMPT |
praisonai chat | --append-system-prompt | PRAISONAI_APPEND_SYSTEM_PROMPT |
praisonai run | --append-system-prompt | PRAISONAI_APPEND_SYSTEM_PROMPT |
| YAML / Python | — | PRAISONAI_APPEND_SYSTEM_PROMPT |
Common Patterns
Steer one CLI run in French, no code changes:
praisonai code --append-system-prompt "Always answer in French"Read the suffix from a policy file:
praisonai run "Refactor this module" --append-system-prompt @policy.mdSet once for a CI job, use across every command:
export PRAISONAI_APPEND_SYSTEM_PROMPT="Reply in strict JSON, no prose."
praisonai chatSame knob from Python — every Agent constructed after the export picks it up:
import os
from praisonaiagents import Agent
os.environ["PRAISONAI_APPEND_SYSTEM_PROMPT"] = "Reply concisely; no bullet points."
agent = Agent(instructions="You are a research assistant")
agent.start("Summarise transformer attention in 3 lines.")Best Practices
Keep the suffix short
Long suffixes reduce prompt-cache reuse across turns. Prefer a concise steer over a full policy in the flag itself.
Prefer @file for multi-line policies
Reading from a file keeps shell quoting sane and versions the policy alongside your project.
Use the env var in CI
Set PRAISONAI_APPEND_SYSTEM_PROMPT once so the same command runs everywhere without editing each invocation.
Not for persistent behaviour
When the guidance is permanent, put it in YAML or instructions= instead — the suffix disappears when the process exits.