Policy-Aware Infrastructure Generation: Using an MCP Server to Bridge OPA and AI for Terraform @thoughtworks
Policy-Aware Infrastructure Generation: Using an MCP Server to Bridge OPA and AI for Terraform  @thoughtworks
Uploaded October 2025 | Updated September 2026, 2 weeks ago
As developers use AI agents to generate Terraform configurations, ensuring compliance with internal policies becomes a critical challenge. This talk presents a new approach: Integrating an MCP (Model Context Protocol) server that connects AI agents with existing OPA (Open Policy Agent) policies. By querying these policies, the server extracts real-time constraints, such as allowed instance types, required tags or open ports, and feeds them back into the generation prompt. This allows developers to request infrastructure in natural language (“I need a server on AWS”) and receive compliant Terraform code by default. The session includes a prototype demo and explores how this pattern bridges policy, AI and Infrastructure as Code inside modern developer workflows.

About the speaker:
Óscar Cobles Montes, Senior Infrastructure Consultant

Óscar is a Senior Software Engineer and Cloud Architect with over 14 years of experience building and automating cloud infrastructure at scale. He specializes in Infrastructure as Code, cloud governance, and platform automation. Throughout his career, he has supported enterprise clients in adopting DevOps practices, improving developer experience, and ensuring policy compliance across cloud environments.

A few months ago, Óscar joined the Thoughtworks family, where he focuses on infrastructure and developer enablement. This is his first time speaking at XConf, where he’s excited to share a new approach to policy-aware infrastructure generation using AI agents.


thoughtworks.com/xconf
Policy-Aware Infrastructure Generation: Using an MCP Server to Bridge OPA and AI for TerraformHow managed cloud services reduced costs and improved performance | Thoughtworks case studyHow Agentic AI is transforming government servicesReflections from the Future of Software Development RetreatAI-assisted software development in 2025: Inside this years DORA reportAWS AI LIVE! from re:Invent 2025: Enterprise Value with Agentic AIXConf APAC 2025 - Singapore highlightsThoughtworks x Amazon Web Services (AWS)Chatbot testing in the real world: Making sense of an emerging practice - XConf APAC 2025Powering innovation: Thoughtworks’ AI journey — Pragmatism in PracticeThis Week in AI | 9th April 2026One Sentence v1 No CTA
Thoughtworks |

Policy-Aware Infrastructure Generation: Using an MCP Server to Bridge OPA and AI for Terraform

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER