The Problem: "Legal AI Slop"
General-purpose AI agents (like Claude, ChatGPT, or Gemini) are incredible at writing code and generating text. But when it comes to the legal domain, they are often "confidently wrong."
We call this Legal AI Slop.
If you ask a standard AI agent to draft a Turkish privacy policy (KVKK) for a SaaS platform, it might:
- Invent a non-existent statutory article.
- Mix Turkish KVKK requirements with European GDPR rules in the same document.
- Skip mandatory personal data notices.
- Confidently present the document without any legal disclaimers.
This is a massive liability. Legal output isn't a toy—it affects clients' rights, deadlines, and liabilities.
Enter SuperLex Skills
To solve this, we built SuperLex Skills, an open-source, agentic skill library designed specifically for lawyers and legal engineers.
Instead of letting the AI run wild, SuperLex Skills transforms your AI agent from a creative writer into a disciplined Legal Associate. It enforces "Compliance by Design" through a structured architecture.
Here is how we did it and how you can use it.
The Architecture: Engine vs. Fuel
The biggest challenge in legal tech is that law is local, but software is global. How do you build an AI legal skill that works for Turkish law today, but can be scaled to US, EU, or Brazilian law tomorrow?
Our solution is the Motor vs. Fuel Architecture.
Every legal skill in the repository is split into two strict parts:
-
The Engine (
SKILL.md): Written in English, this is jurisdiction-agnostic. It defines what the agent must do (the process flow, risk zones, and verification steps) without containing a single statute number. -
The Fuel (
jurisdictions/<code>.md): Written in the local working language (e.g.,tr.mdin Turkish). This contains the actual legal substance—the exact statute numbers, working-language section labels, and local anti-patterns.
You pour the local "fuel" into the abstract "engine." This means a contributor from Germany can add de.md to our Contract Review skill without touching the core logic of how the agent behaves.
The 3-Layer Safety Model
Lawyers can't afford to blindly trust an AI's output. That's why SuperLex Skills implements a rigorous safety protocol:
1. Context Manager
Before drafting anything, the agent must run the lawyer-context-manager. This collects mandatory context: Who is the client? What is the jurisdiction? If a user tries to rush the agent ("just write the document quickly"), the framework forces the agent to refuse until context is established.
2. Agentic Verification (The HARD-GATE)
We enforce a strict "Human-in-the-Loop" requirement. For high-risk tasks (like reviewing a contract), the agent must stop and present a HARD-GATE. It identifies the top 3 legal risks, suggests "Safe Harbor" alternatives, and waits for explicit human approval before proceeding.
3. The SELF-TEST
The agent is required to run a mandatory self-test against a set of documented Anti-Patterns. (e.g., "Did I cite a repealed law? Did I mix up services with goods?").
Deep IDE Integration
SuperLex Skills isn't a standalone web app. It lives exactly where developers and legal engineers work: inside the IDE.
You can plug it directly into the leading AI coding environments:
-
Cursor:
/add-plugin https://github.com/avSercanKoc/superlex-skills -
Claude Code:
/plugin install https://github.com/avSercanKoc/superlex-skills - OpenCode: Native plugin integration.
-
Gemini CLI: Add to your project's workspace via
gemini-extension.json.
"The Guardian": Linter for Lawyers
To maintain strict quality control, we built an automated bash script called The Guardian. It runs on every commit and verifies that:
- No jurisdiction-specific statutes leaked into the English engine file.
- All high-risk skills have both Pre-Gen and Post-Gen
HARD-GATEs. - The
DISCLAIMER.mdis correctly hooked into the output.
If a PR violates these rules, the CI fails. It's essentially a linter for legal compliance.
Join the Legal Engineering Movement
SuperLex Skills is built to grow. We started with Turkish law (tr), but the architecture is designed for the world.
If you are a lawyer, a legal engineer, or an open-source developer, we invite you to contribute. You can add a new Jurisdiction Pack (like us.md or de.md) to an existing skill, or design an entirely new legal skill using our TDD-based guidelines.
Check out the repository, read our CONTRIBUTING.md, and help us build a safer future for Legal AI.
🔗 GitHub Repository: SuperLex Skills
Let me know what you think in the comments! How are you handling compliance with AI agents in your projects?
Top comments (0)