Building with AI

How Legora builds legal AI agents without seeing client data

Legora's CTO Jacob Lauritzen explains how the company evaluates agents, routes models, and structures engineering teams to handle confidential legal work at scale.

Legal documents connected by digital lines to a secure server
Illustration generated for this article

Jacob Lauritzen, CTO of Legora, recently shared technical insights on building agentic workflows for the legal sector following the company’s $8.8 billion valuation. In a discussion with Latent Space, he detailed how his team constructs reliable AI systems for document-heavy domains while strictly adhering to privacy constraints that prevent direct access to customer data.

What happened

Legora has grown rapidly since its inception in a Stockholm basement, evolving from a simple search tool into a comprehensive platform that drafts documents and reviews contracts. The company raised $550 million in March at a $5.55 billion valuation and secured another $550 million in October, reaching an $8.8 billion valuation. With over 1,800 customers and more than $100 million in annual recurring revenue as of April, the platform now coordinates work between lawyers, clients, and autonomous agents.

The business model shift driving this adoption is significant. While lawyers traditionally bill by the hour, creating a disincentive for efficiency tools, market pressure is moving routine work toward flat project fees. This change allows firms to leverage AI for speed without losing revenue, shifting high-value human effort toward complex litigation and client relationships. Contrary to fears that AI would replace junior staff, Lauritzen notes that skilled junior lawyers are now more valuable because they can accomplish significantly more work using these tools.

How it works

Evaluating AI agents in legal tech presents a unique challenge: the data is confidential. Legora cannot read user traces or client files to improve its models. Instead, the company employs three engineers and three lawyers to build reinforcement learning environments that simulate real-world legal tasks. For example, they create synthetic data rooms with thousands of files where agents must perform due diligence and identify specific red flags. Results are mapped on heat maps by practice area to detect performance shifts when new models are introduced.

To manage model selection, Legora uses an internal routing system rather than asking users to choose. The system balances quality, cost, latency, and governance requirements automatically. While simpler tasks use cheaper, faster models, complex analysis across million-token contexts still requires more capable intelligence. The company also post-trains open-weight models for narrow tasks like legal research but avoids training frontier models. To combat hallucinations, every output includes citations linking to specific bounding boxes in source PDFs.

Key details

  • Legora runs entirely on Azure because law firms had already approved Microsoft as a vendor through Office 365, while AWS and GCP were often restricted.
  • The engineering team distinguishes between legal engineers, who configure products without code, and forward deployed engineers, who write production code for integrations.
  • Core product primitives include projects, agents, Tabular Review for bulk document analysis, and lists that trigger automations.
  • Failure modes in production are classified into 10 to 20 known categories, with cheap LLM-based checks running behind feature flags.
  • The company maintains a pool of about 100 legal engineers, typically lawyers with computer science degrees, to help simulate work and evaluate agents.
  • Tabular Review allows users to analyze up to one million cells, starting with small batches to refine prompts before scaling.

Why it matters

For developers building agents in regulated industries, Legora’s approach demonstrates that you do not need access to live customer data to improve performance. By investing heavily in synthetic evaluation environments and simulation, teams can iterate safely. This method is crucial for sectors like healthcare or finance, where privacy laws prohibit direct model training on user inputs. It also highlights the importance of domain-specific expertise in the evaluation loop, blending legal knowledge with engineering rigor.

The infrastructure choices also reveal practical constraints in enterprise sales. Choosing Azure was not a technical preference but a compliance necessity, showing that vendor approval status can dictate architecture early on. Furthermore, the separation of configuration from code allows non-engineers to ship new features. This structure enables rapid customization for large clients without bloating the core engineering team, a strategy that scales better than traditional professional services models.

What you can do

  • Build synthetic evaluation datasets that mimic your most complex user workflows instead of relying on live data traces.
  • Implement automatic model routing to balance cost and quality, removing the decision burden from end users.
  • Separate your engineering roles into core product builders and deployment specialists who handle client-specific integrations.
  • Design your product around flexible primitives like lists and tables that can be reconfigured for different use cases without new code.
  • Ensure every AI-generated output includes verifiable citations or links to source material to build user trust.
  • Choose cloud providers based on existing enterprise approvals in your target industry, not just technical merit.
  • #legal-tech
  • #ai-agents
  • #evaluation
  • #enterprise-ai
  • #data-privacy

Tools from the Bytechap store

Keep reading

All stories