Integrating an AI-based chatbot with a database requires careful handling to avoid security risks such as prompt injection. A method is described to authenticate users and provide AI access to only the information the user is permitted to see. OpenAI's Function Calling (introduced in June 2023) is leveraged for this purpose,
Table of contents
Solution: Give the AI a process to ask for the information it wantsAn actual exampleFootnotesSort: