- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
AI & Machine Learning Using AI APIs Safely Quiz
Building on an AI API brings new risks, from prompt injection to leaked keys and unsafe output. This quiz checks the practical security habits developers need, including handling secrets and personal data, rate limits, and treating model output as untrusted input.
Sample question
Question 1 of 10What is prompt injection?
Show the answer
B. Untrusted text (from a user, web page, email or file) containing instructions that try to override the app's own instructions Models read instructions and data as one stream of text, so text like "ignore previous instructions" can hijack behaviour. When it hides inside content the model processes, like a web page, it is called indirect prompt injection.
What this quiz covers
- Direct and indirect prompt injection, and limiting what tools can do
- Keeping API keys on the server and rotating leaked keys
- Minimizing personal data (PII) sent to providers
- Handling rate limits and controlling cost
- Validating and escaping model output before using it
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.