Docs/Recipes/Auto-redline contracts

Auto-redline contracts.

A workflow that catches risky clauses before they reach a lawyer. The assistant compares the incoming contract against your playbook, flags deviations, and writes a redline doc ready for review. Saves 6 to 14 days of legal turnaround.

Preconditions

  1. A playbook doc in wrxstack with your preferred positions (auto-renewal off, MFN out, governing law NY, etc.).
  2. A folder where new vendor contracts land (Documents in wrxstack, or an inbox you forward to a wrxstack ingestion address).
  3. The redline assistant, which ships in every workspace.

The workflow

[workflow]
name = "auto-redline"

[trigger]
event  = "document.created"
filter = "document.labels.includes('vendor-msa')"

[scope]
read  = ["documents", "contracts:playbook"]
write = ["documents.create", "tasks.create", "slack.post_message"]

[[steps]]
name      = "redline"
assistant = "redline"
input     = {
  document_id = "$trigger.document.id",
  playbook    = "doc_playbook_default",
}

[[steps]]
name = "open_task"
tool = "tasks.create"
input = {
  title    = "Review redline: $trigger.document.title",
  assignee = "legal-on-call@acme.com",
  labels   = ["legal", "redline"],
  about    = ["$steps.redline.redline_doc_id"],
}

[[steps]]
name = "notify"
tool = "slack.post_message"
input = {
  channel = "#legal-queue",
  text    = "🟧 New redline ready, $steps.redline.flag_count clauses flagged: $steps.redline.redline_doc_url",
}

What legal sees

The redline doc has three sections: Summary (clauses flagged, risk level), Side-by-side (vendor text vs. playbook position vs. proposed redline), and Open questions (places the assistant wasn't confident). The structure is consistent so legal reviewers can scroll the same way every time.

Safety rails

Two guards:

  1. The assistant never sends a redline directly to the vendor. The handoff is always to a human task.
  2. Any clause flagged "high risk" automatically requires sign-off from a named role (set in the [approvals] block) before the task can close.

See Safety & approvals for the full pattern.

Audit and feedback

Reviewers can mark each flagged clause as "agreed" or "disagreed" with a one-line reason. Disagreements feed back into the playbook tuning loop weekly. After about a quarter, the disagreement rate usually drops below 5%.