Skip to content

feat(sqlite): add fine-grained permission configuration for tools#5

Merged
adlio merged 1 commit intomainfrom
feature/sqlite-fine-grained-permissions
Feb 25, 2026
Merged

feat(sqlite): add fine-grained permission configuration for tools#5
adlio merged 1 commit intomainfrom
feature/sqlite-fine-grained-permissions

Conversation

@adlio
Copy link
Owner

@adlio adlio commented Feb 21, 2026

Summary

  • Add SqliteConfig with a builder pattern for restricting SQLite tool access to specific databases and tables via allow/deny lists for read and write operations
  • Add configured tool wrappers (ConfiguredReadQueryTool, ConfiguredWriteQueryTool, ConfiguredSchemaQueryTool, ConfiguredBulkInsertTool) that enforce permissions at query time
  • Add a lightweight SQL parser (using sqlparser crate) to extract table operations from queries for permission checking
  • Comprehensive test coverage for config, configured tools, and SQL parsing

Test plan

  • Unit tests pass for SqliteConfig builder and permission checks
  • Unit tests pass for configured tool wrappers (permission enforcement)
  • Unit tests pass for SQL parser table extraction
  • Verify cargo build --features sqlite compiles cleanly

🤖 Generated with Claude Code

Add support for restricting SQLite tools to specific databases and tables
with separate read/write permissions. This enables tighter security controls
when exposing database tools to agents.

- Add SqliteConfig with builder pattern for configuring permissions
- Support AllowList/DenyList modes for table-level read/write access
- Add SQL parser using sqlparser crate to extract table operations
- Create ConfiguredXxxTool wrappers that enforce permissions
- Add factory functions: tools_for_database(), read_only_tools_for_tables()
- Validate empty deny lists at build() time with Result-based error handling
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 86.78756% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.55%. Comparing base (8fb9f91) to head (ffd53c4).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
mixtape-tools/src/sqlite/sql_parser.rs 73.36% 57 Missing ⚠️
mixtape-tools/src/sqlite/configured.rs 90.94% 25 Missing ⚠️
mixtape-tools/src/sqlite/config.rs 90.33% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
- Coverage   88.61%   88.55%   -0.06%     
==========================================
  Files         101      104       +3     
  Lines       23022    23794     +772     
==========================================
+ Hits        20401    21071     +670     
- Misses       2621     2723     +102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adlio adlio merged commit 19949bd into main Feb 25, 2026
14 checks passed
@adlio adlio deleted the feature/sqlite-fine-grained-permissions branch February 25, 2026 02:56
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.

1 participant