The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Klaws — Korean compliance risk scanner listing page.
Korean law compliance risk scanner for codebases. Scans source code for patterns that may indicate compliance risks under Korean law and maps findings to specific legal provisions. Runs as an MCP server (so AI coding assistants can scan on request) and as a standalone CLI.
Currently covers PIPA (Personal Information Protection Act), the Network Act (정보통신망법), the Credit Information Act (신용정보법), and the E-Commerce Act (전자상거래법).
Disclaimer: klaws identifies possible compliance risks for review. It does not constitute legal advice. Consult qualified legal counsel for definitive guidance.
Privacy: klaws analyzes code locally and transmits nothing. The only outbound network call is the optional
--livelaw lookup to law.go.kr; without that flag it is fully offline. See Privacy & Security.
No toolchain required — the image is published to GitHub Container Registry and works identically on macOS, Linux, and Windows:
Download the archive for your platform from the latest release, extract it, and move klaws onto your PATH.
Requirements: Go 1.23+
Verify the install:
| ID | Name | What it looks for | Risk | Related Law |
|---|---|---|---|---|
PIPA-LOG-001 | Personal Data Logging | log.*() calls containing personal data field names (email, phone, SSN, password) | MEDIUM | PIPA Art. 29 |
PIPA-ENC-001 | Unencrypted Personal Data | Sensitive identifier fields (resident number, SSN) without encryption annotations or calls | HIGH | PIPA Art. 24-2, 29 |
PIPA-CST-001 | Missing Consent Check | @PostMapping/@PutMapping endpoints accepting personal data without consent verification | HIGH | PIPA Art. 15 |
NIA-MKT-001 | Marketing Message Consent | Advertising/marketing message dispatch (send/push) without an apparent opt-in consent check | MEDIUM | Network Act Art. 50 |
CIA-ENC-001 | Unprotected Credit Information | Credit/financial identifier fields (card number, account number, credit score) without encryption or masking | HIGH | Credit Information Act Art. 19 |
ECA-RET-001 | Transaction Record Retention | Transaction record fields (order/payment IDs) stored without apparent retention or preservation handling | MEDIUM | E-Commerce Act Art. 6 |
PIPA-RET-001 | Personal Data Retention | Personal data fields (email, phone, resident number) stored without apparent destruction or retention-limit handling | MEDIUM | PIPA Art. 21 |
PIPA-XBR-001 | Third-Party Data Transfer | Personal data sent to a third-party or external endpoint (outbound call to an external URL/partner) without an apparent consent check | HIGH | PIPA Art. 17 |
Detectors use regex-based pattern matching. They support both English and Korean field names (e.g., email/이메일, residentNumber/주민번호, consent/동의).
klaws can run as an MCP server, making its scanning capabilities available to AI coding assistants.
| Tool | Description |
|---|---|
scan_directory | Scan a directory for compliance risks |
scan_file | Scan a single file |
list_detectors | List all available detectors |
get_law_reference | Look up a Korean law provision by ID |
All clients use the same launch command: klaws serve over stdio. Use the absolute path to the binary (run which klaws, or where klaws on Windows, to find it), or just klaws if it is on your PATH. Prefer not to install anything? Use the Docker variant below — it works in any client that supports stdio MCP servers.
Claude Code — ~/.claude/settings.json:
Or add it in one command:
Claude Desktop — claude_desktop_config.json (Settings → Developer → Edit Config):
Cursor — ~/.cursor/mcp.json (or .cursor/mcp.json in a project):
VS Code — .vscode/mcp.json:
Once connected, ask your assistant something like "scan this directory for Korean compliance risks with klaws."
No binary install needed — swap the command/args for a docker run that mounts the code you want scannable. The -i flag keeps stdin open for the stdio transport; --scan-root /src confines scans to the mounted directory:
Point the assistant at paths under /src (the container-side mount), e.g. "scan /src for Korean compliance risks."
By default klaws serve uses stdio (local). To run it as a remote MCP server over HTTP, pass --http:
The MCP endpoint is then available at http://<host>:8080/mcp (Streamable HTTP transport). Point an HTTP-capable MCP client at that URL.
--auth-token <token> — requires Authorization: Bearer <token> on every HTTP request; unauthenticated requests get 401. Can also be supplied via the KLAWS_AUTH_TOKEN environment variable. Applies to --http only.--scan-root <dir> — restricts scan_directory / scan_file to paths within <dir>; requests for paths outside it are rejected. (Also honored in stdio mode.)Notes:
--auth-tokenprovides bearer auth but not TLS. For untrusted networks, still terminate TLS at a reverse proxy / gateway in front of klaws.- The
scan_directoryandscan_filetools read the server's filesystem (the paths you pass resolve on the host running klaws). For remote scanning, run klaws where the code lives (e.g. a CI runner with the repo checked out) and set--scan-rootto that checkout. Theget_law_referenceandlist_detectorstools have no filesystem dependency.
klaws ships with 40 articles across 4 Korean laws embedded in the binary (no external files needed):
| ID | Article | Topic |
|---|---|---|
PIPA-15 | Art. 15 | Collection and use of personal information |
PIPA-17 | Art. 17 | Provision to third parties |
PIPA-18 | Art. 18 | Restriction on use beyond purpose |
PIPA-21 | Art. 21 | Destruction of personal information |
PIPA-23 | Art. 23 | Restriction on sensitive information |
PIPA-24 | Art. 24 | Restriction on unique identification info |
PIPA-24-2 | Art. 24-2 | Restrictions on resident registration numbers |
PIPA-29 | Art. 29 | Duty of safety measures |
PIPA-30 | Art. 30 | Privacy policy |
PIPA-34 | Art. 34 | Notification of data breach |
| ID | Article | Topic |
|---|---|---|
NIA-22 | Art. 22 | Consent for collection/use of personal info |
NIA-23 | Art. 23 | Restriction on collection |
NIA-23-2 | Art. 23-2 | Restriction on resident registration numbers |
NIA-24 | Art. 24 | Restriction on use |
NIA-24-2 | Art. 24-2 | Provision to third parties |
NIA-27 | Art. 27 | Safety measures |
NIA-28 | Art. 28 | Entrustment of personal info |
NIA-28-2 | Art. 28-2 | Notification of data breach |
NIA-44 | Art. 44 | User protection |
NIA-44-7 | Art. 44-7 | Prohibition of illegal information |
NIA-50 | Art. 50 | Restriction on transmission of advertising info |
| ID | Article | Topic |
|---|---|---|
CIA-15 | Art. 15 | Principles of collection |
CIA-17 | Art. 17 | Prohibition of disclosure beyond purpose |
CIA-19 | Art. 19 | Safety of credit info systems |
CIA-20 | Art. 20 | Accuracy and currency of credit info |
CIA-32 | Art. 32 | Consent for provision/use |
CIA-33 | Art. 33 | Use of personal credit info |
CIA-34 | Art. 34 | Provision/use of personal credit info |
CIA-38 | Art. 38 | Protection of credit info |
CIA-39 | Art. 39 | Notification of data breach |
CIA-40 | Art. 40 | Rights of credit info subjects |
| ID | Article | Topic |
|---|---|---|
ECA-6 | Art. 6 | Preservation of transaction records |
ECA-7 | Art. 7 | Prevention of operational errors |
ECA-11 | Art. 11 | Reliability of electronic payment |
ECA-13 | Art. 13 | Provision of identity and transaction info |
ECA-14 | Art. 14 | Confirmation of orders |
ECA-17 | Art. 17 | Right of withdrawal |
ECA-21 | Art. 21 | Use of consumer information |
ECA-24 | Art. 24 | Cybermall security |
ECA-26 | Art. 26 | Protection of consumer information |
Full Korean article text is included. Use --live to fetch the latest version from law.go.kr.
klaws is designed to be safe to point at private code:
--live law lookup (CLI) / get_law_reference with live fetch (MCP), which fetches public statute text from law.go.kr. It sends only the statute's name (e.g. 개인정보보호법, resolved from the provision you looked up) as the search query — never your code. Omit --live to stay fully offline.--scan-root <dir> to restrict scan_directory/scan_file to a single tree, and --auth-token when serving over --http. See Securing a remote server.To report a vulnerability, see SECURITY.md.
klaws ships a composite action that scans your code and produces a SARIF report, which you can upload to GitHub code scanning so findings appear inline on pull requests and in the Security tab.
Set fail-on: HIGH (or MEDIUM) to make the check fail the PR when findings at that severity or above are present. The if: always() on the upload step ensures the SARIF is still published when the gate fails.
Maintainers: see RELEASE.md for how to cut a release and publish to the MCP registry.
MIT