Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if grep -qE '^(src|test|npm|scripts)/' "$f"; then echo "unexpected files in $f"; exit 1; fi
done
test "$(ls npm/packed/*.tgz | wc -l)" -eq 6
grep -q '^dist/index.js$' npm/packed/sqlguardllm-0*.files.txt
grep -q '^dist/index.js$' npm/packed/sqlguardllm-[0-9]*.files.txt
grep -q '^engine/sqlguardllm-engine$' npm/packed/sqlguardllm-engine-linux-x64-*.files.txt
- uses: actions/upload-artifact@v4
with:
Expand Down
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Changelog

All notable changes to sqlguardllm are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/). Violation codes are stable across minor versions.
All notable changes to sqlguardllm are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/). The 15 core violation codes are stable across minor versions; the 7 write, taint and procedure codes are experimental (docs/STABILITY.md).

Sections used: Added, Changed, Deprecated (an API that still works but will be removed, with the release that removes it), Removed, Fixed, Security, and **Security (stricter)** for a bypass fix that makes the guard reject SQL it used to allow (shipped as a patch release, see docs/STABILITY.md).


## [Unreleased]

### Added
## [1.0.0] - 2026-12-01

First stable release: the core API and the 15 core violation codes follow semver (docs/STABILITY.md). Also ships proxy mode, controlled writes, stored procedures and tainted sessions (experimental, outside that contract), the benchmark harness and `sqlguardllm mcp --demo`. Python, npm, NuGet and the MCP manifest advance together.

### Added
- `Policy.from_database` now maps the SQLAlchemy dialect `postgresql` to `postgres` (it raised "unknown dialect").
- `sqlguardllm protect` (#216): finds dbhub, Postgres MCP Pro and MCP Toolbox in Claude Desktop, Cursor and VS Code configs, drafts a policy from the database (EN/ES PII column heuristics: hidden or masked, with the reason), lints it and rewrites the entry to run through `sqlguardllm proxy`. Dry run by default; `--apply` keeps a timestamped backup, `--undo` restores it; passwords are masked in all output. Docs in `docs/PROTECT.md` (EN/ES); `examples/proxy/mcp-toolbox.yaml`.
- `langchain-sqlguardllm` 0.1.0a1 in `clients/langchain` (alpha, not on PyPI): a guarded `sql_query_tool`, `sqlalchemy_executor` and `GuardedSQLDatabase` for LangChain 1.x.

### Added
- **Controlled writes** (#170, [writes](docs/WRITES.md)), off by default. `Policy.writes` (`WritePolicy`) and `Guard.check_write()` for single-table `INSERT`, `UPDATE` and `DELETE`, with row filters ANDed into the write and the violation codes `write_not_allowed`, `write_column_not_allowed`, `missing_where` and `too_many_rows` (EN/ES); `check()` still rejects every write. `WriteRuntime` (propose as a dry run, approved apply, undo with before-images, drift check) and a signed `Ledger`, tested on SQLite, PostgreSQL 16 and 18, MySQL 8 and SQL Server 2022. MCP tools `propose_write`, `apply_write` and `undo`, registered only when the policy has `writes` and a separate write database is given (`create_server(write_database=, ledger_path=)`, `sqlguardllm mcp --write-db --ledger`); approval is asked through MCP elicitation and fails closed.
- **Tainted sessions** in the MCP server (#171): `untrusted_columns`, `sensitive_tables` and `on_tainted` (`deny`) in the policy. Reading an untrusted column taints the session and queries on sensitive tables are refused with `tainted_session` (EN/ES); views over sensitive or untrusted data propagate; listed names must exist in the database or the server does not start. By default taint is kept per server-assigned `mcp-session-id` (bounded to 10,000 sessions); a call without one (stdio, in-process, the stateless protocol) has an unknown session and counts as tainted; stdio passes `single_session=True` (the `mcp` command does) and an explicit `session_id` callable still wins. `explain_query` reports `tainted`, `taint_sources` and `reads_untrusted`. A query refused by the taint check is audited once, as a refusal.
- **Allowlisted stored procedures** (#173, [procedures](docs/PROCEDURES.md)): `procedures` in the policy allows T-SQL `EXEC` and PostgreSQL `CALL` with named, type-checked parameters and context-bound values; dynamic SQL, `sp_executesql`, linked servers, positional arguments and extra clauses are refused (`procedure_not_allowed`, `procedure_param_invalid`).
Expand Down Expand Up @@ -203,7 +207,8 @@ First alpha. Installed with `pip install sqlguardllm` and imported as `import sq
- Table functions are rejected, even harmless ones like `generate_series`.
- No command-line tool yet (planned for v0.2).

[Unreleased]: https://github.com/jmmana/sqlguardllm/compare/v0.5.0a8...HEAD
[Unreleased]: https://github.com/jmmana/sqlguardllm/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/jmmana/sqlguardllm/compare/v0.5.0a8...v1.0.0
[0.5.0a8]: https://github.com/jmmana/sqlguardllm/compare/v0.5.0a7...v0.5.0a8
[0.5.0a7]: https://github.com/jmmana/sqlguardllm/compare/v0.5.0a6...v0.5.0a7
[0.5.0a6]: https://github.com/jmmana/sqlguardllm/compare/v0.5.0a5...v0.5.0a6
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md). Be kind; cr

Maintainers only. Every release goes to PyPI, npm and NuGet together, with one version.

1. Set the version in `pyproject.toml` (for example `0.6.0a1`) and the matching one in `clients/node/package.json` and `<Version>` of `clients/dotnet/src/SqlGuardLlm/SqlGuardLlm.csproj` (`0.6.0-alpha.1`; `b1` is `-beta.1`, `rc1` is `-rc.1`), then run `uv lock` and `npm install --package-lock-only` in `clients/node`.
2. Move the `Unreleased` notes in `CHANGELOG.md` under `## [0.6.0a1] - YYYY-MM-DD`.
3. Merge to `main`, then tag: `git tag -a v0.6.0a1 -m "sqlguardllm 0.6.0a1" && git push origin v0.6.0a1`.
1. Set the version in `pyproject.toml` (for example `1.0.0`) and the matching one in `clients/node/package.json` and `<Version>` of `clients/dotnet/src/SqlGuardLlm/SqlGuardLlm.csproj` (`1.0.0`; `b1` is `-beta.1`, `rc1` is `-rc.1`), then run `uv lock` and `npm install --package-lock-only` in `clients/node`.
2. Move the `Unreleased` notes in `CHANGELOG.md` under `## [1.0.0] - YYYY-MM-DD`.
3. Merge to `main`, then tag: `git tag -a v1.0.0 -m "sqlguardllm 1.0.0" && git push origin v1.0.0`.

The `Release` workflow checks that tag, versions and changelog agree, runs the tests, and publishes to PyPI, npm and NuGet with Trusted Publishing (no tokens). npm gets the dist-tag from the version: before 1.0 every release is `latest`; from 1.0 on, prereleases get `alpha`, `beta` or `rc` and final releases `latest`. npm publishes six packages per release: `sqlguardllm-engine-{linux-x64,linux-arm64,macos-arm64,macos-x64,windows-x64}` first, then `sqlguardllm` last (its `optionalDependencies` are merged in at publish time and never committed). The engines are the archives of that same run, attested and re-verified (attestation, then SHA-256) before they are unpacked; each package is published with `npm publish --provenance`, and one already on npm is skipped, so a failed release can be re-run. `clients/node/npm/publish.mjs --dry-run` does `npm pack` on all six without publishing; the `npm pack (dry run)` workflow runs it on every pull request (with placeholder engines) and uploads the file list of every tarball, and the release runs it with the real engines just before publishing.

Expand Down
Loading
Loading