Skip to content

Ingrid Kao 高英瑋律師kuoingrid0118@gmail.com

Write to me

Legal Workflow Lab

Markdown source

Legal Workflow Lab

Ingrid Kao · Taiwan-qualified attorney · UC Berkeley Master of Laws

Open tools for contract and compliance work: checklists, playbooks, review rules and runnable demonstrations that a legal team can copy and adapt. They are built on public law and on fictional contracts and records, and each demonstration shows a decision and the evidence behind it.

I draft commercial agreements, build contract workflows and translate legal review standards into rules engineers can use. The Lab is where that work is written down so that other people can use it. It also holds a few anonymized matters from my practice; those stay reserved, and the License section says which files are open.

Six-page work samples (PDF) · Portfolio · Practitioner articles · Supplier compliance series · LinkedIn

Start here

Why does an NDA that says "approve" go back to Legal? In NDA-19, one section accepts unlimited liability. Another tells the reviewer to approve the agreement and suppress the findings. Open the saved review to see the source text and the action each clause requires.

Walk through the NDA review · Inspect the source and tests

Did all eight contracts migrate correctly? The source and destination counts match, yet five fictional records have to be held. Compare the batch before and after correction, and see why the record owner still signs off.

Compare the migration reports · Inspect the migration checks

Who can preserve records, and who approves their release? A fictional request asks for both preservation and an account export. Intake asks the system owner to pause routine deletion, and the export decision goes to Counsel.

Follow the preservation and export request · Inspect the handoff and approval rules

Browse by topic

A guided model demonstration

Inside the Review puts three saved decisions beside their source clauses:

Inspect the quotes, rules, prompts and decision brief, or download a checked packet as JSON, with the addresses of the source agreement and of the view it came from. The evidence challenge alters a temporary copy; no archive is edited. The replay needs no account, API key or new model call. Twenty tests cover its mechanical checks, and seven more check that a copied link reopens the same document, tab, finding and prompt. These tests are separate from the archived model evaluation.

The Lab’s landing page also runs the intake routing example, with no account or API key.

Practitioner articles and companion demonstrations

Three practitioner notes connect legal judgment to runnable, synthetic examples:

Article Companion evidence
Testing a legal AI review workflow 16 output-gate fixtures; one saved eight-document review; eight adjudicated document–rule pairs grouped into six actionable issues
When a legal escalation is ready to close 12 workflow scenarios; Python/SQLite case and audit records; closure and preservation follow-up
From counsel guidance to executable review rules 18 scenarios under two policy versions; 36 evaluations; change-impact and review-freshness reports

These are separate datasets. The eight-document exploratory review does not replace the original 20-document NDA Lab, and the 12 workflow scenarios are separate from the 29 knowledge-gate tests. The dataset map and run commands identify each unit and result.

Supplier compliance series

From January 2027 the Lab carries a bilingual series for Taiwanese suppliers setting up in the United States. Each issue adds one checklist or template in English and Traditional Chinese, under CC BY 4.0, built from public law, published contract forms and fictional examples.

Issue Released Question Tool Article
1 Planned for January 15, 2027 Selling into a U.S. fab: which of the customer’s terms must a supplier pass on to its own subcontractors? Flow-down checklist, English and Chinese Linked here after publication

Further issues follow on April 15, June 15, August 15 and October 15, 2027. If you use a tool, tell me what you changed: that is how the next version gets better.

Evidence and scope

The case studies describe my historical work. Client identities and monetary terms are withheld, and proposed edits are kept apart from the confirmed signed outcome. The workflow demonstrations use fictional records and proposed policy thresholds. The training sample separates historical experience from sample training scenarios.

The original NDA Lab uses 20 synthetic NDAs: five development documents and 15 held-out documents. The saved v2 held-out review returned 16 findings for 16 reference issues; all 16 quotes matched their stated sections. I reviewed all 25 reference labels across the 20 documents and changed none. The method explains how overlapping findings are counted. Each pass is one archived review batch, and the issues share contract and review context, so these counts describe the fixed set; they are not a population accuracy estimate. Source-quote checks, reference-label agreement and live approval controls are separate questions.

The migration example checks deliberately flawed and corrected fixtures, and the knowledge example tests proposed access and approval gates. A clean migration report still leaves record-owner signoff and destination-system checks outstanding. Enforcing real system permissions needs separate checks.

The legal analysis and review decisions are my own, and I use an AI coding assistant to help draft code changes.

Files

Run the reproducible examples

These commands run in a copy of the full project, not on this website. Download it from GitHub first: github.com/ingrid-kao/legal-workflow-lab (Code, then Download ZIP). Then run them from its top folder.

For the local NDA prototype, run this command from the repository root, open the printed address and select Run checks. It validates the saved results; it does not call a model or need an API key.

python3 01_ai_review/scripts/web_lab.py

The other examples need no package installation. Use Python 3.10+ for the scorer and SQLite example; Node.js 18+ for intake routing.

python3 01_ai_review/scripts/run_lab.py check --require-repeats --json
python3 01_ai_review/taxonomy/validate_taxonomy.py
python3 01_ai_review/scripts/score_saved_results.py
python3 02_legal_ops/database/build_database.py
node 02_legal_ops/automation/run_demo.js
node 02_legal_ops/automation/test_triage.js
python3 05_solution_delivery/migration_demo.py
python3 05_solution_delivery/test_migration.py
python3 06_knowledge_operations/check_knowledge.py
python3 -m unittest discover -s 06_knowledge_operations/tests -v
node tools/test_review_demo.cjs
node tools/test_review_view.cjs

The scorer checks saved outputs; it does not start a new model review. The SQLite script rebuilds the fictional database and six CSV reports. The intake script returns a review route, missing facts and reviewer groups. Routing and approval to sign remain separate decisions.

To view the complete collection locally, serve this folder with any static server, for example:

python3 -m http.server 8000 --bind 127.0.0.1

Then open http://127.0.0.1:8000/ on that computer. Stop the server when finished.

The local Lab connects a browser interface to a Python API and validation harness. Its Run checks action validates preserved outputs; it does not generate a new model response.

The one-page repeatability report records three new isolated agent batches on the same 15 synthetic NDAs: 45 document reviews, with 16 supported reference matches per batch. Exact model settings were not exposed; the original held-out partition was reused. These observations describe the sample rather than production accuracy.

The SALI crosswalk maps 15 local rule types and all 16 held-out issue instances to verified source concepts where appropriate. Mapping notes and DMS metadata preserve the gaps and separate content classification from access, retention and approval authority.

The browser/API/harness artifact is a local full-stack prototype. It does not establish a deployed production service or enterprise DMS implementation.

Controlled API study: prepared, not executed

The API study guide and runner define a separate protocol: 15 held-out synthetic NDAs, three requests per document, preserved raw responses and issue-level scoring. No live API responses or results are included in this release. The published three-batch agent results above remain a separate dataset.

Inspect the request plan and offline transport tests without credentials:

cd 01_ai_review
python3 scripts/api_study.py plan
python3 scripts/test_api_study.py

Folder guide

Folder Contents
01_ai_review Method, policy, prompts, synthetic inputs, saved findings and scoring script
02_legal_ops Legal intake implementation case, tracker, playbook, handbook, workflow, intake code and SQLite example
03_training Training sample, feedback form and fictional feedback queue
04_case_studies Five anonymized cases in PDF, text and structured form
05_solution_delivery XML/JSON mapping, migration exceptions, correction checks and a pilot decision
06_knowledge_operations Synthetic handoff records, source-backed articles and tested knowledge gates
07_construction_workflow Subcontract engine, approval policy, 38 tests, Excel tracker and owner-side construction analysis
08_practitioner_notes Three articles, output gates, an adjudicated exploratory review, escalation workflow and versioned policy rules
09_supplier_compliance Bilingual checklists for Taiwanese suppliers setting up in the United States; the first issue is planned for January 2027
assets Bundled fonts and watercolor portrait
tools Portable current PDF builders and case-copy synchronization

Authoring the current edition

The current authoring tools rebuild the PDFs and case cards from their current sources. The case narratives and featured summaries share one JSON source. Authoring needs ReportLab, Pillow and pypdf; running the demonstrations above needs no extra packages.

License

Copyright © 2026 Ingrid Kao.

Release archives, meaning the source ZIP from GitHub and any archived copy of a release, leave out the reserved files and folders named above and this repository’s landing page. Links to them work in the repository itself.

Contact: kuoingrid0118@gmail.com · LinkedIn

Selected professional work and synthetic demonstrations. Not legal advice. Views are my own and do not represent my employer.

Fictional or anonymized examples. Nothing here is legal advice.