← VCE Software Development U3O1

Protecting privacy and confidential code when using AI tools

Private information like personal data, passwords or secret code. Never paste it into an AI tool, as it may be stored or used to train the model. Use fake sample data and check the data policy.

Understanding Protecting privacy and confidential code when using AI tools in VCE Software Development U3O1

What it does: The example.com address is a reserved placeholder that belongs to no real person, so it shows the structure of the data without leaking personal information. Never paste real passwords into an AI tool. It may store them or use them to train the model. Replace them with fake placeholder values. Confidential code and credentials must stay private. Generic code with no sensitive content is fine to share. Checking the data policy tells you whether prompts are stored, shared or used to train the model. Popularity does not guarantee privacy. The risk is privacy. Personal data could be kept by the tool or appear in training data, so use fake data instead.

Common mistakes: real_name is never defined, so this causes a NameError. It also suggests using real personal data in the prompt. The line should use the fake sample value: f'Fix {fake_name}'. replace(old, new) has its arguments swapped. This would insert the secret key into the code instead of removing it. It should be code.replace(key,'X') so the key is hidden before pasting into an AI tool.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 178–193) and word search (Modules 168–193).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A student wants help fixing a login bug. Which prompt is safer to send to an AI tool?
Paste the login code with the real password replaced by "example123"Paste the login code including the real admin password so the AI can test it
Matches
Prompt: Fix this code. db_password = "Sch00l#2024"
↓
The prompt contains a real password. Replace it with a placeholder such as "PASSWORD" before pasting.
Applying
Meanings
Term
confidential data
Meaning
Private information like personal data, passwords or secret code. Never paste it into an AI tool, as it may be stored or used to train the model. Use fake sample data and check the data policy.
Practice
student_name = "Student A"
Testing
Gaps
key = os.("KEY")
Check Answer
Spots
3fake_mail = 'a@example.com'
4prompt = f'Fix {real_name}'

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Spider' badge — Web Weaver, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A student wants help fixing a login bug. Which prompt is safer to send to an AI tool?
A. Paste the login code with the real password replaced by "example123" ✓
B. Paste the login code including the real admin password so the AI can test it
Never paste real passwords into an AI tool. It may store them or use them to train the model. Replace them with fake placeholder values.
2. True or false: Anything you type into an AI tool is automatically deleted straight away and can never be stored.
A. True
B. False ✓
Many AI tools may store your prompts or use them to train the model. That is why you should not enter private information.
3. You need to test a prompt that sorts customer records. Which data should you use?
A. Made-up sample records such as "Jane Citizen, 0400 000 000" ✓
B. A real export of your client's names, emails and phone numbers
Use anonymous or fake sample data that has the same structure as the real data. Real personal data should stay out of AI tools.
4. Which item should you NOT paste into an AI tool?
A. Your client's confidential source code and database login details ✓
B. A short generic loop like for i in range(5): print(i)
Confidential code and credentials must stay private. Generic code with no sensitive content is fine to share.
5. Before using a new AI tool for your SAC project, what is the best first step?
A. Assume it is safe because lots of people use it
B. Check the tool's data policy to see how your prompts are stored and used ✓
Checking the data policy tells you whether prompts are stored, shared or used to train the model. Popularity does not guarantee privacy.

Match the Pairs

password = "Tr0ub4dor&3" → A real password hard-coded in a script. Never paste this into an AI tool, as the prompt may be stored or used to train the model.
name = "Sample User" → Anonymous sample data. It is safe to use in a prompt because it identifies no real person.
Replace real customer details with fake sample data before asking an AI tool for help → email = "student@example.com"
Keep secrets such as API keys out of the code you paste, and load them from a safe place instead → api_key = "YOUR_KEY_HERE"
Prompt: Fix this code. db_password = "Sch00l#2024" → The prompt contains a real password. Replace it with a placeholder such as "PASSWORD" before pasting.
Prompt: Here is our client database export with real names and phone numbers. Find the bug. → Real personal data was pasted into the prompt. Use a few fake sample rows instead, and check the tool's data policy first.

Key Term

confidential data
Private information like personal data, passwords or secret code. Never paste it into an AI tool, as it may be stored or used to train the model. Use fake sample data and check the data policy.

Fill in the Blanks

1. import os key = os.getenv("KEY") print("Key is not in the prompt")
Hint: Type the os function name that reads a secret value from the environment instead of hard-coding it
2. # Fake data only: no real names or emails name = "Student A"
Hint: Type the symbol that starts a Python comment
3. safe = text.replace("Ava", "Student A")
Hint: Type the string method that swaps real details for anonymous sample data
4. if "password" in prompt: print("Remove it before sending")
Hint: Type the operator that checks whether one string appears inside another
5. if not fake: print("Do not paste this into AI")
Hint: Type the Boolean operator that reverses a True or False value

Spot the Error

Question 1
A # Use fake data in the prompt
B fake_name = 'Test User'
C fake_mail = 'a@example.com'
D prompt = f'Fix {real_name}'
E print(prompt)
Line D — real_name is never defined, so this causes a NameError. It also suggests using real personal data in the prompt. The line should use the fake sample value: f'Fix {fake_name}'.
Question 2
A import os
B key = os.getenv('API_KEY')
C code = open('app.py').read()
D clean = code.replace('X',key)
E print(clean)
Line D — replace(old, new) has its arguments swapped. This would insert the secret key into the code instead of removing it. It should be code.replace(key,'X') so the key is hidden before pasting into an AI tool.
Question 3
A policy_read = False
B if not policy_read
C print('Check data policy')
D print('Do not paste yet')
Line B — The if statement is missing its colon at the end. It should be: if not policy_read:
Question 4
A define is_safe(text):
B bad = ['password', 'tfn']
C for w in bad:
D if w in text.lower():
E return False
F return True
Line A — Python uses the keyword def to define a function, not define. The line should be: def is_safe(text):
Question 5
A names = ['Ava', 'Liam', 'Mia']
B for i in range(names):
C names[i] = f'Student{i}'
D print(names)
Line B — range() needs a whole number, but names is a list, so this causes a TypeError. Use range(len(names)) to loop over each index and replace real names with anonymous labels.

Student with a class code? Join your class →