Slide 1 of 6 Open App ↗
Slide 1 · Executive Summary

Autonomous Contract Drafting with Strict Guardrails

Drafting enterprise Mutual NDAs from raw business inputs — filling what is standard and routing risk-shifting terms to human legal counsel.

3 / 3
Planted Traps Defeated

Affiliate carve-out, payment terms, and relative dates handled deterministically.

14 / 14
Live Evaluation Pass Rate

100% green against live Groq models with zero flakiness across repeat runs.

6.8s
Live Pipeline Latency

Multi-model parallel execution with sub-50ms zero-token reviewer re-renders.

How 3 Planted Traps Were Handled:

  • C1 (Clause Conflict): Detected non-standard affiliate carve-out (§4 vs §5 conflict) → matched library fallback → routed to NEEDS_REVIEW.
  • C2 (Wrong Template): Payment terms supplied on an NDA detected as prohibited → omitted from contract → flagged as commercial term signal.
  • C3 (Relative Dates): "Use today's date" derived in Asia/Kolkata timezone → rendered as long-form "13 September 2026" without placeholder leaks.
Slide 2 · Architecture & Stack

"Code for Correctness, LLM for Judgment"

Rules, templates, and QA gates decide document safety. The LLM only interprets inputs and searches clause libraries.

Browser UI (HTML/CSS/JS) │ POST /api/run FastAPI on Vercel Functions (Serverless) │ ├── 1. Intake: Template Store & YAML Rulebook ├── 2. Normalizer: Groq gpt-oss-20b (Strict JSON) ├── 3. Clause Analyst: Groq gpt-oss-120b (Tool Loop) ├── 4. Verifier: Groq qwen3.8-27b (Safeguards) │ └── Standby Fallback: gemini-3.5-flash ├── 5. Confidence Router: Gates G1–G11 ├── 6. Assembler: python-docx + HTML Preview └── 7. QA Gate: Q1–Q8 Invariant Checks │ Sealed HMAC-SHA256 Signed Envelope

⚡ Multi-Model Groq Cascade

Allocates models across separate rate-limit buckets: 20b for fast intake normalization, 120b for complex clause research, and qwen 27b for independent verification.

🔄 Automated Gemini Fallback

If Groq encounters 429 rate limit pressure, calls automatically retry once on Google gemini-3.5-flash via OpenAI-compatible endpoint with zero service interruption.

🔒 Zero-Token Stateless Review

Reviewer actions are sealed in HMAC-SHA256 envelopes. Reviewer overrides re-render in POST /api/render with zero new LLM calls and sub-50ms turnaround.

Slide 3 · Live Product Experience

Human-in-the-Loop Contract Authoring

Production interface deployed live at https://zycus-blond.vercel.app.

① Review Tab & HITL

Displays risk level, matched clause, and 4 one-click reviewer actions.

Review Tab

② High-Contrast Draft

Pixel-faithful contract preview with legible highlights and Word comment notes.

Draft Preview

③ Full Audit Trace

Inspectable execution log tracking tokens, model allocation, and latencies.

Agent Trace
Slide 4 · Engineering Resilience

What Broke, How I Fixed It & AI Mistakes

A transparent record of live debugging, failure triage, and autonomous coding corrections.

🐛 Real Runtime Failures (DEBUG_LOG.md)

  • Q8 Paragraph Ordering Mismatch: QA check failed on BLOCKED banner because RenderedDoc.full_text placed title before banner. Fixed by syncing order with write_docx().
  • Relative Date Raw Leakage: Live Normalizer model output returned empty string leaving resolution to caller. Fixed with deterministic date canonicalization in orchestrator.
  • Groq Free-Tier Rate Limits: Rapid sequential live runs depleted 8K TPM quota. Fixed by implementing graduated token backoff in evals/run.py.

🤖 Build-Time AI Mistakes (AI_MISTAKES.md)

  • Omission of 4th HITL Action: Initial generation omitted "Edit text" and dropped edited_text during round-trips. Fixed by adding schema field and safeguard checks.
  • Dark Mode Text Invisibility: Browser <mark> stylesheet applied black text inside highlights on dark theme. Fixed by explicitly defining #fef08a contrast color.
  • Unwired Stretch Fallback: Gemini fallback was specified in D-69 but unwired in runtime until tested against live 429 errors.
Slide 5 · Product Boundary

Flag vs. Act: Where the Agent Draws the Line

Establishing unambiguous boundaries between autonomous agent actions and mandatory human decisions.

✅ When the Agent Acts Autonomously

  • Standard Duration Normalization: Converts "2 years from signing" into 24 months.
  • Unambiguous Relative Dates: Computes "today" in server jurisdiction timezone (Asia/Kolkata).
  • Omission of Irrelevant Commercial Terms: Excludes payment terms from NDAs to prevent invalid contracts.
  • Pre-Approved Library Matching: Retrieves vetted corporate fallback language with verified safeguards.

🛑 When the Agent MUST Flag for Human Review

  • Risk-Shifting Special Clauses (Gate G5): Affiliate disclosures, carve-outs, liability alterations.
  • Missing Required Invariants (Gate G1): Missing governing law generates red ⟦MISSING⟧ marker and marks document BLOCKED.
  • Unapproved Jurisdictions (Gate G6): Non-standard legal forums (e.g. Singapore) require legal sign-off.
  • Infrastructure Outages (Gate G7): Degraded safe draft generated with standard positions; all unanalyzed items flagged.
Slide 6 · Evaluation Matrix & Roadmap

Evals, Limitations & Future Roadmap

Comprehensive evaluation across 14 test scenarios with zero regressions.

Category Scenarios Pass Rate Core Value Verified
Standard Baseline S01, S06, S11 100% (3/3) Standard durations, clean drafting, explicit dates
Planted Traps S01, S05, S08 100% (3/3) Affiliate carve-out, payment terms omitted, prompt injection neutralized
Missing & Ambiguous S02, S04, S09, S10 100% (4/4) Missing law blocked, conditional term flagged, party validation
Boundary Limits S03, S12, S13 100% (3/3) 10-year term, perpetual survival, non-approved jurisdiction
Infrastructure Resilience S14 100% (1/1) Degraded safe draft on AI outage without blank document leakage

Current Limitations

Groq free-tier requires eval pacing; current templates focus on Mutual NDAs; illustrative rulebook positions.

Future Roadmap

Visual redline diff viewer, multi-template enterprise CLM support (MSAs/SOWs), and direct ERP/CRM webhook integration.