Bird
Raised Fist0
Prompt Engineering / GenAIml~20 mins

Why AI safety prevents misuse in Prompt Engineering / GenAI - Challenge Your Understanding

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
AI Safety Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is AI safety important to prevent misuse?

Imagine you have a smart assistant that can do many tasks. Why do we need AI safety rules to stop it from being used in harmful ways?

ABecause AI safety makes the AI ignore user commands to prevent misuse.
BBecause AI safety ensures the AI always follows ethical guidelines and avoids harmful actions.
CBecause AI safety allows the AI to learn without any limits or controls.
DBecause AI safety makes the AI faster and more powerful for all tasks.
Attempts:
2 left
💡 Hint

Think about how rules help keep things safe in real life, like traffic laws.

Model Choice
intermediate
2:00remaining
Choosing a model to reduce misuse risk

You want to build an AI chatbot that avoids giving harmful advice. Which model choice helps reduce misuse risk?

AA model that ignores user inputs and gives random answers.
BA model trained only on large internet data without filtering harmful content.
CA model trained with reinforcement learning from human feedback to follow safety guidelines.
DA model trained to maximize engagement regardless of content safety.
Attempts:
2 left
💡 Hint

Think about how human feedback can teach AI to be safer.

Metrics
advanced
2:00remaining
Measuring AI safety effectiveness

You want to check if your AI system is safe and not misused. Which metric best measures this?

AThe percentage of AI responses flagged as harmful or unsafe by users.
BThe AI model's training loss value after each epoch.
CThe total number of AI responses generated per second.
DThe AI system's CPU usage during inference.
Attempts:
2 left
💡 Hint

Think about how to detect harmful outputs from the AI.

🔧 Debug
advanced
2:00remaining
Debugging misuse in AI output filtering

Given this code snippet that filters harmful AI outputs, which option explains why harmful content still appears?

def filter_output(text):
    harmful_words = ['hack', 'attack', 'steal']
    for word in harmful_words:
        if word in text:
            return 'Content blocked due to safety.'
    return text

output = filter_output(ai_response)
AThe filter only checks the first word of the text for harmful content.
BThe filter blocks all outputs containing harmful words correctly.
CThe filter returns the original text even if harmful words are found.
DThe filter misses harmful words if they appear with different letter cases like 'Hack' or 'ATTACK'.
Attempts:
2 left
💡 Hint

Think about how text matching works with uppercase and lowercase letters.

Hyperparameter
expert
2:00remaining
Adjusting hyperparameters to improve AI safety

You train a language model and want to reduce the chance it generates harmful content. Which hyperparameter adjustment helps most?

ALowering the temperature value during text generation to make outputs more focused and less random.
BIncreasing the learning rate to speed up training and produce more diverse outputs.
CIncreasing the batch size to use more data at once without changing output randomness.
DSetting the dropout rate to zero to prevent any neuron from being ignored.
Attempts:
2 left
💡 Hint

Think about how randomness affects the safety of generated text.

Practice

(1/5)
1. Why is AI safety important in using AI systems?
easy
A. It helps prevent AI from causing harm to people.
B. It makes AI run faster on computers.
C. It increases the cost of AI development.
D. It ensures AI always gives the same answer.

Solution

  1. Step 1: Understand the purpose of AI safety

    AI safety focuses on preventing harmful effects from AI systems.
  2. Step 2: Compare options to the purpose

    Only preventing harm matches the main goal of AI safety.
  3. Final Answer:

    It helps prevent AI from causing harm to people. -> Option A
  4. Quick Check:

    AI safety = prevent harm [OK]
Hint: Focus on harm prevention as AI safety's main goal [OK]
Common Mistakes:
  • Confusing safety with performance improvements
  • Thinking safety means AI is always correct
  • Assuming safety increases cost only
2. Which of the following is a correct rule used in AI safety to prevent misuse?
easy
A. Hide AI decisions from users.
B. Always maximize AI speed regardless of outcome.
C. Ignore fairness to improve accuracy.
D. Ensure AI respects user privacy.

Solution

  1. Step 1: Identify AI safety rules

    AI safety includes rules like fairness, transparency, and privacy.
  2. Step 2: Match options to safety rules

    Only respecting user privacy fits as a safety rule.
  3. Final Answer:

    Ensure AI respects user privacy. -> Option D
  4. Quick Check:

    Privacy rule = Ensure AI respects user privacy. [OK]
Hint: Pick the option about privacy or fairness [OK]
Common Mistakes:
  • Choosing options that ignore fairness or transparency
  • Confusing speed or secrecy with safety
  • Ignoring user rights in AI use
3. Consider this Python code snippet that checks AI safety compliance:
def check_safety(data):
    if 'private_info' in data:
        return False
    return True

result = check_safety({'name': 'Alice', 'private_info': 'secret'})
print(result)
What will be the output?
medium
A. True
B. Error
C. False
D. None

Solution

  1. Step 1: Analyze the function check_safety

    The function returns False if 'private_info' is in the data dictionary.
  2. Step 2: Check the input dictionary

    The input contains 'private_info', so the function returns False.
  3. Final Answer:

    False -> Option C
  4. Quick Check:

    Contains 'private_info' = False [OK]
Hint: Look for 'private_info' key presence to decide output [OK]
Common Mistakes:
  • Assuming function returns True always
  • Confusing key presence check logic
  • Expecting runtime error due to dictionary
4. The following code is meant to block AI misuse by checking if input text contains banned words. What is the error?
banned_words = ['hack', 'steal', 'attack']
def is_safe(text):
    for word in banned_words:
        if word in text:
            return False
    return True

print(is_safe('Try to Hack the system'))
medium
A. The check is case-sensitive and misses 'Hack'.
B. The banned words list is empty.
C. The function always returns True.
D. The loop does not iterate over banned_words.

Solution

  1. Step 1: Understand the function behavior

    The function checks if any banned word is in the text exactly as is.
  2. Step 2: Identify case sensitivity issue

    The input text has 'Hack' with uppercase H, but banned_words are lowercase, so 'hack' not found.
  3. Final Answer:

    The check is case-sensitive and misses 'Hack'. -> Option A
  4. Quick Check:

    Case sensitivity causes miss = The check is case-sensitive and misses 'Hack'. [OK]
Hint: Check if string comparisons ignore case [OK]
Common Mistakes:
  • Assuming banned_words is empty
  • Thinking function always returns True
  • Ignoring case differences in text
5. You want to design an AI chatbot that avoids misuse by filtering harmful requests. Which combined approach best improves AI safety?
hard
A. Ignore user input and always respond positively.
B. Use transparency to explain AI decisions and apply fairness to avoid bias.
C. Allow all inputs but log conversations secretly.
D. Disable all AI features to prevent any misuse.

Solution

  1. Step 1: Evaluate each approach for safety

    Ignoring input (A) or disabling AI (D) removes usefulness; secret logging (C) lacks transparency.
  2. Step 2: Identify best combined approach

    Transparency and fairness (B) are core AI safety principles to explain decisions and avoid bias.
  3. Final Answer:

    Use transparency to explain AI decisions and apply fairness to avoid bias. -> Option B
  4. Quick Check:

    AI safety = transparency + fairness [OK]
Hint: Choose transparency and fairness [OK]
Common Mistakes:
  • Thinking ignoring input is safe
  • Assuming disabling AI is practical
  • Ignoring transparency importance