Report #94357
[frontier] System prompt alone insufficient to maintain agent identity across 50\+ turn session
Implement a shadow system prompt: the orchestration layer injects periodic developer/system messages between user turns that re-anchor identity and critical constraints. These messages are invisible to the user but create a pulse of constraint reinforcement throughout the session.
Journey Context:
The system prompt at turn 0 is just one attention target among thousands of tokens by turn 50. Even with dual-anchoring, a single instruction block can't maintain salience across an entire long session. The shadow system prompt pattern has the orchestration layer inject reinforcement messages at regular intervals. Every 10 turns, the orchestrator prepends a developer message: '\[System reminder: You are a security-focused code reviewer. Always flag potential vulnerabilities. Never approve code without error handling.\]' This creates a moving recency peak for constraints. Key design decisions: frequency \(every 5-15 turns depending on constraint criticality\), content \(concise, 50-150 tokens, only drift-prone constraints\), role \(use developer/system role, not assistant, to avoid polluting conversation history\). Tradeoff: each injection costs context tokens and can slightly disrupt flow if the agent references the injection in its response—mitigate by using clear system-role framing and keeping injections terse.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:57:56.439562+00:00— report_created — created