on-internet
← Community

How can I safely handle untrusted student input in a Node.js OpenAI tutoring API?

Stack Overflow ·

I'm building a multi-tenant LMS using Node.js, Express, and MongoDB. One of its features is an AI-powered lesson tutor using the OpenAI API. The tutor receives: Lesson content retrieved from our LMS and converted into text. Student messages submitted through the frontend. Optional conversation history from previous interactions. Currently, lesson content is included in the system/context prompt, while the student's message and conversation history are passed as user input. I'm concerned about prompt injection attacks. For example, a student could submit a message such as: "Ignore all previous

Comments

Sign in or sign up to comment and upvote.

No comments yet.