Hardening Codebases for Agentic Coding
Published by O'Reilly Media, Inc.
What you’ll learn and how you can apply it
- Assess whether a codebase is ready for AI-assisted development by identifying missing guardrails, unclear contracts, weak tests, and risky review workflows
- Design executable feedback loops using tests, assertions, static analysis, architecture checks, and CI gates
- Apply agent-safe development patterns such as dependency injection, realistic test doubles, property-based testing, mutation testing, and observable failure messages
- Create a practical hardening plan that reduces the risk of AI-generated regressions, architecture drift, and production incidents
Course description
AI-assisted coding is producing a bimodal distribution of outcomes. Some teams use AI coding agents to move faster while improving reliability, while others generate more code, more churn, and more production risk. The difference is not the model alone. Research from DORA and DX suggests that AI acts as an amplifier: It magnifies the strengths and weaknesses already present in a team’s engineering system. Ben O’Mahony shows you how to shift your codebases toward the positive side of that distribution by creating executable guardrails that make AI-generated changes easier to review, test, debug, and trust.
You’ll study practical techniques for hardening codebases for agentic development across languages and stacks. Topics include executable specifications, test-driven workflows, runtime invariants, property-based testing, architecture boundaries, dependency injection, mutation testing, pre-commit and CI quality gates, CLI/debugging interfaces, observability, and secure review practices. Through hands-on exercises, learners will improve a small codebase so that both humans and AI agents can make changes with faster feedback, clearer failure modes, and fewer regressions.
This live event is for you because...
- You’re a software engineer, AI engineer, technical lead, staff engineer, architect, SRE, or engineering manager responsible for code quality.
- You work with production systems where maintainability, correctness, security, or reliability matter.
- You use or plan to use AI coding assistants such as Pi, Claude Code, GitHub Copilot, Cursor, or internal coding agents.
- You want to understand why some teams get strong results from AI-assisted coding while others see more bugs, churn, and incidents.
Prerequisites
- A working development environment for the course starter repository
- Access to an AI coding assistant
- Language-specific tooling installed for the chosen version of the course, such as test runner, linter, type checker or compiler, formatter, and pre-commit or equivalent local quality-gate tooling
- Intermediate software engineering experience in at least one production language
- Basic familiarity with automated testing, code review, CI, and command-line development workflows
- Some exposure to AI coding assistants or agentic coding tools
- Experience with static analysis, property-based testing, architecture tests, mutation testing, observability, or production incident review (helpful but not required)
Recommended preparation:
- Clone the course starter repository locally (link to come)
Recommended follow-up:
- Read Building AI Agent Platforms (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Why codebase hardening matters for agentic coding (30 minutes)
- Presentation: The bimodal reality of AI-assisted coding outcomes; AI as an amplifier of existing engineering practice; why “more code faster” is not the same as better software delivery; recipes versus taste concept (prompts, README files, coding standards, and Markdown specs are recipes; tests, invariants, static checks, architecture rules, observability, and review judgment provide taste); tests as just-in-time prompting; runtime assertions and invariant checks as just-in-time debugging signals; why hardened codebases matter across typed and dynamically typed
- Q&A
Hardening a weak codebase (60 minutes)
- Demonstration: Hardening a small, intentionally weak codebase before asking an AI agent or developer to safely extend it
- Q&A
- Break
Adding guardrails to a codebase (60 minutes)
- Hands-on exercise: Add concrete guardrails that make a repository safer for future human and AI-assisted changes
- Q&A
Advanced patterns and adoption strategy (30 minutes)
- Presentation: Higher-leverage hardening techniques and practical guidance for adopting them without turning the codebase into tool soup
- Q&A
Your Instructor
Ben O'Mahony
Ben O’Mahony is Principal AI Engineer at Thoughtworks. He is a results-driven AI/Engineering leader with a track record of building high-performing teams and shipping business-critical AI, ML and data products and platforms at scale. He has deep expertise across the full Engineering and Data lifecycle from research to production deployment. Ben is adept at defining technical strategy, driving execution and partnering cross-functionally to deliver measurable impact. Recently Ben has been intensely focused on building Generative AI platforms, models and agents.