--- title: Contract Red Team emoji: 🔍 colorFrom: yellow colorTo: blue sdk: gradio app_file: app.py pinned: false license: mit --- # Contract Red Team ## Question How can an AI assistant review a contract while keeping evidence visible? ## System Boundary This Space is a contract-risk triage tool. It is not legal advice. It is designed to surface clauses worth human review. ## Method The app extracts text from a PDF, chunks the contract into clauses, searches for risk patterns, and uses model-assisted explanation to describe potential issues such as termination, non-compete, IP assignment, liability, and arbitration. ## Technique This is evidence-first document triage. The system combines deterministic risk patterns with model explanation. The design goal is to keep the clause visible. The model should not be a magic summarizer; it should point to text that a human can inspect. ## Output The app returns a risk report with clause evidence, category labels, and suggested review questions. ## Why It Matters High-stakes document AI must be evidence-first. The user should see why a clause was flagged, not merely receive a summary. ## What To Notice The strongest outputs are tied to exact clauses. If the evidence is vague, the finding should be treated as weak. ## Effect In Practice This workflow can help users prioritize review time by surfacing clauses that deserve attention before a detailed legal review. ## Hugging Face Extension The Space can be expanded with a clause-risk dataset, model explanations, and evaluation on category precision and evidence quality. ## Limitations Contracts are jurisdiction-specific and context-dependent. This tool should be used for education and triage only, followed by professional legal review. ## Run Locally ```bash pip install -r requirements.txt python app.py ```