4 ms·
What sort of safeguards do you have to prevent the LLM from emitting sql queries that edit the data?
by doctoboggan 3y ago
What sort of safeguards do you have to prevent the LLM from emitting sql queries that edit the data?
- mx_02 3y agoIsnt that as easy as giving a non-write user to the app?
- alishobeiri 3y agoThis is another way to make sure that the app doesn't overstep it's permissions, It's still very valid feedback, on our side we should make the permissions of each user very clear and make it clearer that we only do select queries. Will make sure to make those changes! Thanks for the feedback!
- queuep 3y agoThis reply gives me a bit of anxiety. Solving this should have been one of the most important things regarding something like this
- NicoJuicy 3y agoObviously, generating queries from natural language should be the most important thing And providing the user interface to do that
- vore 3y agoI think I would be okay with not having the ability to generate queries from natural language if it came with the possibility of my data randomly getting clobbered!
- gampleman 3y agoSurely you wouldn't give a third party analytics app write access to your prod DB? It would be a nice UX improvement if the app checked the permissions and gave you instructions on how to set the permissions properly, but this seems to be entirely at the level of setting it up correctly.
- alishobeiri 3y agoSo the way that we enforce it, is that we only generate SELECT queries, and do a post process verification to make sure that the result is actually only a read-only query. I think you have a great point though, this should be made much clearer so users can build trust in using the product. Thanks a lot for the feedback!
- panarky 3y agoWhat safeguards prevent the LLM from generating Cartesian products?
- e12e 3y ago> So the way that we enforce it, is that we only generate SELECT queries, and do a post process verification to make sure that the result is actually only a read-only query. So it will select from functions? CREATE OR REPLACE FUNCTION delete_all_from_table(_tbl regclass) RETURNS integer AS $func$ DECLARE _r record; _count integer = 0; BEGIN FOR _r IN EXECUTE format('DELETE FROM %s RETURNING *', _tbl) LOOP _count := _count + 1; END LOOP; RETURN _count; END $func$ LANGUAGE plpgsql; SELECT delete_all_from_table('users');