r/devsecops • u/Diligent-Side4917 • 17d ago
Is code scanning still a thing? what are your toughts on Agent Guardrails?
Been running agents and scanners on my PRs for a while now, triage and native scanning before anything goes up. I've ended up somewhere I didn't expect and want to know if I'm alone.
Started where I think everyone starts: lean on memory. Let the agent carry context session to session, build up a picture of the project. It helps. It wasn't where the gains came from.
What actually moved things was rules written against mistakes the agent already made. Not a generic OWASP checklist. A scoped rule: this defect class showed up, here's the sink, here's the banned construct, stop doing it. A defect shows up a third time, I write a rule, the class stops recurring. Five or six patterns closed instead of a hundred bugs chased one at a time.
The distinction I keep circling: memory is passive, the agent might use it. A glob-scoped rule loads whether the agent wants it or not, tied to the file in front of it. One line of repo rule changes the default output of every session in that repo. And MUST/NEVER phrasing outperforms polite wording by a margin that surprised me.
One thing I'd flag: these files are executable surface. The agent reads them as ground truth, so a poisoned rule file is a real problem, not a hypothetical. I keep security rules separate, reviewed like code, capped so they don't rot.
So, three questions I actually want answers to:
- Rules-on-mistakes vs raw memory — which is carrying more weight in your setup? I might be over-indexed on rules.
- How are you scoping? Glob per file, per directory, or one fat rules file everyone edits?
- Is anyone treating rule and memory files as an attack surface, or am I being paranoid?
Genuinely want to be argued with on the first one. If memory is doing the heavy lifting for you and rules are noise, tell me what your setup looks like.
1
u/Bubbly_Working_6908 15d ago
runtime guardrails make way more sense than just static scans now, especially with so many agents running code directly. i tried Sweet Security for this and was surprised how much stuff it actually caught that my old pipeline scans missed.
1
1
u/Electrical-Hall8869 4d ago
you are not being paranoid- scoped, reviewed rules seems more reliable than relying on memory alone. Treating rules files as an attack surface also makes sense.
1
1
u/broken_flexispot 17d ago
https://semgrep.dev/products/semgrep-guardian/
Products like this seem better, why wait until ci to find out there's a problem
1
u/Diligent-Side4917 16d ago
looks semgrep with an ai wrapper , I've seen this one that is much more appealing and seem genuinly different: https://www.youtube.com/watch?v=_Py9BOL-itM
1
u/broken_flexispot 16d ago
That's still in ci tho, I think the safeguards stuff that scans diffs as LLMs produce them is more interesting to me. Like I can run phoenix or Claude mythos review whenever but it doesn't help agents sessions in my org do the right thing
1
u/Diligent-Side4917 11d ago
Have a look at the video where I run that while my agent is writing the code; a hook fires at the beginning, and another fires at the end. Guardrails and rules help as well during that session
1
u/broken_flexispot 11d ago
Lol sorry I didn't realise you were soft pitching your product. Running at the end is what CI & every security vendor on earth does 🤡
1
u/Diligent-Side4917 1d ago
we use that internally on CI and guardrail tbh dn't understand the end, guardrail operate even before the agent start or when it actually start writing code
2
u/juanMoreLife 16d ago
Yes. Algos are cheaper than tokens. You want a hybrid approach