Repository navigation
sqlguardllm 0.3.0a1
Pre-release
Pre-release
Personal data protection, richer policies and a second security fix. New options are off by default: existing policies behave the same, except that percentage and WITH TIES limits are now capped.
Security
max_rowscould be bypassed with a percentage orWITH TIESlimit.SELECT TOP 50 PERCENT …(SQL Server),FETCH FIRST 50 PERCENT ROWS ONLY(Oracle) andFETCH FIRST n ROWS WITH TIESpassed unchanged, because sqlglot 30 keeps those flags inlimit_options. Such limits are now replaced with a plain limit ofmax_rows. Affects 0.1.0a1 to 0.2.0a2: upgrade. Found while buildingGuard.explain().
Added
masked_columns: a column can be selected but comes back masked (null,redact,hashas SHA-256 hex per dialect,partial), even inside functions orCASE; using it anywhere outside the select list ishidden_column. With the newschemaoption,*over such a table is expanded with the masks (#29).aggregate_only: {table: k}: the table can only be read through aggregates andGROUP BY(new codeaggregate_required), and the guard addsHAVING COUNT(*) >= kso no group smaller than k rows comes back (#30).PolicySet: abasepolicy androlesin one file (PolicySet.from_file), withextendsbetween roles,for_role()and a cachedguard()per role and language. A key set in a role replaces the inherited value; keys underaddextend lists and mappings. Cycles and unknown roles arePolicyError. Example inexamples/roles.yaml; JSON Schema inschema/policy-set.schema.json, printed bysqlguardllm schema --policy-set(#26).Guard.explain(sql, context): anExplanationwith the tables and columns a query reads, the masks, group sizes, row filters and limit it gets, its violations, and a sentence in English or Spanish for UIs and audit logs. Shares one pass withcheck()(#27).