Doc Review Agent Kit
A contract-review agent: clause extraction, risk scoring against a YAML playbook, cited findings, and mandatory human sign-off. Ships with synthetic contracts. Not legal advice.
Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
Interactive Reader (Free Preview) Download Free SampleFile Structure 3 files
Documentation Preview README excerpt
Doc Review Agent Kit
NOT LEGAL ADVICE. This kit produces automated triage output, not legal opinions. It is not a lawyer and
creates no attorney-client relationship. A qualified human must read the contract and sign off on every
report. Every output the kit emits carries this notice.
Contract clause extraction, risk scoring driven by a YAML playbook, findings that cite the exact clause text and
character offsets, and a mandatory human sign-off gate: a report is a DRAFT until a named reviewer approves it,
and export_final() raises SignoffError until then.
The kit vendors the agent_forge core runtime (src/agent_forge), so it is standalone: no other package needed.
Everything runs offline with the deterministic MockLLM; plug in a real model through the 1-method LLM protocol.
Quickstart
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest # offline, mock LLM
python examples/quickstart.py # review a synthetic contract, blocked until sign-off
from doc_review import load_playbook, review_document
pb = load_playbook("playbooks/standard-saas-vendor.yaml")
report = review_document(open("samples/saas_risky.txt").read(), pb) # DRAFT
report.sign_off("Your Name", "approved", "checked against source") # human step
print(report.export_final()) # only now allowed
How it works
extract.py: splits numbered clauses;source[c.start:c.end] == c.text.playbook.py+playbooks/*.yaml: rules (regex, severity, guidance) and required clauses. All risk judgement lives in YAML.scoring.py: findings withquote,start,end(absolute offsets) and the full clause text.review.py: runs the vendored injection detector on the document, redacts PII before any model prompt, asks the LLM for a one-line note.report.py: draft/final state machine, sign-off, Markdown/JSON export.
Layout
src/agent_forge (vendored core) - src/doc_review - playbooks/ - samples/ (synthetic contracts) - tests/ - guide/ - examples/.
What it is not
Not legal advice, not a substitute for counsel, not a guarantee that a clause is safe because nothing was flagged.
Regex playbooks miss unusual wording. Sample contracts are fictional. Adapt the playbook to your jurisdiction and risk appetite with your lawyer.
License: MIT with a no-resale-as-template clause (see LICENSE).