Winner, Amazon Munich Hackathon 2025
ContractGuard is a serverless contract analysis tool that extracts key clauses from uploaded legal documents, benchmarks them against risk patterns, and explains red flags in plain language using AWS Bedrock's LLM capabilities.
Prototype: ContractGuard Demo
The serverless architecture leverages AWS managed services for zero-maintenance, event-driven contract analysis:
graph LR
A[User Browser] -->|1. Upload Contract PDF| B[S3 Bucket]
B -->|2. S3 Event Trigger| C[Lambda: Extract]
C -->|3. Analyze Document| D[Textract]
D -->|4. Return JSON| C
C -->|5. Store Extracted Text| E[S3: Processed/]
C -->|6. Invoke Risk Analysis| F[Lambda: Analyze]
F -->|7. Bedrock Prompt| G[AWS Bedrock Claude]
G -->|8. Risk Assessment JSON| F
F -->|9. Store Result| H[S3: Results/]
F -->|10. Generate Presigned URL| H
H -->|11. Return Result Link| A
For more detailed overview, see the Architecture in depth
- Storage: Amazon S3 (upload, processed text, results)
- Compute: AWS Lambda (Python 3.11)
- Document Analysis: Amazon Textract
- AI/LLM: AWS Bedrock (Claude 3 Sonnet)
- Frontend: Static HTML/JS (S3 + CloudFront) or Flask API
- Upload & Extract: Drag-drop PDF contracts (multiple file formats supported); Textract extracts clauses and metadata
- Risk Benchmarking: Bedrock analyzes clauses against legal risk patterns (termination, liability, indemnity, IP rights)
- Plain Language Explanations: LLM translates legalese into actionable insights
- Instant Feedback: Results returned via presigned S3 URL in <10 seconds
contract-guard/
├── README.md
├── architecture.md # Detailed AWS diagram and flow
├── lambda/
│ ├── extract_handler.py # Textract extraction + S3 storage
│ ├── analyze_handler.py # Bedrock risk analysis
│ └── requirements.txt
├── frontend/
│ ├── index.html # Upload UI
│ └── app.js # S3 presigned upload + result fetch
├── iac/
│ ├── cloudformation.yaml # IaC for deployment
│ └── terraform/ # Alternative: Terraform modules
└── docs/
└── demo.md # Demo walkthrough
Upload a sample NDA or service agreement PDF:
- Navigate to the frontend URL
- Upload contract → triggers Lambda pipeline
- View extracted clauses and risk scores in ~8-10 seconds
- Multi-document batch analysis
- Clause comparison (contract A vs. contract B)
- Export risk report as PDF
- Integration with DocuSign API for signed contract analysis