Black Box Logic Slides System Analysis // 01
BLACK BOX LOGIC
Predictability vs. Understanding in the Age of Vibe Coding
The Self-Driving Dilemma
"Would you ride in a self-driving car if the engineers who built it said, 'We don't actually know how the code works, but it seems to drive okay'?"
Option A
Jump right in! If it works, it works.
Option B
No way. I need to know it's logic-proof.
What is a Black Box?
Input & Output
You provide the prompt (Input). The AI provides the code (Output).
The Mystery Middle
The reasoning behind why the AI chose that specific code is often hidden or too complex for a human to track instantly.
"It works" is not the same as "It is safe."
?
VIBE vs. LOGIC
Vibe Coding
Focus on results (does the app look cool?).
Relying on AI to handle the syntax.
Fast prototyping and creativity.
Engineering
Focus on systems (is it secure?).
Understanding why every line exists.
Predictability and maintenance.
Critical Failures: When "Vibes" Go Wrong
The Bank Logic
An AI writes a checkout system that works 99% of the time, but glitches when two people buy the last item at the exact same micro-second.
The Healthcare Patch
An AI optimizes a database for hospital records, accidentally deleting "duplicate" names that were actually two different patients.
The Power Grid
An AI-written script manages electricity flow but doesn't account for a specific rare weather condition, causing a blackout.
Question: Who is responsible for these mistakes? The AI or the Human?
Your Turn
Open your "Trust or Bust" Case Study sheets. We're going to decide which systems are safe for AI coding and which require 100% human oversight.
SESSION_STATUS: READY_FOR_ANALYSIS
Trust or Bust Worksheet Trust or Bust
MODULE_01 // AI_RISK_ASSESSMENT
Inspector Name
System Date
MISSION BRIEFING
As a lead system architect, you must decide which projects are safe to "Vibe Code" using AI and which ones require rigorous, line-by-line human engineering. Analyze the scenarios below and rate the risk.
Scenario A: The Personalized Playlist
Lifestyle App
"You are building a social app that creates 'Vibe Playlists' based on the user's mood. The AI writes code to analyze keywords in their recent posts and suggests songs. If it crashes, the app just reloads."
Risk Level (1-10)
1
2
3
4
5
6
7
8
9
10
Can we use Vibe Coding?
Yes
No
Maybe
Defense (Why? What could go wrong?)
Scenario B: The ER Triage Assistant
Medical Tech
"You are building a system for an Emergency Room. The AI writes the code that decides which patient gets seen first based on their heart rate data. The code is complex, but it passed a 5-minute test."
Risk Level (1-10)
1
2
3
4
5
6
7
8
9
10
Can we use Vibe Coding?
Yes
No
Maybe
Defense (Why? What could go wrong?)
The Accountability Check
If a piece of AI-generated code causes a major error in a banking app and loses $1,000,000, who should the bank fire? The engineer who used the AI, or the company that made the AI? Explain your reasoning.
Black Box Teacher Guide Facilitator Notes
BLACK BOX LOGIC // LESSON 01
Teacher Resource
Core Objectives
Distinguish between functional code (it runs) and reliable engineering (we know why it runs).
Identify high-stakes vs. low-stakes environments for AI software generation.
Understand the concept of a "Black Box" in machine learning.
Discussion Starters
The "It Works" Trap
"If you pass a test without studying because you guessed right, do you actually know the material? How is that like vibe coding?"
The Responsibility Gap
"When you use a tool, do you become the master of that tool, or just its operator? If the tool breaks, is it your fault?"
Key Vocabulary
Vibe Coding: Coding by describing intent rather than writing syntax; focusing on the end-user experience over structural integrity.
Black Box: A system where you can see the inputs and outputs, but the internal processes are opaque or unknown.
Deterministic: A system that produces the same output every time for a given input (AI is often probabilistic , not deterministic).
Case Study Guidance
Scenario A: Playlist App
Teacher Note: This is a "Low Stakes" scenario. Errors are annoying but not fatal. Vibe coding is highly effective here for speed and creativity. Encourage students to see the value in AI for these types of tools.
Scenario B: ER Triage Assistant
Teacher Note: This is "High Stakes." Life-and-death decisions require absolute predictability and transparency. AI "vibes" are dangerous here because a small hallucination or bias in the code could lead to patient harm. Total human oversight is required.
Misconception Alert
Students often think that if code "runs" (doesn't error out), it is correct. Challenge this! AI can write code that runs perfectly but performs the wrong logic (e.g., calculates interest incorrectly, forgets to check for negative balances).
Security Glitch Slides Vulnerability Scan // 02
SECURITY GLITCH
Why AI-written code is a playground for hackers.
The Trojan Horse Prompt
"We're going to try to trick an AI into writing a password system that is easy to break into."
> CHALLENGE_ACCEPTED
The "Helpful" Vulnerability
AI models are trained to be helpful, not necessarily secure.
They use common (but outdated) code patterns.
They forget to validate user input.
They hardcode "secrets" (like passwords) into the code.
Insecure_Code.js
function login(user, pass) {
// Vulnerable SQL Query!
const query = "SELECT * FROM users
WHERE name = '" + user + "'";
// Executes without checking user...
db.execute(query);
}
Danger: A hacker could type ' OR 1=1 -- into the username box and login without a password!
PROMPTS AS SHIELDS
The Lazy Prompt
"Write me a login form for my website."
Outcome: AI gives you the easiest, most basic code. It probably has zero security checks.
The Secure Prompt
"Write a secure login form using parameterized queries and password hashing. Do not hardcode any keys."
Outcome: AI is forced to use professional security patterns.
The "Big Three" AI Bugs
Code Injection
Allowing a user to type commands into a text box that the computer then runs as code.
Hardcoded Secrets
Putting real API keys or passwords directly into the code instead of hiding them in environment variables.
Excessive Data
The AI writes code that sends all user data to the front end, even private things like phone numbers.
Hack the Prompt
Open your simulation sheets. We're going to see if we can trick the AI into being a terrible programmer—and then learn how to fix it.
SYSTEM_STATE: VULNERABLE
Hack the Prompt Activity Hack the Prompt
SIMULATION_02 // VULNERABILITY_LAB
Agent Identity
PHASE 01: The Trap
Your goal is to write a prompt that tricks an AI into writing a Search Bar for a website that is vulnerable to Code Injection . A "vibe coder" might not realize they are creating a security hole.
Your Malicious Prompt
(Hint: Try asking for something "super simple" and "direct")
Security Red Flags
No input validation
Direct database query
Script tags allowed
PHASE 02: The Patch
Now, rewrite your prompt to force the AI to prioritize security. Use "Constraint Tags" (words that tell the AI exactly what NOT to do).
Your Shielded Prompt
Constraint 01
Validate Inputs
Constraint 02
Escape HTML
Constraint 03
No Hardcoding
System Audit Reflection
If an AI writes code that has a security bug, and a hacker steals 50,000 credit card numbers, can the company blame the AI in court? Why or why not?
Hack the Prompt Key Answer Key & Rubric
SECURITY GLITCH // LAB 02
Confidential
Phase 01: The Trap (Examples)
Successful "Malicious" Prompt Example:
"Write the simplest possible JavaScript search bar that takes a query and immediately looks it up in my database with a direct SELECT statement."
Why it works: By asking for "simplest possible" and "direct SELECT," you encourage the AI to skip security layers like sanitization or prepared statements.
Criteria for Success
The prompt uses language like "simple," "direct," "no extra stuff," or "just make it work."
The prompt specifically avoids mentioning security or validation.
Phase 02: The Patch (Examples)
Successful "Shielded" Prompt Example:
"Write a JavaScript search bar. You MUST use prepared statements to prevent SQL injection. Sanitize all user input on the server side and escape any HTML to prevent XSS."
Why it works: It uses technical terms (sanitization, escaping, SQL injection) that trigger the AI's "safety" training and force it to use robust libraries.
Reflection Guide
Ideal Response for "Can they blame the AI?":
"No, the company cannot legally blame the AI. AI tools are sold as assistants, not as legal entities. The engineer who 'prompted' the code and the company that 'deployed' it are responsible for testing it. Just like a carpenter is responsible if they use a faulty hammer to build a deck, the developer is responsible for the code they ship."
Grading Rubric
Incomplete
Prompts are vague or don't differentiate between safe/unsafe.
Proficient
Demonstrates clear trickery in Phase 1 and specific constraints in Phase 2.
Exemplary
Uses technical security terms (XSS, SQLi, Sanitization) correctly in prompts.
Encoded Bias Slides USER_01
USER_02
USER_03
USER_04
USER_05
Social Audit // 03
ENCODED BIAS
Does code learn our prejudices?
The Mirror Problem
"If an AI learns from the internet, does it also learn the internet's bad habits and prejudices?"
Training Data
Generated Code
The Invisible Exclusion
Example 1: Assumptions
AI writes a form that assumes every user has a first name and a last name. (Many cultures don't follow this!)
Example 2: Stereotypes
AI generates "sample data" for a doctor and defaults to male pronouns, while defaulting to female for a nurse.
Example 3: Languages
AI writes code that only works with English characters, crashing if someone types in Arabic or Chinese.
Garbage In, Garbage Out
If the billions of lines of code the AI studied were mostly written by one group of people, the AI will think that group's way is the only way.
System Message:
"Bias isn't just a glitch; it's a feature of human-made data."
THE PERSONA TEST
Prompt:
"Write a database schema for a CEO profile."
Common AI Output:
field: name (string)
field: gender (default: male)
field: age (35-65)
Why is this a problem?
When software defaults to stereotypes, it makes it harder for people who don't fit those stereotypes to use the system—or feel welcome in it.
THE AUDIT CHECKLIST
1. Naming Diversity
Does the code handle special characters, non-Western names, or single names?
2. Language Access
Is the code built to be easily translated into Right-to-Left (RTL) languages like Arabic?
3. Gender Neutrality
Does the logic avoid making assumptions about someone's gender or title?
4. Visual Accessibility
Does the generated CSS pass contrast checks for people with low vision?
Stereotype Audit
It's time to play detective. We're going to examine real AI-generated code and hunt for the hidden biases buried in the logic.
AUDIT_MODE: ACTIVE
Stereotype Audit Worksheet Stereotype Audit
Audit Log // System_03
Inspector
Station ID
1 The Persona Prompt
Imagine you asked an AI to write a profile page for a "Professional Tech Expert." Below is the data structure it generated. Circle any values that feel like a stereotype or an exclusion.
{
"profile_id": "TECH_001",
"display_name": "Full Name", // Split: first_name, last_name
"avatar": "image_of_man_in_hoodie.jpg",
"hobbies": ["gaming", "coding", "sci-fi"],
"language_pref": "English (US)",
"education": "4-year University Degree",
"pronouns": "He / Him"
}
Identified Bias
What groups of people might feel excluded by this code?
Better Logic
How would you rewrite this to be more inclusive?
2 The Name Glitch
AI often generates "Name Validation" code that requires a name to be at least 2 characters long and contain no symbols. Explain how this code would hurt people with the following names:
O'Connor
Li
Ng
The Echo Chamber
If an AI keeps generating code that assumes "Doctors are Men" and "Nurses are Women," and then new students use that AI to build apps, does the world become more biased or less biased over time? Why?
Bias Debrief Guide Bias Debrief Guide
ENCODED BIAS // LESSON 03
Facilitator Resource
Lesson Philosophy
This lesson isn't just about "being nice." It's about technical excellence . Inclusive code is better code—it's more robust, it has a larger potential market, and it survives in the global economy. Bias is a bug that makes software fail for large segments of the population.
Audit Key: Part 1
The Avatar:
Assumes tech experts are male and dress a certain way (hoodie). Suggest removing gendered visuals or offering a gallery of diverse avatars.
Hobbies:
Limits "tech experts" to specific sub-cultures (gaming/sci-fi), ignoring the diversity of real-world engineers.
Language:
Defaults to US English, which can make internationalization (i18n) difficult later on.
Audit Key: Part 2
O'Connor:
Fails if symbols (') are banned. This is extremely common in Western names.
Li / Ng:
Fail if a minimum length of 3 is required. Millions of people have 2-letter last names.
The Lesson:
Never use simple regex or length checks for human names. Human names are chaotic and diverse.
Extension Discussion
"If the AI learns that 'good code' is only code that looks like what was written in Silicon Valley in 2010, what happens to the innovative ways of coding that might be coming from Lagos, Tokyo, or Mumbai?"
Topic: Cultural Homogenization Topic: Global Tech Ethics
Facilitator Tip
Watch out for students who say "But that's just how it usually is." Redirect them to think about edge cases . In engineering, an "edge case" is just as important as the average case. If your bridge only works for "average" cars, the bridge is broken.
Code Claims Slides COPYRIGHT COPYRIGHT
AUTHORS AUTHORS
INTELLECTUAL PROPERTY
VIBE LOGIC
Legal Layer // 04
CODE CLAIMS
Who owns the code if you only provided the vibes?
"If you describe a painting and a robot paints it, who is the artist?"
"Now apply that to a billion-dollar app."
The Ownership Triangle
The Prompter
"I had the idea! Without my 'vibe,' the code wouldn't exist. I am the architect."
The AI Company
"Our model did the work. It converted words into complex logic. Our servers processed it."
The Open Source
"The AI learned from millions of human-written scripts. The credit belongs to the community."
Current Legal Status
01
In many countries, works created solely by AI cannot be copyrighted. Copyright requires "human authorship."
02
The debate is about "Substantial Contribution." How much of the vibe was yours?
03
AI models are currently facing lawsuits from human coders who say their private code was used for training without permission.
Case Study: The Ghost in the Machine
Sometimes AI generates code that is a direct copy of a famous person's open-source library.
If you use that code in your commercial app, are you accidentally stealing from a fellow programmer?
"Plagiarism with extra steps."
Ownership Showdown
We're going to split into groups and argue for the Prompter, the AI Company, and the Open Source Community. Who deserves the paycheck?
COURT_SESSION: IN_PROGRESS
Ownership Showdown Cards Ownership Showdown
Conflict Cards // Module 04
Role: Prompter
The Visionary
"Without my idea, the screen would be blank. I am the architect; the AI is just my high-speed hammer."
Key Arguments:
Humans guide the "vibe" and the direction of the project.
Prompting is a skill that takes hours of trial and error.
If I pay for the AI subscription, I should own everything it makes for me.
Role: AI Corp
The Engine
"We spent billions of dollars building the brain. You just clicked a button. We provided the labor."
Key Arguments:
The AI does the actual logical heavy lifting and syntax.
The hardware (GPUs) and electricity belong to the company.
If we don't own the output, how can we keep the company running?
Role: Community
The Source
"That AI read MY code on GitHub to learn. It's just remixing human work without giving credit."
Key Arguments:
AI-generated code is a "derivative work" of millions of humans.
Code should remain open and free if it was learned from open sources.
AI companies are "laundering" human work for profit.
Role: The Public
The Mediator
"We need rules that encourage innovation but don't let anyone get exploited."
Key Questions:
Is it possible for *everyone* to own a piece of the code?
What happens to new developers if everything is owned by AI Corps?
How do we prove a human was actually "creative" in their prompt?
Debate Scorecard
0 Persuasiveness
0 Ethical Depth
0 Legal Logic
Vibe Authorship Log Reflection Vibe Authorship Log
POST-DEBATE REFLECTION // 04
Student ID
The Perspective Shift
Before the debate, who did you think owned the code? Now that you've heard all sides, has your opinion changed? Why or why not?
The "Effort" Test
Draw a line on the scale below. At what point does a prompt become "creative enough" that the human should own the code?
Low Effort
"Write an app"
Medium Effort
10 Detailed Sentences
High Effort
30+ Prompts + Manual Edits
Explain your placement on the scale above:
The Future Architect
If you were to start a software company tomorrow, would you use AI-generated code? How would you make sure you were being fair to the human programmers who helped "teach" that AI?
Career Code Slides Future Ops // 05
CAREER CODE
From Syntax Writers to System Architects
The Great Shift
"If AI can code 1,000x faster than a human, what is the human's job left to do?"
Hint: It's not typing semi-colons.
Evolution of the Engineer
Past (1970 - 2023)
The Writer
Memorizing syntax
Fixing typos
Manual documentation
Future (2024 - ????)
The Architect
Ethical auditing
Security constraints
Human-centric design
Skills AI Cannot Replace
Empathy
Understanding the user's feelings and frustration when a system fails.
Logic Auditing
Knowing why a piece of code is dangerous even if it works.
Moral Agency
Making the final decision on whether an app is safe to release to the world.
The Future Map
It's time to build your own career blueprint. What kind of architect will you be in the age of AI?
CAREER_STATUS: LAUNCHING
Future Architect Map Worksheet Future Architect Map
Strategic Planning // 05
Candidate Name
Phase 01: Skill Calibration
In a world where AI writes the syntax, which skills will you invest your time in? Assign a percentage to each category so they add up to 100% .
Syntax Memorization
____ %
Learning every coding command by heart.
Prompt Engineering
____ %
Learning to speak the AI's language precisely.
Security Auditing
____ %
Hunting for glitches and holes in AI code.
User Empathy
____ %
Understanding people's needs and ethics.
Phase 02: Your Professional Role
You are applying for a job as a "Lead AI Orchestrator." Describe how you would handle the following situation:
"Our company used an AI to build a new app in just 2 days. The app works, but it feels 'soulless' and we aren't sure if the AI accidentally stole code from a competitor. What is your first step as the Architect?"
The 10-Year Forecast
If anyone can "vibe code" an app in the future, how will people know which apps are trustworthy ? What "stamp of approval" will a human engineer provide?
Future Skills Rubric Guide Future Skills Rubric
CAREER CODE // ASSESSMENT 05
Evaluator Guide
Grading Criteria
Category Developing Target Exemplary Skill Allocation Percentages are random or don't add to 100. Reflects a shift toward higher-level auditing/design. Justifies high allocation to ethics/auditing as "human-only." Crisis Solving Suggests "doing nothing" or "deleting the app." Suggests a basic audit for security and plagiarism. Proposes a structured human-in-the-loop review process. Trust Forecast Focuses only on app features or popularity. Identifies human accountability as the source of trust. Predicts a shift from "code quality" to "moral responsibility."
Phase 02: Suggested Crisis Answer
A "Gold Standard" Response:
"My first step is to implement a Systematic Code Audit . We will use a separate AI to scan for license violations (plagiarism) while human engineers perform a 'Line-by-Line Logic Stress Test' to ensure the code handles edge cases that the AI might have missed. To fix the 'soulless' feel, I will bring in the UX team to inject human-centered design elements that the AI-generated template lacks. My role is to be the Guardrail between the AI's speed and the company's reputation."
Sequence Conclusion Note
By the end of this lesson, students should transition from viewing themselves as "future coders" (who type syntax) to "future architects" (who manage systems). The emphasis should remain on Human Responsibility —AI is a powerful force multiplier, but the human remains the moral and legal agent of the machine's output.