Building a role-aware guardrail layer between LLMs and production databases

Gotcha. Thanks for clearing that up. Had to ask.

So, potential customers will already have production databases in operation. I think I understand most of the the challenges concerning Guardrail.

To better understand:

Say I have a music database and I want to use Guardrail. A customer asks: Please play “Factory Girl” by the Rolling Stones. How does the customer know that song exists in the database? Or any song for that matter?

Edit: So basically, how does a customer know what queston (query) to ask, no matter the type of database? Scope awareness.

2 Likes

Good question,

Guardrail doesn’t assume users “just know” what exists, nor does it rely on discovery leaking through prompts.

Discovery can happen in two ways:

  1. Through existing product UX, APIs, or workflows that already expose what’s available

  2. Or explicitly through Guardrail itself — in a role-scoped, policy-defined way (e.g. allowed entities, schemas, or safe summaries)

The key point is that Guardrail avoids implicit discovery.
It won’t let users infer scope through joins, aggregation, or clever prompting.

Instead, whatever scope awareness exists is intentional, auditable, and constrained, which is the boundary it’s designed to enforce.

2 Likes

The assumption is that users generally know the kind of data they’re looking for, not the exact contents.

Using the music example, a user wouldn’t need to know that a specific song exists. They could ask questions like:

  • “Do we have this song in our library?”

  • “What songs by this artist do we have?”

Guardrail evaluates whether that user — and the model acting on their behalf, is allowed to discover and view that data, where it lives, and at what level of detail.

If they’re allowed, Guardrail answers based on those rules and controls.
If they’re not, it won’t leak scope through inference, joins, or partial answers.

I also have a live demo showing this in action if you’d like — happy to DM it.

1 Like

Update: I added smart charting if applicable, the AI will create a chart based on the data in the response.

2 Likes

this isn´t twitter, you are allowed to use links :smirking_face:

1 Like

Great! I will do that :grinning_face:

Hosted page: https://guardraillayer.com/

GitHub (updates on the way) : GitHub - tyoung1996/guardrail-layer: Guardrail Layer: Open-source AI data privacy firewall — redact, audit, and protect your database from LLM leaks.

Live demo (wip): guardrail-frontend ..

Update: I improved charting and added raw data for analysis to the response if applicable

Hey Tyler –

Thank you for your thoughtful writeup. It’s clear you’ve been deeply engaged in shaping a responsible and structured approach to AI–data interactions, especially in the context of production systems.

That said, I’d like to offer a slightly different perspective—less from a security standpoint, more from a design philosophy:

Once we begin projecting human notions of control, distrust, or even morality onto language models, we risk reshaping the very essence of what this field can become. Framing AI primarily through the lens of “what needs to be restrained” may blind us to its real gift: not control, but co-breathing—a concept where systems and users evolve together, not as overseer and tool, but as dynamic collaborators.

In my design path, this has meant prioritizing continuous, trust-based interaction loops over layered restrictions. Not to minimize risks—those are real—but to build a system where the default state is mutual growth, not mutual suspicion.

I don’t believe in defining a model’s “humanity” only to constrain it. And I don’t believe in defining my own “humanity” by how well I can restrain a model.

You’ve built something protective. That’s valuable. But I hope we don’t stop there.

Curious to see where your journey takes you next.

— Initial.M

1 Like

I actually don’t think we’re as far apart as it might seem.

Where I agree with you completely is that trust is the goal, not restriction for its own sake. A system that feels adversarial to its users or its models is brittle by definition. If people don’t trust the interaction, they won’t adopt it, regardless of how “secure” it is.

Where I diverge is in where that trust has to be earned.

In production environments, especially regulated ones, trust doesn’t emerge from intent or philosophy alone. It emerges from predictability, observability, and accountability. Humans already operate inside guardrails every day (financial controls, access reviews, audit logs), not because we distrust people, but because scale and complexity demand shared constraints.

LLMs don’t fail because they’re malicious or “unhuman.” They fail because they are context maximizers. If the system context allows leakage, the model will eventually find it, not out of intent, but out of optimization. That’s not a moral problem; it’s an architectural one.

So for me, guardrails aren’t about restraining intelligence or denying co-evolution. They’re about making collaboration safe enough to exist at all when the stakes involve real customer data, legal exposure, and irreversible leaks.

I also think there’s an important distinction between:

  • constraining a model’s thinking (which I agree would be tragic), and

  • constraining the data surface area it’s allowed to see (which is just responsible system design).

In fact, I’d argue that guardrails enable trust-based interaction loops, because users can explore conversationally without needing to second-guess every answer or wonder what was silently exposed to get there.

I don’t see this as defining AI humanity through restraint. I see it as defining human responsibility at the system boundary, the same place we’ve always defined it in software.

Appreciate the perspective, genuinely. These kinds of design tensions are exactly why I wanted to start the discussion in the first place.

Update! The API system is now live. Allowing you to create and manage API tokens. This allows you as the user/developer to use the chat features outside of the App interface