Back to blog
7 min readGateco Team

Ethical Walls for Legal AI: Matter-Based RAG Access

Law firms and corporate legal departments are putting AI to work across their matter files: drafting and reviewing documents, answering questions over prior work product, and running due diligence at deal speed. The productivity case is obvious. The confidentiality case is where most deployments quietly break. A lawyer owes every client a duty of confidentiality (ABA Model Rule 1.6), the firm must screen lawyers off matters that create conflicts (Rule 1.10), and privileged and work-product material has to stay protected. An AI assistant that retrieves across every matter in one index knows about none of those obligations.

Ethical walls are the defining challenge. In a traditional stack, the document management system and network segmentation keep a screened lawyer out of a walled matter. Pool those same documents into one shared vector index for RAG, and you have built a new path straight around the wall. Semantic similarity and authorization are unrelated: the model returns the closest matching chunks, not the chunks the requesting lawyer is cleared to see. Metadata filters do not save you either, because a missing or mislabeled tag defaults to open access, which is the opposite of what an ethical wall demands.

Ethical walls as deny-by-default

Gateco enforces authorization at the retrieval layer, and its deny-by-default model maps directly onto an ethical wall: if no policy grants access, no content is returned. For a firm-wide wall, ABAC policies match on resource.domain (the matter or client identifier) and principal.groups (the deal team, practice group, or screening list synced from your identity provider). No match means no chunk is released. Where access is defined by a direct relationship, such as a lawyer assigned to a specific matter resource, relationship-based policies check that link at query time using relation.owner_of or a named relation you define. Screening a lateral hire off a conflicted matter becomes a single deny policy or a group change: applied once, enforced on every retrieval, by every tool, from that moment on.

Privilege and work-product as classification

Not every wall is about who is asking; some are about what is being returned. Gateco's four-level classification (public, internal, confidential, restricted) maps cleanly to legal sensitivity: public filings, internal know-how, confidential client material, and restricted privileged or work-product content. A policy can cap what an AI assistant returns at a classification ceiling, so a matter-intake bot never surfaces privileged strategy memos even when they are the most semantically relevant result. The classification suggestion engine can scan an existing matter store and propose levels, turning weeks of manual labeling into a review-and-approve pass.

The audit trail is where this pays off under scrutiny. When a client, opposing counsel, or a bar inquiry asks whether the wall actually held, you need evidence, not just a policy document. Gateco records every retrieval decision across 50+ event types with the full policy evaluation trace: which lawyer asked, which matter and documents were in scope, which policies fired, and what was allowed or denied and why. A question that would otherwise trigger weeks of forensic reconstruction becomes a single filtered query over the log.

For firms evaluating the approach: the free tier lets you validate deny-by-default against your existing vector database before committing. Team adds the ABAC and relationship-based policies that ethical walls require. Growth adds audit export and SSO, so the evidence trail and identity integration match how the firm already operates. Enterprise adds SIEM streaming for real-time monitoring. Gateco does not make a deployment ethically compliant on its own; that judgment stays with the firm. What it provides is the enforcement point that makes an ethical wall hold inside an AI pipeline, and the record that proves it did.


Ready to secure your AI retrieval?

Start with the free tier: 100 retrievals/month, no credit card required.