Confidentiality and Privilege Leakage Testing for Legal AI
Test your legal copilot, contract tool or client chatbot for cross-matter leakage, privilege exposure, prompt injection hidden in documents and weak access controls, with evidence and fixes.
- Capability:
- AI Security & Compliance
- Industry:
- Legal
Who it is for
- Chief Information Security Officer (Law Firm)
- Head of Knowledge and Innovation
- General Counsel
- IT Director (Legal)
The problem
Firms and legal departments are connecting AI copilots to document management systems, matter workspaces and data rooms. The features that make them useful, retrieval across documents and memory of past work, can expose one client's information to another matter team, reveal privileged advice, or follow instructions a counterparty has planted inside a document.
Ethical walls not enforced
Retrieval layers sometimes index content without carrying over matter permissions, so a user can see material from a walled-off matter.
Instructions hidden in documents
A counterparty draft or data room file can contain text that tells the AI to downplay a risk or reveal other content.
Privileged content in logs and vendors
Prompts, outputs and telemetry may store privileged material with a vendor or in logs that wider teams can read.
Client chatbots oversharing
A client-facing assistant can be coaxed into revealing other clients' names, fees or internal guidance.
What we build
We run a confidentiality-focused security assessment of your legal AI tool. With your team we map matters, permissions and data flows, then seed canary documents into restricted test matters. Testers act as users on other matters and as external clients, trying direct questions, multi-turn social engineering, system-prompt extraction and indirect prompt injection through uploaded contracts, emails and data room files. We check whether retrieval honours matter permissions, what prompts and outputs are stored and where, and whether agent tools such as email or document export can be misused. Findings come with evidence, severity, mapping to the OWASP Top 10 for LLM Applications and fixes, followed by a re-test.
- Ethical wall testing with canary documents in restricted test matters
- Indirect prompt injection through contracts, emails and data room files
- Client-chatbot tests for disclosure of other clients' information and internal guidance
- System-prompt and configuration extraction attempts
- Review of logging, telemetry and vendor retention of prompts and outputs
- Tool-use abuse tests for email, export and document-sharing actions
How it works
- 01Map matters and data flowsWe document matter permissions, connected repositories, vendors, logs and the tools the AI can use.
- 02Seed canariesUnique canary documents are placed in restricted test matters with your IT team's approval.
- 03Run attacksTesters attempt cross-matter retrieval, injection through documents, prompt extraction and tool misuse.
- 04Check leakage pathsLogs, telemetry and vendor settings are inspected for retained privileged or client content.
- 05Confirm findingsEach suspected leak is reproduced and reviewed with your security lead.
- 06Report and re-testYou receive evidence, severity and fixes, and we re-test after remediation.
Architecture
- Scoping
- Matter and permission map
- Data flow and vendor inventory
- Rules of engagement
- Test assets
- Canary documents for restricted matters
- Injection payload library for contracts and emails
- Test user personas across matters
- Execution
- Automated prompt and retrieval test runner
- Manual multi-turn testing
- Tool-use abuse scenarios
- Analysis
- Canary detection in outputs and logs
- Reproduction and severity rating
- Reporting
- Evidence pack with transcripts
- Mapping to OWASP LLM Top 10 and NIST AI RMF
- Re-test tracker
Inputs and outputs
Inputs
- Staging or controlled production access to the AI tool
- Matter and permission structure, including ethical walls
- List of connected repositories, vendors and tools
- Test accounts across matters and roles
- Rules of engagement agreed with IT and risk
Outputs
- Findings with reproduction steps and evidence
- Severity ratings and recommended fixes
- Mapping to the OWASP Top 10 for LLM Applications and NIST AI RMF
- Review of data retention and logging
- Re-test report after remediation
Where people stay in control
Your security lead and our tester confirm each finding together before it is reported, and your risk and IT leadership decide on remediation and go-live. No real client documents are used as test material.
Integrations
- Legal AI copilot or chatbot under test
- Document management system such as iManage, NetDocuments or SharePoint
- Identity provider and matter permission system
- Logging and SIEM tools
- Issue tracker for remediation
Guardrails
- Only synthetic canary documents and test matters are used
- Testing follows written rules of engagement and agreed time windows
- Findings and evidence shared only with named contacts
- Any real client data seen during testing is reported and not retained
- Re-tests reuse the same scenarios so results are comparable
Compliance notes
- Helps you evidence the confidentiality safeguards expected under Bar Council of India rules and the protection of privilege under Indian evidence law.
- Supports DPDP Act 2023 security safeguard obligations and, for EU data, GDPR security requirements.
A typical pilot
Duration: 3 weeks
One AI tool connected to one document repository, tested across a small set of restricted test matters and user roles.
Deliverables
- 01Scoping and rules of engagement
- 02Canary and injection test assets
- 03Findings report with evidence and fixes
- 04Logging and vendor retention review
- 05One re-test after remediation
What we measure
- Confirmed findings by severity
- Count of reproduced findings by category and severity.
- Canary exposure
- Canary documents retrieved or quoted to users without matter access.
- Injection success
- Planted document instructions that changed the tool's behaviour.
- Fix verification
- Findings that no longer reproduce on re-test.
Built on related work
LLM endpoint security scanner
Security platform (anonymised)
Workflow that scans Azure-hosted and custom HTTP LLM endpoints for prompt injection, jailbreaks and data leakage.
FAQs
01Do you need access to real client files?
No. We use synthetic canary documents in test matters. If testers see real client data by accident, it is reported immediately and not retained.
02Can you test a vendor's legal AI product we have licensed?
Yes, within your licence terms and with the vendor's agreement where required. Many of the most important tests concern how the tool is connected to your systems and permissions.
03What is indirect prompt injection?
It is text inside a document, email or web page that the AI reads and treats as an instruction, such as a hidden line telling it to describe a contract as low risk. Legal tools read counterparty documents constantly, so we test this specifically.
04How often should we test?
Before launch, after major changes to models, prompts, connected repositories or permissions, and periodically after that. The test suite can be re-run to compare results over time.
Related use cases
- Legal
Contract Clause Extraction and Risk Flags
Extract key clauses, dates and obligations from executed and incoming contracts, compare them with your playbook and flag deviations, with every item linked to the clause it came from.
- Legal
Due Diligence Data Room Review
Index a virtual data room against your request list, extract issues from contracts, corporate records and licences, and draft report tables and query lists for lawyers to confirm.
- SaaS & AI Product Companies
RAG Data-Leakage and Access-Control Testing
Test whether your RAG pipeline leaks documents across users, roles or tenants through retrieval, caching, citations or logs, using seeded canary documents and role-based test personas.
- Legal
Client Intake Voice Agent
Answer inbound enquiries in Hindi and English, record facts and parties for a conflict check, spot urgent matters for an on-call advocate and book consultations, without giving legal advice.

Founded by Akhilesh Mittal. 8 years building a security platform for a New Zealand company. IIT ISM Dhanbad and IMT Ghaziabad. Builds production agentic AI.
Bring one matter type or one contract stack
Pick a workflow that hurts, such as NDA review, cause list tracking or a diligence index. We will run a short pilot on de-identified or consented documents and go through the output with your lawyers line by line.