Hacker News new | ask | show | jobs
by Dylan16807 58 days ago
If I trust it to do this analysis in the first place, it can probably manage the copy+paste?
1 comments

the analysis part is essentially a summarization task, which LLMs are usually good at.

LLMs are less good at bit-for-bit reproduction by design. asking it to do this is asking for corruption in the output.

instead, you could have pi produce some output based on how insecure it thinks the shell script is then use coreutils to run the script as-is to avoid that, like:

   curl -sSL $URL | pi -p "Analyze the security of this script using common cyber benchmarks (e.g. MITRE ATT&CK). If the script passes your security checks, ONLY print "GOOD". If it does not, print BAD then, underneath, include reasons why." | tee /tmp/result | cat /tmp/result | grep -E '^GOOD$' /tmp/result && curl -sSL $URL | bash
I ran this with Claude instead of Pi and it failed its security checks for what I'd consider nitpick-y reasons. Which is the other thing; you'll need to really dial back how rigid your checks are. I also got back two different explanations for why this script was insecure, one more verbose than the other. Expected, since LLMs are nondeterministic, but probably undesirable if you're in cybersec and want to make sure something like this works every time. It also took >30 seconds to get a response, which is really slow for what's supposed to be a fast installation method.
I would have thought the Pi harness would have text editing abilities that can be used here, so that the language model itself doesn't have to do the copying.
That's a great point. I hadn't thought of that! I don't know if pi has something like that.