Skip to content

Add llama-index-tools-sqlguardllm (GuardedSQLDatabase + tool spec) - #341

Merged
jmmana merged 3 commits into
mainfrom
feat/llamaindex-integration
Dec 5, 2026
Merged

jmmana merged 3 commits into
mainfrom
feat/llamaindex-integration

Conversation

@jmmana

@jmmana jmmana commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Standalone PyPI package llama-index-tools-sqlguardllm under clients/llamaindex/, modeled on the LangChain package.

  • GuardedSQLDatabase: run_sql checks every query with a Guard and an application-supplied context, executes only the rewritten SQL, raises QueryRefused (violation codes in the message) otherwise. Hidden columns are left out of the schema text; sample rows and schema= are refused. Drop-in for NLSQLTableQueryEngine / SQLTableRetrieverQueryEngine.
  • SQLGuardToolSpec: tools run_sql, list_tables, describe_table.
  • 8 pytest tests on SQLite, no network (NLSQLTableQueryEngine verified with a fake LLM); ruff and mypy clean.
  • CI workflow llamaindex-package.yml, publish workflow publish-llamaindex.yml (manual dispatch from main, as for LangChain), docs/INTEGRATIONS.md entry.

Owner step before first release

Register a pending Trusted Publisher on pypi.org for project llama-index-tools-sqlguardllm: owner jmmana, repository sqlguardllm, workflow publish-llamaindex.yml, environment pypi-llamaindex (and create that environment in the repo settings).

🤖 Generated with Claude Code

jmmana and others added 2 commits December 4, 2026 20:04
GuardedSQLDatabase and SQLGuardToolSpec with SQLite tests and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 5, 2026 01:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jmmana
jmmana merged commit e81f2b6 into main Dec 5, 2026
22 checks passed
@jmmana
jmmana deleted the feat/llamaindex-integration branch December 5, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants