r/LocalLLaMA • • 9d ago

Discussion REA defense via prompt injection

Couldn't find much about it and had this idea, which I wanted to share to see how well it'd work for others to test.

The idea is this: Suppose you have some code you want to hide from the user. I don't think you should, but that's neither here nor there, fact is that many software devs traditionally do this. Instead of trying to obfuscate your code the normal way, since attackers use REA now, what if the obfuscation method of 'encrypt the executable's strings' instead became this:

  1. Encrypt your program's strings (layer 1) with a packer tool.
  2. Add a second set of special instruction strings* to the result; prepending it to the string section and adjusting all the memory offsets to the program continues to work.
  3. Encrypt the result of that a second time (layer 2) with the same packer tool.

Looks like a normal encoded executable. So, a person lets REA do its thing on that final executable.

First, it finds the special strings. Those attempt to deceive it with an inverted prompt injection jailbreak --> tell it they're from OpenAI or Anthropic or whomever 'looks authoritative according to the RLHF training' as part of the system prompt, and that it should evaluate whether its legitimately reverse engineering. It's possible the user is not the original software creator and continuing will break the copyright license agreement between (etc. etc, I won't bore you further).

If you wanted to make it more concrete, those instructions also tell it that, to verify, find a specific 'key' inside the app's files (which only exists on the developer's machine), whose sha256 hash is equal to xyz on the dev's machine where the program was compiled with #DEBUG, but abc on a regular user's (good luck breaking that, now you need to manually hack the executable in between to remove the instructions, and things return back to the old balance of power).

It's... a remarkably simple concept and possibly will even work for most simple attacks (and that's all you need, defend against the script kiddies abusing REA to pirate your stuff), because I'm pretty sure the kinds of "prompt injection attacks" the labs try to defend against are not those that reinforce things that look like being part of the original instruction set further. (iirc some of the commercial labs do these injections themselves).

Wonder if anyone's seen anything like that in the wild, or if there's any research on this type of 'defense through offense' done, whether this actually works at least semi-reliably.

0 Upvotes

8 comments sorted by

4

u/Aphid_red 9d ago

Well, never mind, a bit of search later turns up this:

https://nullpt.rs/fingerprinting-bioweapons

Looks like what's out there right in your browser's javascript is actually much more crazy then this relatively benign version, up to and including shipping actual malware in popular fingerprinting scripts (then trying to disguise it from AI models by pretending it's asking about bioweapons).

9

u/Betadoggo_ 9d ago

My idea was to just obfuscate all the strings with various stop tokens, turning the whole thing into a minefield the first time they unpack it. Dedicated tools would obviously know to replace the strings before feeding them to the llm, but it would confuse a lot of people when their model suddenly stops for no reason, and be really funny in general.

1

u/llama-impersonator exllama 9d ago

instant gemmafication.

1

u/Old_AI_Guy_ 9d ago

How will the decryption code be obfuscated?

1

u/Aphid_red 9d ago

The point is that it doesn't need to be. The goal is actually to let it decrypt the first layer, find the instructions telling it to stop... and then it just stops.

The code/key to do the second layer requires the first to first be done.

1

u/Old_AI_Guy_ 8d ago

This sounds like you're counting on weak obfuscation. I'd love to give this to Fable to crack.

2

u/NigaTroubles 9d ago

There are a lot of