protectai / llm-guard

The Security Toolkit for LLM Interactions
https://llm-guard.com/
MIT License
1.13k stars 141 forks source link

Detecting code from free flow text prompt #75

Open aditya1709 opened 7 months ago

aditya1709 commented 7 months ago

Was wondering if the input scan here can detect and extract code in free flow text prompt? For example when the prompt contains code without the three backticks or markdown?

asofter commented 7 months ago

Hey @aditya1709 , thanks for raising the issue here.

We actually looked at that using a few methods but it's not really trivial as code can be in many programming languages and sometimes it can be partial code. Anyway, recently we found a way to achieve that which still needs to be tested.

I will keep you posted

aditya1709 commented 7 months ago

Thanks @asofter I have been working on this independently and would be down to collaborate if we can work on it together. I have a solution that I have almost built as well.

asofter commented 7 months ago

That's awesome. Are you part of our Slack (invite? Let's connect there and discuss the next steps