# How we do first-pass contract review

A new contract in a Drive folder triggers an agent to summarize it, flag non-standard clauses against our playbook, and post the summary to the legal channel, drafting redlines for a lawyer to sign off.

Canonical page: https://openchatly.com/use-cases/contract-review

Contracts arrive faster than they can be read closely. A vendor agreement, an
NDA, or an order form lands in a shared Drive folder, and someone on the legal
team has to open it, read it against what we consider standard, flag the clauses
that deviate, and summarize it for whoever's driving the deal. The first pass is
mechanical but time-consuming, and it's the step that stands between a contract
arriving and a lawyer being able to focus on what actually matters in it.

We handle this by tying the first pass to the event that starts it: a new file in
the folder. This writes up how we run that on Kortix — the connections, the
steps, and the guardrails — so you can set up the same review.

- **Team:** Kortix
- **Trigger:** A new contract in a Drive folder
- **Connected systems:** Google Drive · Slack
- **Mode:** Trigger-driven · Lawyer-gated

## The problem

The common approaches each fall short. A shared inbox where contracts pile up
means the first pass waits on whoever has time. A generic AI summarizer produces
a readout that doesn't know our positions, so it flags nothing that matters to
us. And skipping the first pass entirely puts a lawyer straight into a full read
of every contract, including the routine ones.

We wanted each contract summarized and checked against our own playbook the
moment it lands, with the summary where the team works and the redlines left for
a lawyer to sign off.

## What we built

On Kortix, a new contract in a Drive folder triggers an agent. Each contract runs
in its own isolated session — a cloud sandbox — with scoped access to Drive and
Slack. The agent reads the contract, summarizes it, flags clauses that deviate
from our playbook, and posts the summary to the legal channel. It drafts redlines
on the non-standard clauses, but a lawyer signs off before anything goes back to
the counterparty.

## How it works

### Copy the setup prompt into a new session

Open your Kortix workspace, start a new session, paste this prompt and send it.
The agent writes the agent file, the contract playbook skill and the trigger,
and opens a change request for you to review. Prefer clicks? Choose **Use this
template** instead.

**Setup prompt**

```
Set up a contract review agent in this workspace.

1. Create the agent agents/contract-review.md. Its job is to give each new contract a first-pass review. It may use the Google Drive, Google Docs and Slack connectors.

2. Create the skill skills/contract-playbook/SKILL.md with these rules:
   - A contract in Legal/Contracts is new when #legal has no summary post for it. Never review a contract twice.
   - Read the whole contract in Google Docs before you summarize or flag anything.
   - Flag a liability cap above 12 months of fees, one-sided or uncapped indemnification, termination notice over 90 days, auto-renewal with under 30 days notice, and payment terms of Net 60 or longer.
   - If the playbook has no position on a clause, say so. Never invent one.
   - Draft each redline as a suggested edit in the contract doc. Never apply it and never send it to the counterparty.
   - Post one summary to #legal: what the contract is, who it is with, the term, each flag with its section, and links to the redlines.

3. Add a cron trigger contract-review-check to kortix.yaml. It runs the contract-review agent every 15 minutes with the prompt "Load the contract-playbook skill and review every new contract in Legal/Contracts."

4. Tell me which of these connectors are not connected yet.

5. Open a change request with all of it. Do not merge it.
```

### Connect your tools

Open **Connectors** in your workspace and connect the place your contracts live,
your document editor and Slack. Credentials are brokered server-side and never enter the agent's machine.

- **Google Drive** (Required):
Reads new contracts and adds redlines as suggested edits.
- **DocuSign** (Optional):
Pulls contracts that arrive through signing envelopes.
- **Slack** (Required):
Posts each summary with the flagged clauses and links.

### Run it once with this prompt

Merge the change request, then start a session with the **contract-review** agent
and send this prompt. Check its flags and redlines against your
playbook before you let the schedule take over.

**Prompt**

```
Review the oldest unreviewed contract in Legal/Contracts.

1. List the files in Legal/Contracts and skip any that already have a summary in #legal.
2. Read the contract in full. Note its type, the parties, the term and the value.
3. Check every clause against the contract-playbook skill. Note each deviation with its section number.
4. Draft a redline for each flagged clause as a suggested edit in the doc. Do not apply it.
5. Post the summary to #legal, marked as waiting for a lawyer.
```

### Let the 15-minute schedule take over

The change request added this trigger to `kortix.yaml`. From now on the agent
checks the folder every 15 minutes, each run in a new session on its own cloud
computer.
To change the time, edit the cron line, or open **Triggers** in the workspace.

**kortix.yaml**

```yaml
triggers:
  - slug: contract-review-check
    name: Contract review check
    on:
      cron: "0 */15 * * * *"
    run:
      agent: contract-review
      prompt: Load the contract-playbook skill and review every new contract in Legal/Contracts.
```

### Hold every redline for a lawyer

Redlines land as suggested edits in the contract doc, never as direct edits.
The agent never sends a redline and never messages the counterparty. A lawyer
reads the flags in #legal and decides what goes back.

### Read the summary

Each new contract ends as one message in #legal. This is what a run looks like
in the session:

> **Contract review check · 10:15**
>
> Prompt: Load the contract-playbook skill and review every new contract in Legal/Contracts.
>
> Reviewed **1** new vendor agreement with a **24-month** term. Flagged **3**
> clauses: uncapped liability in §9.2, **Net 60** payment terms in §4.1 and
> auto-renewal with 15 days notice in §12. Drafted **3** redlines as suggested
> edits, and all of them wait for a lawyer.

> **The pattern**
> Connect the Drive folder via a **trigger**, give the agent scoped
> **connectors** into Drive and Slack, encode the contract playbook as **skills**
> and **memory**, and gate every redline behind a lawyer.

## Make it do more

Once it works, paste any of these into the same session.

**Flag missing data terms**

```
Add a rule to the contract-playbook skill: flag any contract that covers personal data but has no data processing agreement attached.
```

**Weekly renewal digest**

```
Every Monday, post to #legal the contracts in Legal/Contracts that renew or end in the next 60 days, with each notice deadline.
```

**Compare with the last version**

```
When a contract has an earlier version in the same folder, list only the clauses that changed since that version in the summary.
```

## Guardrails

Giving an agent a first pass on contracts is a trust question. The relevant
controls on Kortix:

- **Isolation.** Every contract runs in its own isolated sandbox on its own
  branch. The session is granted access only to what it's scoped to, and only the summary
  and drafts it produces are written back out.
- **Scoped secrets.** Each credential is encrypted in the secrets manager,
  injected into the sandbox at runtime, and scoped to the agents you grant them to or the
  logs.
- **Human approval gate.** Redlines are drafted, never sent; a lawyer reviews and
  signs off before anything reaches the counterparty.
- **Everything is code.** The agent's persona, skills, and permissions are files
  in the repo — versioned and changed through a reviewed **change request**, not
  a dashboard setting.

## The outcome

- **Every contract:** Summarized and checked against the playbook on arrival
- **Lawyer-gated:** Redlines drafted, never sent without sign-off
- **2 systems:** Drive and Slack — one agent

The first pass that used to wait on whoever had time now arrives as a summary and
a set of playbook-checked flags the moment a contract lands, with draft redlines
attached. The lawyer starts from the flags instead of a cold read, and routine
contracts stop consuming the time the tricky ones deserve.
