The LegalWork Atlas LegalWork's documentation, bound to the code it describes
17 documents

The legal-document engine

LegalWork's actual legal work is defined as firm-owned agent prompts, not app code. This path walks the two flagship workflows — Word redlining and tabular review — from the user command down to the read-only subagents that do the work.

The edit plan

apply takes a plan that maps directly onto the engine's batch API. Anchor every edit by the index from inspect (the same index works for body paragraphs and table cells) and a verbatim search copied exactly from that paragraph's text:

{
  "author": "Eigenwelt Reviewer",
  "comments":  [ { "paragraphIndex": 181, "text": "Cap is low for this deal — propose €75k.", "search": "EUR 55,000.00" } ],
  "proposals": [ { "paragraphIndex": 181, "search": "EUR 55,000.00", "replaceWith": "EUR 75,000.00" } ]
}
  • comments are margin notes (the why); they don't change text. search optional.
  • proposals are tracked-change edits. replaceWith:"" deletes; search:"" inserts at the end of the paragraph; both non-empty is a replacement.
  • search must be VERBATIM (an exact substring of that paragraph) or the op is dropped and listed in errors. This is also the safety net: a wrong index can't quietly edit the wrong clause — the search won't match, so it errors instead.