r/PiCodingAgent • u/HairyExit1450 • 26d ago
Question Very odd Pi behaviour - bug or something malicious?
I'm new-ish to pi ; Ive been playing locally on a macbook pro (a few months old) and have just tried setting things up so I can run qwen 3.8 flash next on my macbook under omlx and use a linux pc to run pi remotely.
The Linux machine is almost clean installed Ubuntu 24.04 ; I installed it a few years ago but its only been used for some small utility things (minicom / wireshark). I installed ghostty, pi and pi-omlx picker just now.
First thing just to test the connection was to say hello - then pi started talking about the system prompt asking it to install anki... Which was unexpected (to it too!) - I'd dug around the system prompts before and this seemed weird. So I asked pi where it came from and it has no idea and seems to think it looks like a prompt injection which makes me curious / suspicious ...
Has anyone seen anything similar and where would you be directing your investigations / suspicions?



7
u/jfuu_ 26d ago
If you resume that session it talked about Anki in and /export it to a HTML file, you can see the system prompt used in that session. It could just be hallucinating.
8
u/xRebellion_ 26d ago
It's possible the model itself could be faulty. Perhaps you could try other variants?
4
u/KPOTOB 26d ago
14% of 128K - you should be having zoo of skills
3
u/Healthy-Zebra-9856 26d ago edited 26d ago
The first thing I'd do is ask the model where it thinks that system instruction came from, but I'd verify the answer myself. LMs can hallucinate their own system instructions, so what you're seeing in the thinking trace isn't necessarily evidence of prompt injection.
Pi's default system prompt is assembled in
packages/coding-agent/src/core/system-prompt.ts. It can also be modified throughSYSTEM.md,APPEND_SYSTEM.md,AGENTS.md,CLAUDE.md, and extensions. I'd check those first.I've also noticed Pi still has some local-model integration issues that go back to the 0.80 days. One example is reasoning effort.
With Pi's built-in llama.cpp provider:
enable_thinking: true.reasoning_effort: "medium".xhighwhen thinking is enabled without an explicit reasoning effort.You're using oMLX rather than llama.cpp, but I checked the
pi-omlx-pickersource and found a similar limitation. It explicitly setssupportsReasoningEffort: false, and its thinking handler doesn't translate Medium into Qwen's actual medium setting.That could explain why you're seeing such extensive reasoning traces despite selecting Medium. It doesn't explain the Anki instruction, though. That's a separate issue.
One important detail is that Pi extensions can modify the outgoing provider request, and some prompt overrides won't be reflected in the saved session transcript. So searching the JSONL alone isn't conclusive.
I'd capture the actual request body reaching oMLX and compare it against a direct request to oMLX with the same messages. If the Anki instruction appears in the outgoing request, investigate Pi's prompt assembly and extensions. If it doesn't, investigate the model server's chat template, cache behavior, or the model simply generating a nonexistent instruction.
I wouldn't assume anything malicious until you establish whether that instruction was actually supplied to the model.
Here are the relevant sources:
Pi system prompt:
https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/system-prompt.ts
oMLX picker provider:
https://github.com/PeachlifeAB/pi-omlx-picker/blob/main/src/provider.ts
oMLX thinking controls:
https://github.com/PeachlifeAB/pi-omlx-picker/blob/main/src/thinking.ts
Qwen3.8 official model documentation:
https://huggingface.co/Qwen/Qwen3.8-Flash-Next
If you are lost in this, let me know I'll try to guide you the best way I can.
2
u/Remarkable-Sun7810 26d ago
it may be from jinja template - if you have downloaded model quants from some VeryCoolQuantsTrustMeBro repo or provided custom jinja template also downloaded from unknown source
1
u/Slight-Living-8098 26d ago
Install a permission extension.
Pi also reads skills from your global .agents directory outside of the installed pi directory. So if you have any skills in there or any that may be left over from another install, or used by another harness, they are visible to Pi.
Pi also supports the Agent Skills locations ~/.agents/skills/ and .agents/skills/. Project .agents/skills/
Anki makes flash cards for study and such. So check if you have any skill that might be used for something like that in those directories
1
u/hidden2u 26d ago
what happens if you start new session and ask it about anki
1
u/YoungShine- 25d ago
I have never met this kind of situation. I think it may be from the extension of your model. Probably this is not the fault of pi
1
u/fibojoly 24d ago
Well, I guessed the model after a line or two, so... I'm pretty sure it's the model. Is it local ?
My first interaction with Qwen was witnessing its complete and utter confusion when I tried to start with a simple "hello".
1
u/shumgoid 18d ago
I have seen similar odd thinking traces as well as others discussing this with qwen flash next on strata - pretty sure it is a bug with expert prediction/selection and could happen with other greedily optimized inference engines too.
2
u/[deleted] 26d ago
[removed] — view removed comment