Agent-First Software Development
This note explores the concept of agent-first software development, where AI agents like OpenAI’s Codex are responsible for generating the vast majority of code, tests, configuration, and documentation.
Key Takeaways
- Software development velocity can be increased by orders of magnitude by having AI agents write code.
- The role of human engineers shifts from writing code to designing environments, specifying intent, and building feedback loops for agents.
- Repository knowledge, structured documentation, and enforced architectural invariants are crucial for agent effectiveness.
- Making the system legible and enforceable for agents is paramount for successful autonomous development.
Main Concept
OpenAI conducted an experiment building a software product with “0 lines of manually-written code.” The entire codebase, including application logic, tests, CI configuration, documentation, and tooling, was generated by Codex. This approach resulted in building approximately a million lines of code in a fraction of the time it would have taken manually. The core philosophy is “Humans steer. Agents execute.” This means human engineers focus on high-level direction, problem decomposition, and ensuring the agents have the necessary structure and feedback mechanisms to perform reliably.
Practical Use
For DevSecOps Architects, this paradigm shift has profound implications:
- Accelerated Development Cycles: Significantly faster iteration on features and bug fixes.
- Shift in Skillset: Engineers need to become adept at prompt engineering, system design, defining agent capabilities, and establishing robust feedback loops rather than deep coding.
- Automated Compliance & Security: Potentially, agents could be trained to enforce security policies, generate security tests, and ensure architectural compliance automatically.
- Infrastructure as Code: CI/CD pipelines, infrastructure definitions, and observability configurations can be fully agent-generated and managed.
Implementation Notes
- Initial Scaffolding: Codex CLI, guided by templates, generated the initial repository structure, CI configuration, and even the agent instruction files.
- No Manually-Written Code: A strict philosophy to ensure the system is built for agent consumption.
- Depth-First Work: Breaking down large goals into smaller, agent-executable blocks.
- Capability Enhancement: When agents fail, the focus is on identifying and adding missing capabilities (tools, abstractions) rather than trying harder.
- Agent-to-Agent Review: Pushing review efforts towards automated agent processes.
- Legibility: Making application UI, logs, and metrics directly legible to Codex for debugging and reasoning.
- Repository as System of Record: Using structured
docs/directories and versioned artifacts as the primary knowledge base, rather than monolithic instruction files. - Progressive Disclosure: Agents start with a small, stable entry point and are guided to deeper information.
- Enforcing Invariants: Using custom linters and structural tests to enforce architectural rules and “taste invariants” (e.g., structured logging, naming conventions).
- Minimal Blocking Merge Gates: Short-lived pull requests and addressing test flakes with follow-up runs due to high agent throughput.
- Agent Autonomy: Agents can now end-to-end drive new features, including bug reproduction, fixing, validation, and merging, with human escalation only when judgment is required.
- Entropy Management: Recurring cleanup processes and “golden principles” encoded into the repository to manage drift and technical debt.
Connected Notes
- Codex - The AI model used for code generation.
- Architectural Invariants - The importance of enforcing rules and boundaries.
- CI CD - How CI/CD pipelines can be agent-generated.
- Observability Stack - Making observability data legible to agents.
Questions
- How can human judgment be most effectively encoded and leveraged in an agent-first development environment?
- What are the long-term implications for architectural coherence in fully agent-generated systems over years?
- How will the capabilities and roles of agents evolve as AI models become more advanced?