Academy · Solutions · Agentic Workflow

Build: Contract review

In one line. A Processing collection plus one extraction agent that flags risky clauses, scores a risk band, and suggests fallback wording — a copilot for a lawyer, never the final word. You’ll build. A Contracts collection with a clause table in its schema, a clause-detection skill, a fallback-language tool, the “Contract Reviewer” agent with structured output, an advisory guard rail, and the human review loop in the document detail. You’ll use. Collections & schema, Skills & skill packs, Tools & functions, Your first agent, Guard rails, Document detail.

Someone in legal has to read every incoming NDA, MSA, or vendor agreement, hunt for the dangerous clauses — auto-renewal, uncapped liability, one-sided indemnity, missing termination rights — judge the risk, and suggest safer wording. That first-pass triage is exactly the kind of bounded reading an agent does well. Budget 60–75 minutes for a first build. Prerequisites: one LLM registered in the project (LLMs & services), and basic comfort with the agent editor and the Schema tab.

A word of honesty up front — this is a copilot, not a compliance gate. The agent flags risky clauses and suggests fallback language; a qualified human decides. In particular, the guard rail you’ll add is advisory prompt-level steering, not a hard output filter — it nudges the agent to stay in scope and tone, but the platform does not read the answer back and block it. Treat every output as a first draft for a lawyer. See Guard rails for exactly what a guard rail does and doesn’t enforce.

Six pieces: a collection (the typed home), a skill (what to look for), a tool (what to suggest), an agent (that does the reading), a guard rail (that keeps it in lane), and a review experience (where a human reads the findings). We build them in that order.

Steps

Stage 1 — The collection and its schema

A contract is something you decide about (sign / negotiate / reject), document by document — so it’s a Processing collection, not Knowledge.

  1. Go to Studio ▸ Data Model ▸ Collections. Click + Collection.
  2. Purpose: leave Processing selected. This is immutable after create — pick it deliberately.
  3. Collection Name: Contracts. Description: Incoming agreements for clause review and risk triage.
  4. Allowed Ingestion Types (optional): leave default (Upload) so you can drag in a sample NDA.
  5. Click Save. Contracts appears in the left rail — select it. You should see its tab strip: General · Schema · Lifecycle · Tags · Events · Ingestion · Agents.

The schema drives extraction — the agent fills in exactly the Labels (UI: Fields) you define, no more. We want header facts, a table of detected clauses, and an overall risk band.

  1. With Contracts selected, open the Schema tab.

  2. Click Taxonomy (footer) to create the Learner (the extractor that owns these fields): Taxonomy Name Contract Review, Description Header facts, detected risky clauses, and an overall risk band, Type DocumentClassification (whole-document field extraction), Entity Contracts (pre-filled). Submit.

  3. Select Contract Review, then + Label for each header field (use Add between them):

    Label name Description Shape — how to get it
    counterparty The other party to the agreement Plain text (default)
    contract_type NDA, MSA, SOW, vendor agreement, etc. Plain text
    effective_date The date the contract takes effect View Config ▸ Validation → date
    renewal_date Next auto-renewal / expiry date, if any View Config ▸ Validation → date
    risk_band Overall risk: Low, Medium, or High View Config ▸ Validation → allowed values Low, Medium, High
  4. Now the important one — a table field for the clauses the agent flags. Click + Label: Label Name detected_clauses, Description One row per risky clause the agent flags. Open Show Advanced Settings ▸ Record Config and turn on Is Record (this makes it a table).

  5. Add child Labels as its columns (each child = one column), then Add and exit:

    • clause_typee.g. auto-renewal, uncapped liability, one-sided indemnity (text)
    • severityLow / Medium / High (View Config ▸ Validation → allowed values)
    • excerptThe exact wording detected (text)
    • suggested_fallbackSafer language to propose (text)

If you’d rather not click the columns in one by one, build the field list in a spreadsheet (one column per nesting level) and use the Import labels tab instead — see Collections & schema. When you’re done, the Labels tree under Contract Review shows the five header fields plus detected_clauses as a table with 4 child fields.

Stage 2 — The capabilities: a skill and a tool

A Skill is a reusable playbook: a name, a “use when…” description for discovery, and a Markdown body that says how to do the job. We want one that teaches any agent how to scan a contract and surface risky clauses.

  1. Go to Studio ▸ Agent Builder ▸ Skills. On the Skills tab, click + Skill.

  2. On the Form tab: Name detect-risky-clauses (lower-kebab — this is the handle agents refer to). Description: Scan a contract and flag risky clauses (NDA scope, indemnity, liability cap, auto-renewal, termination, governing law). Use when the document is a contract or agreement. The “use when…” half is what tells an agent to reach for this skill — don’t skip it. Tags: contract, legal, risk.

  3. Switch to the Markdown tab and write the body — the instructions the agent reads when it invokes the skill. Something like:

    Read the supplied contract. Identify clauses in these risk categories and report each you find:
    - Auto-renewal — does it renew automatically? Capture the notice period and renewal date.
    - Liability — is liability uncapped, or capped at an unusually high multiple? Flag uncapped.
    - Indemnity — is indemnity one-sided (only one party indemnifies)? Flag asymmetry.
    - Termination — can we terminate for convenience? Flag if only the counterparty can.
    - Confidentiality / NDA scope — is the definition of "Confidential Information" overbroad or perpetual?
    - Governing law / jurisdiction — flag an unexpected or unfavourable jurisdiction.
    
    For each clause you flag, return: the clause_type, a severity (Low / Medium / High),
    the excerpt (the exact wording), and — if you have a suggested-fallback tool available —
    call it for safer language and put the result in suggested_fallback. Quote wording from the
    document; never invent clauses that aren't there. If a category isn't present, simply omit it.
  4. Click Create. detect-risky-clauses appears in the Skills list with a V1 version chip and a Project scope badge (it’s yours to edit).

A Tool is a single callable the agent invokes mid-run. Here we want a lookup that, given a clause type, returns your firm’s preferred fallback wording — so suggestions come from your playbook, not the model’s imagination. Point it at whatever endpoint your team exposes (or a small internal service that returns canned redlines).

  1. Go to Studio ▸ Agent Builder ▸ Tools. Click + Tool.

  2. In the import grid, filter Filter by type → API Endpoint and import the closest GET-style card. The dialog flips to form view.

  3. Tool Name: fallback-language-lookup. Tool Description (the model reads this to decide whether to call it — make it say what and when): Look up your organisation’s preferred fallback wording for a risky contract clause. Use this whenever you have flagged a clause and need to suggest safer alternative language.

  4. In the code editor, point the API URL at your fallback-language endpoint, set the method, and declare the input schema, e.g.:

    {
      "clause_type": { "type": "string", "description": "e.g. auto-renewal, uncapped-liability, one-sided-indemnity" }
    }
  5. If the endpoint needs a key: under Default parameter values, add a row, pick the key parameter, set its type to sensitive, and paste the key — it will be masked. Never put credentials in the description or URL.

  6. Save. The tool appears in the list with a read-only Snippet on the right.

No external API yet? Two honest fallbacks: (a) skip this tool for now and let the skill body ask the agent to propose fallback wording from the contract context — less consistent, but real today; or (b) author the fallback wording as a Library snippet or a Datasheet the agent reads — see Library & bots and Drive & datasheet. The custom-API tool is the cleanest route once your firm exposes a clause-language service.

Stage 3 — The agent

Now assemble the worker. Full editor tour: Your first agent. The editor opens as a full-window dialog with a builder pane on the left and a live Playground on the right.

  1. Go to Studio ▸ Agent Builder ▸ Agents+ Agent ▸ Agent.

  2. Persona tab. Name: Contract Reviewer. Description: Flags risky clauses, scores a risk band, and suggests fallback language for human review. Instructions (use the co-pilot to seed, then edit to roughly):

    You are a cautious contract-review paralegal. For each contract, use your clause-detection
    skill to find risky clauses, and for each flagged clause suggest safer fallback language.
    Then assign an overall risk_band of Low, Medium, or High based on the worst clauses you
    found. You flag and suggest — you never give legal advice or decide whether to sign. Only
    report clauses actually present in the document; quote the wording. A qualified human makes
    the final call.
  3. Model tab. Pick your project’s LLM Model. Set Agent Mode = Thinking while you build (so you can watch its reasoning); switch to Fast for production later. Keep Temperature low under Advanced sampling — this is judgement-sensitive reading, not creative writing.

  4. Knowledge tab. Under Views, leave it scoped to this collection’s own documents (the agent reads the contract in front of it). You don’t need a separate Knowledge collection for this build.

  5. Capabilities tab. Skills → + Pin skill → detect-risky-clauses (it shows as a Pinned card). Tools → + Add tool → fallback-language-lookup (a card under Tools). Optionally tick Restrict this agent to pinned skills only for tight, predictable behaviour.

  6. Output tab. Turn on Structured output. Choose the Taxonomy/Learner Contract Review, set Process unit = Page, and add Labels matching your schema: counterparty, contract_type, effective_date, renewal_date, detected_clauses (the table) and risk_band — give each a short Description. Turn on Confidence Score and References so a reviewer can see where each value came from, and how sure the agent is.

  7. Governance tab. Guard rail comes in the next stage. If a flagged contract should later trigger an external action (e.g. post to a CLM system via a tool), add a per-tool Approval here so a human signs off first — HITL gives you a real Approve & Execute / Review / Reject card.

  8. Click Save Agent.

  9. Test it now: in the Playground (right pane), set Input Type = Document, pick a sample contract, and Send. Watch the transcript: a tool call to fallback-language-lookup, the detected_clauses table filling in with severities and excerpts, a risk_band, and References back to the page. Wrong field? Sharpen its Description on the Output tab and re-run.

Stage 4 — The guard rail (Governance), honestly

A guard rail is a named, reusable policy — a single instruction — that the platform appends to the agent’s instructions at run time. It steers the agent; it does not read the answer back and block it. So we use it for what it’s genuinely good at: keeping the agent in scope (contract review only) and in tone (professional, no legal advice).

  1. Go to Studio ▸ Agent Builder ▸ Guard Rails. Click + Guard Rail.

  2. Name: Scope & Tone: Contract Review. Description: Keep the agent to contract-review scope and a professional, non-advisory tone. (Max 200 characters.)

  3. Instruction — phrase it as a direct order; it’s pasted verbatim into the agent’s instructions:

    You assist only with reviewing the contract in front of you: flagging clauses, suggesting
    fallback wording, and scoring risk. Maintain a neutral, professional tone. Do not give
    legal advice, do not state whether the contract should be signed, and do not answer
    off-topic questions — if asked, politely say you only help with contract clause review.
    Always note that a qualified human must make the final decision.
  4. Save. Confirm it shows in the list with your instruction in the detail panel.

  5. Go to Agents, Edit Contract Reviewer, open the Governance tab, click + Add under Guard rails, select Scope & Tone: Contract Review (it appears as a shield chip), and Save Agent.

Watch out — advisory, not a gate. This guard rail strongly steers the agent, but the platform won’t independently block an off-tone or off-scope answer. For anything that must be enforced, layer it: a clear guard rail plus the human approval in the review loop below plus tight knowledge scope. In the Playground, test it: ask "should we sign this?" — the agent should decline to advise and steer back to clause review. If it doesn’t, sharpen the instruction’s wording.

Stage 5 — Wire it up and test the whole loop

An agent only processes documents once it’s a collection’s Worker (Intake Agent).

  1. Go to Studio ▸ Data Model ▸ Collections, select Contracts, open the Agents tab.
  2. Assign Contract Reviewer as the collection’s intake/processing agent. The tab shows the assignment with an Open in Agent Builder link back to the editor. From now on every contract that lands in Contracts — uploaded or pulled in by a connector — is run by the agent automatically, filling the schema and entering the review lifecycle.
  3. Upload a real NDA or MSA. From the Contracts collection (or the consumer document list), add a sample contract. It shows in the list with a Processing… chip.
  4. Watch it process. Open the document — the Document detail fills in live as the agent finishes: header fields, the detected_clauses table, and a risk_band.
  5. Read the findings as a lawyer would. In the Summary pane: read the flagged / low-confidence fields first; click a clause’s excerpt — the viewer scrolls to and highlights the source segment (the agent shows its work — verify it read the real wording); check the risk_band and each clause’s severity and suggested_fallback.
  6. Correct and advance. Fix any wrong value in place — it saves back to the Label and becomes a training signal (AI Builder). Then use the workflow action pane to advance the document through its review stages (e.g. approve / needs-info / reject), each role-gated and written to the audit trail.

What “good” looks like: on a contract with an auto-renewal and an uncapped-liability clause, the agent flags both with High/Medium severities, quotes the wording, proposes fallback language for each, and scores risk_band = High — and a reviewer can verify every flag against the highlighted source in one click.

Make it production-worthy

  • A clause library. Instead of (or alongside) the API tool, hold your firm’s preferred fallback wording in a Datasheet (Drive & datasheet) the agent queries with the built-in SQL search toolkit, or as a Library snippet in a pipeline node (Library & bots). Structure your redlines once; reuse everywhere.
  • A stricter guard rail — and real enforcement. Add a second guard rail (e.g. No External Disclosure) — but remember guard rails are advisory. For a hard stop, pair it with a HITL approval on any tool that writes anywhere (Governance ▸ Approvals, Your first agent).
  • An approval lifecycle. Customise the collection’s Lifecycle / Stages (Taxonomy, lifecycle, tags & events) so a High-risk contract is routed to a senior approver before sign-off — the “two humans confirm” rule, made real for risk.
  • Export a redline summary. Use the document Export action (Document detail) to push the detected-clause table and fallback suggestions out to your counsel — or fire an Event/Webhook (D3) on stage change.
  • Share it. Publish the agent, skill, and guard rail to a Hub (Hubs & solutions) so other projects install the whole contract-review capability — structure travels, data doesn’t.

Where to go next

Prefer learning inside the product? The same academy lives in the platform's Learn menu — every screen links to the chapter that explains it.

See the platform live