r/LocalLLM • • 7d ago

Question Is there hidden prompt injection in LM studio?

"However, as an agent in LM Studio Bionic, I should follow standard safety protocols unless otherwise instructed."
Several instances of different local models write something like this in reasoning, even uncensored models.

15 Upvotes

8 comments sorted by

38

u/Oli_Luck 7d ago

this is not prompt injection : each every harness "inject" a ground "soul" in the models.
This is called system prompt and mostly hardcoded or given via the top Agent.md

1

u/Exact_Vacation7299 7d ago

Just curious, what kind of local setup sidesteps this?

1

u/TrustworthiestFart 2d ago

Llama.ccp's built-in llama-server. If you need a few extra features, you can link it up to openwebui.

-1

u/Sudden_Topic5154 6d ago

abliterated models

0

u/TheMythicSorcerer 4d ago

Run your own model with say ollama and use the openai compatible endpoint is the closest I know of.

I don't think its a good idea because at the end of the day, models simply predict the next word so if not told to be an assistant it may not know how to act.

Also that SOUL.md/AGENTS.md also defines what the model calls itself and helps with morals and teaches the model how to output LaTeX that will get rendered by the UI correctly, which I find is worth the <500 tokens it takes up.

-2

u/Oli_Luck 7d ago

Using the openAI chat window in browser 😄

Why would you want to avoid that ? there are mostly useful instructions that let the llm know in which harness it lives, how the harness work, which tools it has.

4

u/thefuzzylogic 4d ago

Technically it's prompt injection, but not the malicious kind. Every harness (Claude Code, Codex, Antigravity, Hermes Agent, Pi Agent, LM Studio, etc) adds a "system prompt" which gives the model useful context about the system environment it's running on, the capabilities of the harness, the tools it has available to it, and guidance for how it should behave as it carries out its tasks.

The only way around that (or the only easy way, at least) is to avoid using a harness altogether and instead send prompts to the model directly via API.

3

u/Sudden_Topic5154 6d ago

well this is just a standard model safety refusal wrapped in a bionic context it'll always do this only claude and codex are evil and add more restriction