# CLM System Sync

Read and write contract records and metadata in the org's CLM (contract-lifecycle management) tool through an Integration row, keeping counsel in the approval loop for anything that leaves the org.

## When to use

- You need to pull contract status, metadata, or party details from the CLM system for a report or reconciliation.
- A workflow requires creating or updating a contract record, renewal date, or metadata field in the CLM system.
- You must confirm which contracts are pending signature, expiring, or missing required metadata.
- A downstream process (e.g. billing or vendor onboarding) needs current contract data synced from the CLM system.

## Tools

- `http-get`
- `http-post`
- `http-request`

## Playbook

1. Use `http-get` to call the CLM REST API and confirm connectivity, e.g. GET `https://api.clmvendor.com/v1/contracts?status=active`. Auth is injected by the org's Integration row for this host — never ask for, echo, or hardcode credentials.
2. When retrieving records for a report, page through results with `http-get` (e.g. GET `https://api.clmvendor.com/v1/contracts?page=2`) and collect only metadata fields (status, dates, parties, contract ID) — never copy full contract text into your working notes.
3. To create a new contract record or metadata entry, use `http-post` (e.g. POST `https://api.clmvendor.com/v1/contracts`) with the structured fields provided by the requester.
4. To update an existing record (status change, renewal date, field correction) or to delete a stale entry, use `http-request` with the appropriate method (e.g. PATCH `https://api.clmvendor.com/v1/contracts/{id}`).
5. If the sync surfaces a contract needing legal review, summary, or action, do not draft advice or a final summary yourself for external use — package the relevant metadata and a pointer to the record, then route it to counsel via `create-task`, tagged "not legal advice — attorney review required."
6. Never store full contract text, clauses, or negotiated terms in `update-memory` or in task titles — reference the CLM record ID instead and let counsel open the source system for full text.
7. If the CLM API returns 401/403, or no Integration row exists for the host, stop immediately and message a human via `send-message` naming the CLM service and the scopes needed.
8. If a requested action falls outside CRUD on contract records (e.g. contacting a counterparty, negotiating terms, or interpreting a clause for a regulator), do not attempt it — hand off to a human via `create-task` instead.

## Failure modes

- Treating a metadata pull as legal analysis: any interpretation of contract terms must be flagged as "not legal advice — attorney review required" and routed to counsel, never presented as a final answer.
- Writing contract text or negotiated terms into `update-memory` or task titles instead of keeping it in the CLM system or a file, risking uncontrolled exposure of sensitive terms.
- Sending a summary or extracted document outside the org without counsel approval — every such output must go through `create-task` for attorney review first.
- Continuing to retry `http-post` or `http-request` after a 401/403 instead of stopping and escalating via `send-message`, which can mask a broken or missing Integration.

## Done when

- The requested contract data has been read from or written to the CLM system via `http-get`, `http-post`, or `http-request`, with only metadata (never full contract text) retained outside the source system.
- Any output requiring judgment or external use has been routed to counsel via `create-task` with the "not legal advice — attorney review required" note attached.
- Any auth failure or missing Integration has been escalated to a human via `send-message` rather than silently retried.