Skip to main content

Planning an Enterprise-Grade Environment for Building AI Solutions

A practical guide to enterprise AI environment setup: one shared hub, repeatable team workspaces and a Terraform module.

Updated 9 min readMarkdown
Part of seriesXccelera Blogs
Planning an Enterprise-Grade Environment for Building AI Solutions

A sound enterprise AI environment setup is a shared hub of controls plus one small, repeatable workspace for each team, provisioned as code.

The fourth team asks for an AI environment, and the platform team builds it by hand again: a bucket here, a model permission there, a firewall exception nobody writes down.

Three weeks later it works, and it looks nothing like the first three. The hub holds what must stay identical everywhere. The workspace holds what a team needs to build.

This guide defines that split, lists the five things every workspace should receive on day one, assigns ownership between platform and product teams, and ends with a complete Terraform module you can adapt to your own cloud account.

What does an enterprise AI environment setup include?

An enterprise AI environment setup has two parts. The hub is built once and shared: a model gateway, a secrets store, a source of policy and a registry of what runs where.

Each spoke is a team workspace that connects to the hub and owns only its own code, data and experiments. The split matters because the hub changes slowly and deliberately, while workspaces appear every week.

Enterprise AI environment setup with a shared hub and three team workspaces.

Gartner projected that 80% of large engineering organizations would run dedicated platform teams by 2026, so the group that owns the hub usually exists already. What it often lacks is a written definition of what a workspace is.

Quick check: If a fifth team asked for an environment tomorrow, could you list what it would receive without opening a console? If not, the hub lives in someone's head and not in code.

What should every team workspace get on day one?

Every workspace should receive the same five guarantees. Call this the workspace contract.

Each item answers a question that an auditor, a security lead or a finance partner will ask in the first week, and each can be checked by a script rather than by a conversation. Keeping the list short is deliberate.

Anything beyond five belongs in the team's own backlog, because a contract that grows with every request stops being a contract and turns back into a ticket queue.

Contract item What it guarantees How it is enforced
Identity One runtime role per team, no shared keys IAM role scoped to the workspace
Model allowlist Only approved models can be called Role policy that lists model ARNs
Data zone Team data stays in its own encrypted store Dedicated bucket, own key, no public access
Egress rule Nothing leaves except approved destinations Security group with no default outbound
Budget ceiling Spend has a declared limit before work starts Monthly budget tied to a team tag

Quick check: Which of the five can you verify today with a script? Any item you can only verify by asking someone is a gap in the contract.

Who owns what between the platform team and the product teams?

Ownership is where most environment projects quietly fail. If both sides assume the other one owns a concern, nobody does, and the gap surfaces during an incident. Write the split down per concern.

The platform team owns the hub and the rules that cannot vary.

Product teams own everything inside their workspace boundary and the requests that cross it.

Teams that adopt an enterprise AI orchestration layer place it in the hub, so that model switching, memory and approval checkpoints behave the same in every workspace instead of being rebuilt by each team.

Concern Platform team (hub) Product team (workspace)
Model access Approves models and sets the default list Requests additions, chooses within the list
Secrets Runs the store and rotation Uses its own secrets, never creates new stores
Data Defines zones and classification rules Decides what enters its own zone
Network Owns the egress approval process Lists the destinations it needs
Budget Sets how ceilings are calculated Chooses how to spend inside the ceiling
Orchestration Operates the shared runtime Configures its own workflows on top

Quick check: Pick one row of the matrix. If both teams would say the other one owns it, that concern is currently unowned.

How do you provision a workspace as code?

Provision the contract as a single module and make a pull request the only way to ask for a workspace.

Provision AI workspace as code.

The module below creates the five guarantees for one team on AWS: a runtime role limited to approved models and its own bucket, a customer-managed encryption key, a security group with no default outbound access, and a monthly budget filtered by team tag.

It assumes the hub already exposes a VPC endpoint for model traffic, which is why the only default egress rule points at that endpoint's security group.

terraform {
  required_version = ">= 1.6"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

variable "team" {
  type = string
}

variable "hub_vpc_id" {
  type = string
}

variable "hub_endpoint_sg_id" {
  type        = string
  description = "Security group of the hub's model endpoint"
}

variable "allowed_model_ids" {
  type = list(string)
}

variable "approved_egress_cidrs" {
  type    = list(string)
  default = []
}

variable "monthly_budget_usd" {
  type    = number
  default = 2000
}

variable "budget_contact" {
  type = string
}

data "aws_caller_identity" "current" {}
data "aws_region" "current" {}

locals {
  name = "ai-${var.team}"
  model_arns = [
    for m in var.allowed_model_ids :
    "arn:aws:bedrock:${data.aws_region.current.name}::foundation-model/${m}"
  ]
  tags = {
    team       = var.team
    managed_by = "workspace-module"
  }
}

# Data zone: own bucket, own key, no public access
resource "aws_kms_key" "zone" {
  description         = "${local.name} data zone"
  enable_key_rotation = true
  tags                = local.tags
}

resource "aws_s3_bucket" "zone" {
  bucket = "${local.name}-data-${data.aws_caller_identity.current.account_id}"
  tags   = local.tags
}

resource "aws_s3_bucket_public_access_block" "zone" {
  bucket                  = aws_s3_bucket.zone.id
  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}

resource "aws_s3_bucket_server_side_encryption_configuration" "zone" {
  bucket = aws_s3_bucket.zone.id
  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm     = "aws:kms"
      kms_master_key_id = aws_kms_key.zone.arn
    }
  }
}

# Identity and model allowlist
data "aws_iam_policy_document" "trust" {
  statement {
    actions = ["sts:AssumeRole"]
    principals {
      type        = "Service"
      identifiers = ["ecs-tasks.amazonaws.com"]
    }
  }
}

data "aws_iam_policy_document" "access" {
  statement {
    sid       = "InvokeAllowedModelsOnly"
    actions   = ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"]
    resources = local.model_arns
  }
  statement {
    sid     = "OwnDataZoneOnly"
    actions = ["s3:GetObject", "s3:PutObject", "s3:ListBucket"]
    resources = [
      aws_s3_bucket.zone.arn,
      "${aws_s3_bucket.zone.arn}/*",
    ]
  }
  statement {
    sid       = "UseZoneKey"
    actions   = ["kms:Decrypt", "kms:GenerateDataKey"]
    resources = [aws_kms_key.zone.arn]
  }
}

resource "aws_iam_role" "workspace" {
  name               = "${local.name}-runtime"
  assume_role_policy = data.aws_iam_policy_document.trust.json
  tags               = local.tags
}

resource "aws_iam_role_policy" "workspace" {
  name   = "${local.name}-access"
  role   = aws_iam_role.workspace.id
  policy = data.aws_iam_policy_document.access.json
}

# Egress: Terraform removes the default allow-all rule, so only listed paths work
resource "aws_security_group" "workspace" {
  name        = "${local.name}-egress"
  description = "Deny-by-default outbound for ${var.team}"
  vpc_id      = var.hub_vpc_id
  tags        = local.tags
}

resource "aws_vpc_security_group_egress_rule" "hub_endpoint" {
  security_group_id            = aws_security_group.workspace.id
  referenced_security_group_id = var.hub_endpoint_sg_id
  ip_protocol                  = "tcp"
  from_port                    = 443
  to_port                      = 443
}

resource "aws_vpc_security_group_egress_rule" "approved" {
  for_each          = toset(var.approved_egress_cidrs)
  security_group_id = aws_security_group.workspace.id
  cidr_ipv4         = each.value
  ip_protocol       = "tcp"
  from_port         = 443
  to_port           = 443
}

# Budget ceiling declared at creation
resource "aws_budgets_budget" "workspace" {
  name         = "${local.name}-monthly"
  budget_type  = "COST"
  limit_amount = tostring(var.monthly_budget_usd)
  limit_unit   = "USD"
  time_unit    = "MONTHLY"

  cost_filter {
    name   = "TagKeyValue"
    values = [format("user:team$%s", var.team)]
  }

  notification {
    comparison_operator        = "GREATER_THAN"
    threshold                  = 100
    threshold_type             = "PERCENTAGE"
    notification_type          = "FORECASTED"
    subscriber_email_addresses = [var.budget_contact]
  }
}

output "runtime_role_arn" {
  value = aws_iam_role.workspace.arn
}

output "data_zone_bucket" {
  value = aws_s3_bucket.zone.bucket
}

output "egress_security_group_id" {
  value = aws_security_group.workspace.id
}

A new team is then one block, reviewed like any other change:

module "claims_workspace" {
  source                = "./modules/ai-workspace"
  team                  = "claims"
  hub_vpc_id            = "vpc-0abc1234"
  hub_endpoint_sg_id    = "sg-0def5678"
  allowed_model_ids     = ["anthropic.claude-3-5-sonnet-20240620-v1:0"]
  approved_egress_cidrs = ["203.0.113.0/24"]
  monthly_budget_usd    = 1500
  budget_contact        = "claims-platform@example.com"
}

Replace the model ID, CIDR range and contact with your own values. The point is the shape: every exception is a visible line in a diff, with a reviewer's name attached.

Quick check: Search your current environments for the string "0.0.0.0/0" on outbound rules. Each hit is a workspace that has no egress rule yet.

What goes wrong when the hub is skipped?

Three patterns repeat.

Risks of skipping the shared hub in an AI environment.

The first is drift: teams copy the last environment, change one setting and forget it, so no two workspaces behave alike and every incident starts with a comparison.

The second is the quiet workaround. A January 2026 survey of 2,000 workers in the UK and US by BlackFog found that 49% use AI tools their employer has not approved. A slow or unclear request process is a likely contributor, because people route around friction.

The third is the unreviewable exception: a firewall rule or model permission added in a hurry, with no record of who asked or why.

Quick check: How long does a new team wait for a working environment today? If the answer is measured in weeks, expect unofficial setups to appear first.

Treat the Workspace as a Product, Not a Ticket

The most useful shift in this whole design is a change of mindset. A ticket asks the platform team to build something once.

A product defines what every customer receives, publishes how to ask for more, and measures how quickly a new team can start building.

When the workspace contract is code, the second and tenth team receive exactly what the first one did, and the platform team spends its time improving the contract instead of repeating it.

Reviews get shorter because reviewers read a diff, not a diagram. Audits get easier because the evidence is the repository history.

Xccelera describes the shared layer in a similar way, as the place where coordination and oversight live so that each team does not rebuild them.

Whatever tooling fills that role in your organization, start by writing the five guarantees down, then let the code enforce them.

About the author

  • Xccelera AI is an enterprise agentic AI platform for building, orchestrating, integrating and scaling AI agents, from AI transformation strategy to production software engineering. Our platform and packaged agents (voice, ERP, ITSM, clinical assist, negotiation) come with human approval checkpoints, isolated execution and an audit-ready evidence trail for every run. Here we share engineering deep-dives on agent design, orchestration and observability. xccelera.ai

No comments yet. Be the first to comment.