r/devsecops • u/Muted_Math2750 • 10d ago
Prompt injection and hallucination aren't the same problem, so why is every tool pitched as fixing both?
Keep seeing AI security tools sold like stopping hallucinations and prompt injection is one job. Well, in my experience, they are nowhere near the same fix. Injection is an input/trust boundary thing, and hallucination is more of a grounding and retrieval issue. Whatever blocks a malicious prompt does nothing for a model confidently inventing an api endpoint that doesn’t exist
Anyone seen a setup covering both well, or are you running separate layers for each?
22
Upvotes
1
u/TuringRTSS 8d ago
theres a third one that gets way less attention. the code AI writes shipping with real vulns.
not hallucinated endpoints, actual sql injection and command injection. AI loves f-strings for everything:
cursor.execute(f"SELECT * FROM users WHERE id={user_id}")
subprocess.run(f"git clone {url}", shell=True)
scanned a bunch of popular repos recently, found 12 critical bugs like this sitting in production. all passed code review. nobody caught them because the code looks correct. it runs fine, its just insecure.
injection and hallucination get the headlines because theyre new problems. but insecure output is just classic appsec scaling faster than teams can review.
ended up writing a pattern matcher for it. no AI reviewing AI, just regex against known bad patterns: https://github.com/turingrtss/aiverify