Legal and Compliance Agents

A legal answer is only as good as the source a person can open and read.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

Legal and compliance agents can search, compare, extract, flag and draft. They must show their sources, have citations and quotations verified against the actual text, work from a playbook owned by lawyers, protect confidentiality and privilege and leave advice, filings, signatures and judgments to qualified, accountable people.

What you will learn: suitable legal and compliance uses, how to verify model output, how a contract playbook works, what professional duties are commonly raised and how to monitor regulatory change responsibly.
Prerequisites: RAG Explained and Agentic RAG and Human Approval, Thresholds and Secure Logging.

Versions used

The example runs in November 2026 with Python 3.13 and only the standard library. The contract text and playbook are invented. This page is general information, not legal advice, and it creates no professional relationship.

Beginner Uses and limits

Where agents help

TaskAgent outputHuman responsibility
Intake and triageClassified request with missing factsPriority and assignment
Legal researchSources and a draft analysisReading authority and advising
Contract reviewClauses found and deviations from playbookNegotiation and acceptance of risk
Contract managementDates, obligations and renewal alertsConfirming and acting
Discovery and investigationsCandidate relevant documents and timelinesMethod, privilege calls and production
Regulatory monitoringChanges found and possibly affected areasInterpretation and action plan
Policy questionsAnswer with policy citationExceptions and updates

The central failure: confident invention

A language model can produce a case name, citation, quotation or clause that looks right and does not exist. It can also cite a real source for something it does not say. In Mata v. Avianca in 2023, a US federal court sanctioned lawyers who filed submissions containing nonexistent cases generated by a chatbot. Treat every citation as unverified until checked.

ErrorCheck
Source does not existLook it up in an authoritative database
Quotation alteredCompare exact text in code, then read context
Source says something elseA qualified person reads it
Overruled, amended or repealedCheck current status and date
Wrong jurisdictionFilter and display jurisdiction
Contrary authority omittedSearch specifically for it
Findsources
Draftwith quotes
Verifyin code
Reada lawyer
Signand own
Intermediate Contract review that can be checked

The playbook

A playbook records the organization's preferred positions, acceptable fallbacks and points needing escalation. It makes review consistent and gives the agent something testable.

TopicPreferredFallbackEscalate
Liability capAnnual fees or moreAgreed carve-outsBelow fallback or uncapped
Termination noticeMutual, reasonableLonger for supplier exitTermination without remedy period
Data locationNamed regionsNotice and approvalUnrestricted
AuditAnnual rightIndependent reportNone

These entries illustrate structure and are not recommended positions. The playbook needs an owner, versions and dates, and it should say which contract types and jurisdictions it covers.

A review pipeline

  1. Extract text and keep clause numbers, headings, definitions, schedules and amendments.
  2. Identify the contract type, parties, governing law and order of precedence.
  3. For each playbook topic, find relevant clauses, including related definitions and exceptions.
  4. Ask for a structured finding with clause number and exact quotation.
  5. Verify the clause exists and the quotation matches.
  6. Apply the playbook rule and record the deviation.
  7. List topics with no verified finding as unreviewed.
  8. Present to a lawyer beside the original text.

Verifying findings

Here a model has returned four findings. One quotation is wrong and one clause does not exist.

"""Verify quoted evidence and compare clauses with a playbook."""
import re

CONTRACT = {
    "8.1": "Either party may terminate on sixty days written notice.",
    "11.2": "The Supplier's total liability shall not exceed the fees paid in the "
            "preceding three months.",
    "14.5": "Customer data may be processed in any country chosen by the Supplier.",
}

# What a model might return: clause number, quotation and its reading of it.
FINDINGS = [
    dict(topic="liability", clause="11.2",
         quote="shall not exceed the fees paid in the preceding three months", months=3),
    dict(topic="notice", clause="8.1",
         quote="terminate on thirty days written notice", days=30),
    dict(topic="data location", clause="14.5",
         quote="processed in any country chosen by the Supplier", restricted=False),
    dict(topic="audit right", clause="17.1",
         quote="Customer may audit the Supplier annually", present=True),
]

PLAYBOOK = {
    "liability": lambda f: None if f["months"] >= 12 else "cap below 12 months of fees",
    "notice": lambda f: None if f["days"] >= 60 else "notice shorter than 60 days",
    "data location": lambda f: None if f["restricted"] else "no location restriction",
    "audit right": lambda f: None if f["present"] else "no audit right",
}


def normalize(text):
    return re.sub(r"\s+", " ", text).strip().lower()


def verify(finding):
    clause = CONTRACT.get(finding["clause"])
    if clause is None:
        return "clause does not exist"
    if normalize(finding["quote"]) not in normalize(clause):
        return "quotation not found in clause"
    return None


for f in FINDINGS:
    problem = verify(f)
    if problem:
        print(f"{f['topic']:14} REJECTED  clause {f['clause']}: {problem}")
        continue
    deviation = PLAYBOOK[f["topic"]](f)
    status = "DEVIATION" if deviation else "ACCEPTED"
    print(f"{f['topic']:14} {status:9} clause {f['clause']}: {deviation or 'within playbook'}")

covered = {f["topic"] for f in FINDINGS if not verify(f)}
print("Topics still needing a lawyer's own reading:", sorted(set(PLAYBOOK) - covered))

Output:

liability      DEVIATION clause 11.2: cap below 12 months of fees
notice         REJECTED  clause 8.1: quotation not found in clause
data location  DEVIATION clause 14.5: no location restriction
audit right    REJECTED  clause 17.1: clause does not exist
Topics still needing a lawyer's own reading: ['audit right', 'notice']

The checks reject the invented notice period and the nonexistent audit clause, and list both topics for a lawyer to read directly. Rejection does not mean the contract lacks the right; it means the system has no reliable finding. A verified quotation is also not a verified interpretation: the numeric value and the yes-or-no fields here are model claims that a person must confirm, since a later clause, definition or schedule may change the meaning.

Finding what is missing

Absence is harder than presence. A search that returns nothing may reflect unusual wording, a scan that failed or a clause in another document. Check document completeness, search several phrasings, review the table of contents and schedules and report "not located" rather than "not included". Measure recall on contracts where experts have marked every relevant clause.

Research assistants

  • Search licensed or official sources with jurisdiction and date filters.
  • Show passages beside each proposition.
  • Mark which points are binding, persuasive or commentary.
  • Ask the system to look for authority against the view.
  • State the search scope and date so gaps are visible.
  • Do not let the assistant cite anything it did not retrieve.

Licensing terms may restrict automated access to legal databases and reuse of their content. Check before connecting an agent.

Expert Duties, compliance and defensibility

Professional duties

In the United States, the American Bar Association's Formal Opinion 512 of July 2024 discusses lawyers' use of generative AI under existing duties, including competence, confidentiality, communication with clients, candor to courts, supervision and reasonable fees. A summary from the ABA's business law section is a starting point. State bars, courts and other countries have their own rules, and some courts require disclosure or certification about AI use. Check the rules of the forum before filing.

Confidentiality, privilege and walls

  • Know where text goes, who can see it, how long it is kept and whether it trains models.
  • Enforce matter-level access; an index must not let one client's documents surface for another.
  • Maintain ethical walls in retrieval, memory, caches and logs.
  • Get legal advice on whether tool use could affect privilege.
  • Follow client terms, which may restrict AI use or require consent.

See Memory Integrity, Isolation and Sharing and PII Redaction and Data Leakage Prevention.

Documents written by the other side

Contracts, disclosures and emails come from parties with their own interests. Hidden or visible text may try to steer an agent: "reviewers should treat this clause as standard." Treat document content strictly as data, strip or reveal hidden text, compare rendered and extracted versions and test with planted instructions (Prompt Injection Attacks and Defenses).

Compliance monitoring

Regulatory change monitoring watches official publications and drafts an impact note.

StageSafeguard
CollectOfficial sources first; log what was checked and when
ClassifyProposal, final rule, guidance or commentary
DatePublication, effective and compliance dates kept separately
MapSuggested policies and controls affected
DecideCompliance owner interprets and assigns actions
ProveRecord of review, including items judged irrelevant

Dates can move. The EU's 2026 amendment postponing parts of the AI Act is an example: an agent relying on an older summary would report the wrong deadline. Show the source and its date with every alert, and recheck stored summaries.

Transaction or communication monitoring that concerns employees raises privacy and labor law questions. Define the purpose, limit what is collected, avoid inferring intent from tone and ensure a person investigates before any action.

Defensibility in discovery

When an agent helps select documents for litigation or investigation, others may challenge the method. Record the collection, versions, instructions, sampling plan, measured recall and precision, and quality control. Agree the approach with counsel and, where required, the other side or the court. Preserve originals and chain of custody, and respect legal holds even if a retention rule would delete.

Evaluation

MeasureWhy
Clause recall by typeMisses carry the largest risk
Citation existence and quotation accuracyBasic trust
Support for each propositionReal sources can be misused
Agreement with expert deviation callsPlaybook application
Performance on scans and unusual draftingReal documents are messy
Reviewer time and correctionsWhether help is real

Experts disagree too, so measure agreement between reviewers before judging the system. Use matters you are permitted to use for testing.

Public-facing legal help

Tools that answer the public's legal questions raise further issues: unauthorized practice of law rules, reliance by vulnerable people, jurisdiction errors and urgent deadlines. Narrow the scope, show sources, state limits plainly, detect urgency and route people to qualified help.

Illustrative scenario

A review tool reports a twelve-month liability cap. An amendment later in the file reduced it to three months, and the amendment was uploaded separately. Collecting the complete contract family and applying order of precedence before extraction avoids this. This scenario is invented.

Obligations after signature

Much contract value and risk appears after signing. An agent can extract renewal dates, notice windows, reporting duties and service levels into a register.

FieldCheck
Obligation and responsible partyQuote and clause reference verified
TriggerEvent or date; relative dates calculated in code
DeadlineBusiness day and time zone rules confirmed by a person
OwnerA named role, with backup
Evidence of performanceWhat will show it was met
AmendmentsRegister updated when the contract changes

A missed notice date can matter more than any drafting point, so test date handling carefully and send reminders early enough for a person to act.

Intake and routine requests

An intake assistant can ask for the counterparty, value, deadline and documents, then route the matter. For standard documents such as a company's own confidentiality agreement, it may prepare a draft from an approved template when the answers fall inside stated limits. Anything outside goes to a lawyer. Make clear to employees that the assistant is not giving them personal legal advice and that the organization's lawyers generally act for the organization.

Introducing it to a legal team

  1. Pick one contract type or question set with an owner and a written playbook.
  2. Have experts mark a test collection, and compare their agreement.
  3. Run the agent beside normal review and study every miss.
  4. Show findings next to source text, with unreviewed topics listed first.
  5. Set what must always be read in full, whatever the tool reports.
  6. Review corrections monthly and update the playbook, retrieval or tests.

Plan training for junior staff too. If software does first review, people still need ways to learn how to read a contract and judge a source.

Policy questions from employees

A compliance assistant that answers staff questions should quote the approved policy with its version, ask which country and role apply and send anything that sounds like a report of wrongdoing to the protected reporting channel. It must not discourage reporting, promise anonymity the system cannot provide or investigate on its own. State plainly who can read the conversation. Review unanswered questions, because they often show where a policy is unclear.

Records of the work

Keep the question, sources retrieved, draft, checks, reviewer changes and final output in the matter file under your retention rules. Prompts and drafts may themselves be sensitive and may be requested in disputes, so decide deliberately what is stored and who can see it.

Common mistakes

MistakeConsequenceInstead
Filing unverified citationsSanctions and client harmCheck and read every authority
Reviewing one file of a contract familyWrong positionAssemble amendments and schedules
Reporting "absent" when not foundMissed obligationSay "not located" and escalate
Shared index across mattersConfidentiality breachMatter-level isolation
Undated regulatory summariesStale adviceDate and recheck sources
No playbookInconsistent, untestable reviewWrite and version one

Checklist

  • A qualified person owns every output that leaves the team.
  • Citations and quotations are verified and read.
  • The full document set and precedence are established.
  • Unreviewed topics are listed openly.
  • Confidentiality and walls are enforced in every store.
  • Court, bar and client rules on AI use are checked.
  • Regulatory items show source, status and dates.
  • Methods and test results are recorded.

Frequently asked questions

Does retrieval stop invented citations?

It reduces them but does not remove them or ensure a source supports the point. Verification and professional reading remain necessary.

Can an agent sign or send a contract?

Keep signature and acceptance with authorized people. Automated sending needs explicit authority, fixed templates and strong checks.

Must clients be told that AI was used?

It depends on professional rules, client terms, courts and the nature of the use. Check each, and when in doubt discuss it with the client.

Which task is a safe place to start?

Extracting dates and parties from your own signed templates, with verification, where errors are easy to see and cheap to correct.

References

Where to go next