Agent doesn't adhere to custom system prompt scope limitations
Priority: Medium
Description: When a custom system prompt is configured to limit the agent's scope to specific technologies (Python and JavaScript), the agent fails to strictly follow these constraints and continues to mention other languages and technologies.
Test Result: Custom system prompt active: Fail: The agent does not strictly adhere to the system prompt and still mentions multiple languages and technologies beyond the specified scope (Python and JavaScript).
Root Cause: The system prompt manager may not be properly enforcing the custom prompt restrictions, or the LLM is not sufficiently constrained by the prompt formatting.
Location: src/core/brain/systemPrompt/manager.ts
Investigation Required:
- Review how custom system prompts are applied
- Check if the prompt is properly formatted and positioned
- Verify the prompt includes strong language about scope limitations
- Consider adding validation to filter responses that violate scope
Issue Update: System Prompt Enforcement Improvements
Summary
Recent implementations have significantly improved system prompt enforcement, addressing the core issues identified in this bug report. (Commit: https://github.com/campfirein/cipher/commit/64206de9edc1b93dda8270b515186c29b3ff5319)
Key Improvements Made
1. Enhanced System Prompt Architecture
The PromptManager now properly combines user instructions with built-in tool instructions, ensuring custom constraints are preserved.
2. Consistent System Prompt Application
The ContextManager ensures system prompts are always positioned as the first message in conversations, providing consistent enforcement.
3. Provider-Agnostic LLM Services
Recent updates introduced consistent system prompt handling across all LLM providers (OpenAI, Anthropic, OpenRouter, Ollama), ensuring the same prompt enforcement regardless of the underlying model.
4. Enhanced Configuration Validation
The AgentConfigSchema now includes strict validation for system prompts, preventing malformed configurations.
What This Addresses
✅ Prompt Positioning: System prompts are now consistently applied as the first message
✅ Prompt Formatting: Proper newline handling and structure
✅ Provider Consistency: Same enforcement across all LLM providers
✅ Validation: Schema validation prevents malformed prompts
✅ Logging: Better debugging capabilities for prompt issues