A book about AI development, management, governance, risk and reality
Dark CodeThe Software Architects Guide To Traveling At The Speed Of AI.
by Tony Griffith · Advisor: Radek Piechocki · First edition, 2026
You gave the AI a prompt and it effortlessly produced the solution you asked for. You read through the classes, the methods, the logic flow. The variable names make sense. The structure follows standard design patterns. It looks like professional (real) code. But as you try to trace the logic, as you try to understand why the algorithm chose this specific sorting strategy over another, or why the exception handling is nested three levels deep, you feel a strange, hollow sensation building in your chest. The reality is setting in and you feel a little anxious, you feel like hoping for the best is a great idea right now. You have just encountered the reality of DARK CODE. Now what?
Learn how to reduce AI driven technical debt, increase development velocity, maintain architectural integrity, and build a lasting competitive advantage.

“How engineering leadership survives and governs software development when implementation velocity exceeds human inspection capacity.”
Learn practical systems for
- Reviewing AI-generated code safely at scale
- Preventing AI-driven architectural drift
- Building governance around autonomous coding tools
- Maintaining velocity without sacrificing maintainability
- Designing resilient AI-augmented software architectures
eBook · PDF
Download it now
This price is for the eBOOK only - 158 Pages. Immediate access after checkout.
Paperback
Printed on Blurb
The printed edition, 6×9 in, is sold and shipped by Blurb.
The definition
What is Dark Code?
Dark Code is functioning software created by Ai that passes tests and appears to meet requirements, but whose internal logic and intent are not reliably recoverable by the humans responsible for operating it.
Dark Code, Chapter 1: The Definition
It works, it passes the unit tests and it deploys, yet it contains logic that no human can fully explain or trace, and in many cases code that no human has even seen. It is not bad code. There is simply no “why” to recover, only the “what”. Read the full definition →
Technical debt
A mortgage you took out to buy a house. You know where the debt lives, what it costs and, ideally, how you will pay it off.
Dark Code
Finding a mysterious, fully furnished mansion in the forest and moving in. It keeps the rain out, but you do not know if the foundation is solid, because you did not build it and there was no inspector.
The framework
The governance stack
The answer to Dark Code is not any one control. It is the combination of five layers. Intent tells you what should happen. Verification tells you what was admitted. Runtime tells you what actually happened. Provenance tells you how that reality was produced.
- 01
Intent
Prompts become architectural artifacts: version-controlled, peer-reviewed and standardized, so you know why the code was written even when you did not write it.
- 02
Generation
A "constitution" for the codebase (a system prompt with security protocols, architectural patterns and performance constraints) and code that leaves breadcrumbs and "why" comments.
- 03
Verification
Property-based and contract testing instead of the vanity metric of coverage. The AI is treated as a brilliant but untrusted vendor that must honour the contract.
- 04
Runtime
Runtime truth resides in execution: pervasive telemetry, distributed tracing and anomaly detection show exactly where the code broke.
- 05
Provenance
Prompt history, the prompt audit trail and versioned intent records explain how a behaviour entered the repository in the first place.
“Dark Code is governed the same way at every scale: by making intent explicit, verification non-optional, runtime visible, and responsibility unmistakably human.”
Inside the book
Thirteen chapters in three parts, and a glossary
Part One
The way it is.
- The Definition
- The Limits
- The Illusion
Part Two
What are we to do?
- The Guardrails
- The Hidden Compiler
- The Context
Part Three
How are we to do it?
- The Verification
- The Observability
- The Audit
- The Rise
- The Fear & The Trust
- The Road
- The Embrace
Part Four
Definitions
- The Glossary
Written primarily for engineering leaders, architects and senior technical operators. It is not a prompt-writing handbook: it is a book about governance, architecture and the operational discipline required to manage AI-generated software.
Free companions to the book
Measure it. Name it. Ask about it.
Dark Code Risk Calculator
Estimate how much un-reviewed, AI-generated, legacy, vendored and orphaned code your teams merge each month, and what it may cost.
Open the calculator → 02The Dark Code Glossary
More than a hundred terms from the book, from the AI Bill of Intent to Verification Over Inspection and the Watchdog AI.
Read the glossary → 03Questions and answers
Is Dark Code just technical debt? Can AI review AI code? Who is responsible when it fails? Straight answers from the book.
Read the answers →