u/Alert_Ad4540

I’ve been working on a small open-source project called Guardrail4J.

It’s a Spring Boot starter that lets you annotate LLM-calling methods with u/LLMGuarded and add basic cost/usage guardrails.

Current MVP:

- Spring AOP interception

- dynamic user/tenant extraction with SpEL

- estimated cost tracking by provider, model, user, tenant, and feature

- ALLOW / WARN / BLOCK / FALLBACK decisions

- usage summary endpoint

- demo app and docs

It’s still early and not production-ready. Storage is in-memory, costs are estimated, and fallback is currently a decision/log signal.

Would this be useful in a real Spring Boot app? Would you prefer annotations or a more config-based approach?

Repo:

https://github.com/AbaSheger/guardrail4j

u/Alert_Ad4540 — 11 days ago