Inspiration

I'm an international student living in Melbourne, thousands of kilometres from home, and since arriving I've had to sign more contracts than I ever expected — rental agreements, sublease arrangements, internship offer letters, volunteer waivers. Most of the time, I signed them under time pressure, without anyone to turn to for advice, and without fully understanding what I was agreeing to.

I signed my first Melbourne lease without understanding the break clause. I accepted an internship agreement without realising the IP ownership terms were unusually broad. Legal advice was either too expensive or too slow to be practical for a student.

I built ContractGuard because I wish it had existed when I needed it. International students, migrants, young renters, and first-time employees are exactly the people most likely to sign something they don't understand — and least likely to have a lawyer they can call.

What it does

ContractGuard analyses any contract text in seconds using AI. Paste in any contract — a lease, an employment agreement, a freelance contract, terms of service — and it returns:

  • A risk score from 0–100 with a LOW / MEDIUM / HIGH rating
  • Every red flag clause identified, with a plain English explanation of what's wrong
  • A fairer rewrite of each problematic clause
  • A specific action — negotiate, refuse, or accept with caution
  • Negotiation tips tailored to the specific contract
  • A visual analytics dashboard showing severity breakdown and clause categories

ContractGuard also maintains a live dataset insights panel seeded from 5 real contracts we analysed — independent contractor agreements, property management, employment, freelance services, and residential leases. Every new contract analysed updates the dashboard in real time.

How we built it

ContractGuard is a single self-contained HTML file with vanilla JavaScript. It calls the Anthropic Claude API directly from the browser using a carefully engineered legal system prompt that instructs the model to return structured JSON. The frontend parses that JSON and renders it into a visual risk report with charts drawn using the Canvas API.

No backend. No framework. No database. No install required — just open the file in Chrome.

Challenges we ran into

Getting the model to return consistent, calibrated, parseable JSON was harder than expected. Early versions over-flagged standard commercial terms as HIGH severity, making every contract look catastrophic. We iterated on the system prompt extensively to introduce explicit severity guidelines — HIGH is now reserved for clauses that cause genuine financial harm, not just anything that favours the other party.

We also had to handle browser CORS requirements for direct Anthropic API calls, and build a multi-stage JSON extraction fallback to handle edge cases where the model added preamble text despite being instructed not to.

Accomplishments that we're proud of

The output is genuinely actionable — not just "this clause looks risky" but here is the specific problem, here is a fairer version, and here is exactly what you should say in the negotiation. We're also proud that the entire product runs in a single browser file with no sign-up, no install, and no technical knowledge required. Anyone can use it.

What we learned

Prompt engineering is product design. The quality and calibration of the output is entirely determined by how precisely you instruct the model — small changes to the system prompt produced dramatically different results. We also learned that the best AI applications aren't about building new models, they're about applying existing ones to underserved, high-stakes problems.

What's next for ContractGuard – AI Legal Red Flag Detector

  • PDF upload so users can drop in a full contract file directly
  • Clause benchmarking against industry standards (e.g. is this non-compete typical for your industry?)
  • Jurisdiction awareness — different advice for Victorian tenancy law vs US employment law
  • Team dashboard for law firms and HR teams to process contracts at scale
  • API layer so legal tech platforms can embed ContractGuard directly into their workflows

Built With

  • anthropic-claude-api-(claude-sonnet-4-20250514)
  • api
  • canvas
  • css
  • html
  • vanilla-javascript
Share this project:

Updates

Submission history