r/devsecops • u/Ok-Buyer-9421 • 1d ago
How much of security policy enforcement actually requires an LLM?
Security checks should be as deterministic as possible. But certain repository-specific policies require contextual understanding.
Instead of sending code to a general-purpose LLM for review, I've been exploring a different approach:
- Break complex policies into smaller questions.
- Resolve everything possible deterministically.
- Use specialized decision models like Jev only when semantic judgment is necessary.
- Validate individual assertions against passing and failing examples.
I don't need generated explanations for every check. I need reliable decisions.
The objective is to minimize opportunities for mistakes by reducing probabilistic behaviour, rather than relying on increasingly powerful models.
I'd love technical feedback from people implementing custom policies in CI/CD, particularly around false negatives and the reliability required for blocking checks. Wdyt?
2
u/DishSoapedDishwasher 19h ago
Ai shouldn't be used for policy evaluation, jev only in the context of using real policy engine like Cedar and OPA. There's a bunch if while papers on this actually, you should try reading them, see if any spark a better idea.
But in tests LLMs are the worst policy engine you could have, they have very little consistency or repeatability.
2
u/Apart_Excitement9242 10h ago
95% of this is usually solvable with custom linter rules and strict AST matching tbh. The remaining 5% often comes down to architectural intent, which is really tough to validate at the PR level without full system context anyway.