We recently prototyped a platform to modernize Purple Teaming, evolving the practice from ad-hoc manual testing to a fully automated, continuous validation loop. By unifying Offensive Security Development, Cloud Security, Infrastructure-as-Code (IaC), and Detection Engineering, this architecture transforms offensive operations into a high-velocity code pipeline.
The architecture also aligns with modern Purple Team frameworks, such as ‘The Always-On Purple Team: Automated CI/CD for Detection Engineering’ (Stephen Sims and Erik Van Buggenhout, RSA Conference 2024). However, our platform expands upon that foundation in several critical areas, including:
- Autonomous Development: Unlike traditional BAS tools that replay signatures or configure frameworks (e.g., MITRE Caldera), our AI agent acts as a malware researcher which writes, compiles, and debugs custom code (C/C++/.Net/Go/Rust) interacting directly with system native APIs.
- Ephemeral Battlefields: We treat Infrastructure-as-Code (IaC) as a core dependency of the test, not just a static environment. By easily destroying and recreating battlefields for every cycle, we eliminate configuration drift and ensure every offensive security operation runs on a clean, production-mirror slate.
- TI Integration via MCP [To-Do]: Future enhancements will integrate a TI platform directly into the agent’s context using the Model Context Protocol (MCP), which will allow the agent to dynamically and automatically converting raw intelligence into practical purple teaming plans without human translation.
For illustration purposes, below is how the system integrates security automation, cloud infrastructure, and AI to continuously exercise cyber defence capabilities:

1. Infrastructure-as-Code (IaC) Foundation
The battlefield is defined entirely in code utilizing Terraform and Cloud Service Provider (e.g., Azure) to ensure consistency and reproducibility.
- Tools: Terraform, Azure Resource Manager (ARM), Cloud-init, Windows PowerShell.
- Technique: Implementing immutable infrastructure by provisioning ephemeral sandbox environments (for safe malware compilation) and production-like machines that mirror real-world assets. Tainted environments are able to be instantly destroyed and recreated, ensuring every test cycle begins on a pristine slate, free of configuration drift.
2. AI-Driven Offensive Security Operations
Speed and sophistication are driven by a pre-compiled AI Agent (e.g., a Go binary) powered by an enterprise AI application building platform (e.g., Azure AI Foundry, Amazon Bedrock, Google Vertex AI) which acts as an autonomous offensive security researcher.
- Tools: An enterprise AI application platform, Ansible, SSH/WinRM, C/C++/.Net/Go/Rust.
- Technique: The agent executes a “human-in-the-loop” free cycle. It converts high-level intent (e.g., “dump LSASS via direct syscalls”) into functional source code, autonomously debugging compiler errors in the sandbox environments until a valid binary is built. Finally, it uses Ansible to deploy and execute this polymorphic artifact against the target infrastructure - _production-like machines _with EDR solutions.
3. Detection-as-Code & Adaptive Cyber Defence
Cyber Defence is treated as a software engineering discipline, integrating logging and detection logic directly into a CI/CD pipeline.
- Tools: Telemetry via modern EDRs (e.g., MDE, CrowdStrike), Cloud SIEM (e.g., Microsoft Sentinel), API Calling (e.g., MS Graph).
- Technique: Attack telemetry is analyzed in real-time using Detection-as-Code principles. By leveraging API calls, the platform programmatically deploys and tunes advanced hunting rules based on immediate testing results. This establishes a tight feedback loop, where every offensive simulation directly triggers an automated upgrade in defensive logic.
In summary, by codifying the entire kill chain - from infrastructure provisioning to payload delivery and event-driven alert engineering - we advance beyond static quarterly assessments to continuous integration for security. This platform enables us to exercise detection capabilities at machine speed, ensuring our cyber defence evolve faster than the threats they face.
As always, I hope you find this article useful, and thank you for reading.
Related: For how AI-driven harnesses perform in a real exam setting, see Passing OSAI with a Custom Agent Harness Architecture. For the threat intelligence side, see Applying Graph Theory to CTI and Threat Hunting.