PTENES
MODULE 1.3

🛠️ Machine — How to Build and Operate

Boring is beautiful. Learn to build AI pipelines like assembly lines: each block does one job, each output is validated before the next, and the whole system can be shut down without guilt.

7
Topics
40
Minutes
🟢
Beginner
🔨
Practice
INPUT your raw data Block 1 deterministic parse / format AI Block 1 specialized task copy / reasoning / classification. ✓ Validate before moving on Block 3 deterministic submission / store OUT PUT → run → confirm → validate real output → chain Assembly Line — Lego Pipeline zero-AI steps first · 1 input / 1 output per block · AI only where it adds value

Lego Principle + Assembly Line: modular blocks, validation at every link, AI only where needed

Detailed content

1

Lego Principle — Smallest Possible Step

Each block in your system should have exactly 1 input and 1 output. The output of block 1 is the input of block 2. This modularity isn’t just elegant—it’s the difference between a system you understand and one that controls you.

🧱 Core Principle

Start with the zero-AI steps — deterministic tasks. If you can do it with simple code (parsing, validation, formatting), do it that way. AI only comes in where it genuinely adds value. This reduces cost, latency, and points of failure.

Modularity
Each block can be swapped out without affecting the others
Freedom
Switch models, providers, or logic by block
Simple debugging
Problem in block 2? Isolate and fix only that one

✓ What to DO

  • ✓1 input → transformation → 1 output per block
  • ✓Name blocks by what they do (“classifies intent,” “formats response”)
  • ✓Keep blocks small enough to test in isolation
  • ✓Document the I/O contract for each block

✗ What NOT to do

  • ✗Create a "mega prompt" that handles parsing + reasoning + formatting + sending
  • ✗Blocks with 3+ simultaneous inputs from different sources
  • ✗Using AI where deterministic code works just as well
  • ✗Don’t document the expected output schema
🧱
1 I/O per block
🔌
Composability
⚡
Zero AI first
🔧
Replaceable
2

Assembly Line — Specialization by Call

Don’t build a generalist. An AI call should do ONE specialized job: write copy, reason about data, or classify intent. Mixing them makes the system difficult to debug and improve.

📊 Why specialization wins

Specialized model
  • • Shorter prompt → lower cost
  • • Direct evaluation: output right or wrong
  • • Switch models without rewriting everything
  • • Fine-tuning possible on an isolated task
General-purpose model (anti-pattern)
  • • Huge prompt → cluttered context
  • • Failure in A → affects B and C
  • • Impossible to replace only the bad part
  • • High latency for simple tasks

💡 Practical Tip

If you need to change the prompt because the classification got worse; you shouldn’t need to revalidate the part about formatting. If both are at the same step, you go. Separate them.

🎯
1 task/call
🔀
Model switching
🐛
Isolated debugging
💰
Optimized cost
3

Validation Chain — Validate Before Chaining

Don’t build the entire pipeline and test it at the end. Validate each block’s output before connecting the next one. Block 1 → run → confirm → block 2 with the real output → confirm → connect them.

🔗 The safe chaining protocol

→ block1(input_raw) # run only block 1
→ assert output_b1 matches schema # VALIDATE now
→ block2(output_b1) # connect only afterward
→ assert output_b2 matches schema # VALIDATE again
→ block3(output_b2) # chain with confidence
# Never: block1 → block2 → block3 → test everything at the end

✓ Correct Validation Chain

  • ✓Run each block with real data before connecting it
  • ✓Defines the expected output schema (JSON schema, regex, enum)
  • ✓Fail fast and explicitly at every link
  • ✓Uses real output (not a mock) to test the next block

✗ Frequent anti-pattern

  • ✗Build the complete pipeline and test at the end
  • ✗Using mocked data to simulate the intermediate output
  • ✗Assuming that "if block 1 works, block 2 will work"
  • ✗No schema defined → you don’t know what to validate
✅
Validate each block
📋
Output schema
🎯
Real data
⚡
Fail fast
4

Iteration Mindset — There Is No Finished Product with AI

Deterministic scripts CAN be “ready.” AI steps are always evolving—the model improves, the context changes, and real-world use reveals edge cases. Perfectionism is the enemy of deployment. Ship the POC, then expand based on real-world use.

🚀 The POC-first rule

A production AI system running at 70% quality and generating real data teaches you more in 1 week than 2 months of offline iteration. Real-world use reveals what the test environment never will.

✓ Iteration Mindset

  • ✓Get the POC up as soon as possible and observe real-world usage
  • ✓Improve based on production data, not assumptions
  • ✓Accepts that AI steps are never "complete"
  • ✓Prompt versioning as code

✗ Paralyzing perfectionism

  • ✗Weeks iterating offline before the first deploy
  • ✗"It needs to be 100% complete before going to production"
  • ✗Measure quality only with artificial benchmarks
  • ✗Treating a prompt as final code without version control
🔄
I always improve
📦
POC first
📊
Real data
🗂️
Version your prompts
5

Bike Method — 4-Phase Rollout

Even a system with 90% confidence should start with 10% of the volume. The Bike Method defines four phases of increasing autonomy—and you only move forward when the data justifies it.

🚲 The 4 phases of autonomy

Thresholds: high confidence → auto, medium → draft queue, low → human

1

🚼 Training Wheels — Manual with Full Supervision

Phase 1

The system generates it; you execute it or fix it by hand.

You validate 100% of the outputs. The goal is to understand where the system makes mistakes before letting go of control. Never skip this phase.

2

🧑‍🏫 Guided — It runs, but you review everything

Phase 2

The system drafts; you approve before sending.

Drafts but doesn’t send. You review each item before it goes to production. Start with 10% of the volume even in Phase 2.

3

👁️ Monitored — Autonomous with Active Monitoring

Phase 3

The system runs; you monitor it + alerts are configured.

Alerts and dashboards are active. You still review a regular sample—not only when something breaks. Alerts don’t replace periodic reviews.

4

🙌 Hands-Free — Autonomous with Periodic Review

Phase 4

Confidence established in historical data.

Review the logs every two weeks/monthly. The system is in "reliable production" — but it’s still evolving (Iteration Mindset). Periodic review is sacred.

🚼
Training wheels
🧑‍🏫
Guided
👁️
Monitored
🙌
Hands-Free
6

Intern Rule — Treat AI Like a Contractor on Day 1

"You wouldn’t trust your bank account to someone you just met." Treat AI exactly like a new hire: its own identity, read-only by default, no personal credentials, and a complete audit trail.

🧑‍💼 Contractor permissions checklist

# Intern Rule — minimum permissions (scope always)
✓ distinct identity # dedicated email/account, not your personal account
✓ read-only by default # write only when explicitly necessary
✓ never impersonates you # sign as "[name]'s AI assistant"
✓ without personal credentials # it doesn't have access to your password/bank account
✓ audit trail # log everything the agent does and decides
✓ permissions with mín. scope # only what's needed for the specific task
✗ unrestricted access # even if you "trust the model"

🔑 Why this matters now

AI agents with broad access to email, calendars, and systems can cause irreversible harm with a single lapse in judgment. The safeguard isn’t distrust—it’s responsible architecture. Least privilege is an industry standard for any autonomous system.

🪪
Own identity
🔒
Read-only default
📝
Audit trail
🎯
Minimum scope
7

Kill Switch + Governing Principles

If an automation constantly needs patches, produces low quality, or costs more than it saves: dismantle it. No sunk cost. Three core principles govern all of the Machine’s decisions.

🔴 Caution — sunk cost is a trap

"I’ve already invested 3 weeks in this automation" is no reason to keep it running when it costs more than it delivers. The time invested doesn’t recover — only future value counts. If the signals below appear: dismantle it without guilt.

  • ⚠You spend more time fixing the automation than using it
  • ⚠Output quality is consistently below the threshold
  • ⚠The cost (time + money + stress) outweighs the benefit generated

⚖️ The 3 Governing Principles

1

Boring is beautiful

The most reliable system isn’t the most sophisticated—it’s the most predictable. Resist the temptation to add complexity. If a regex works, use a regex. If a simple script works, use a simple script.

⚠ Warning: complexity for aesthetics is technical debt in disguise
2

Deterministic steps are finite; AI steps keep evolving

Treat your AI blocks like living organisms — they need periodic review. Deterministic blocks can have an SLA of "works until the schema changes." AI blocks need review even when the code hasn’t changed.

⚠ Warning: a model updated by the provider can change behavior without you touching the code
3

Fail fast, learn faster

Fast failures in a controlled environment are cheap. Slow failures in production are expensive. Design your systems to fail explicitly and early — with clear error messages, detailed logs, and breakpoints.

⚠ Warning: systems that fail silently are the most dangerous
🔴
Kill Switch
😴
Boring is beautiful
🔄
AI keeps evolving
⚡
Fail fast

🛠️ Module Summary

✓
Lego Principle — 1 input / 1 output per block; start with the zero-AI steps
✓
Assembly Line — each AI call does ONE specialized job, making it easier to debug and swap out
✓
Validation Chain — validate each block’s output before chaining them; never test the entire pipeline at the end
✓
Iteration Mindset — AI steps are always evolving; ship the POC and learn from real-world use
✓
Bike Method — 4 phases (Training Wheels → Guided → Supervised → Hands Free); start with 10% of the volume
✓
Intern Rule — its own identity, read-only by default, audit trail, minimum scope
✓
Kill Switch + 3 Principles — dismantle without guilt; boring is beautiful; fail fast, learn faster

Next: Track 2 — The Architecture (4 Cs)

Context · Connections · Capabilities · Cadence. The 4 pillars of a complete AI Operating System.