Engineering
How we structure matter-scoped AI context
Priya Nair11 min read
Engineering
Priya Nair11 min read

Agent mode runs inside the active matter boundary.
Screenshot: Largence
Legal AI fails when context leaks, a draft that cites the wrong precedent, or a summary that blends two clients’ facts. Every Largence AI surface inherits the active matter’s ACL: documents, messages, and templates the user may already access. Regulators on both sides of our markets, ICO and NITDA, expect purpose limitation; matter scope is how we operationalise it.
Custo agent mode scoped to a single matter workspace.
Photo: Unsplash
type MatterContext = {
matterId: string;
documentIds: string[];
templatePackId?: string;
jurisdiction: 'NG' | 'UK';
};
async function buildCustoContext(matterId: string): Promise<MatterContext> {
const acl = await resolveMatterAcl(matterId);
return {
matterId,
documentIds: acl.readableDocuments,
templatePackId: acl.activeTemplatePack,
jurisdiction: acl.jurisdiction,
};
}Agents extend the same envelope. An automation cannot attach to a channel or document the initiating user could not open manually. That constraint is enforced server-side, not prompt-side.
Governance belongs in the platform layer, not in the hope that the model behaves.
Information Commissioner's Office