Cloudflare / Customer Zero Cloudflare Connect SF 2026

Reference architecture

This is the setup we would start with today to run AI coding tools across a company. Engineers sign in with company SSO through Cloudflare Access. Coding tools send model requests to AI Gateway and tool calls to an MCP Server Portal.

Optionally, use Workers to host custom MCP servers or an API that serves client defaults, including models, the MCP Portal URL, system prompts and skills.

Clients

  • Engineers using coding toolsOpenCode, Claude Code, Codex and other clients, each connecting to your AI Gateway with the engineer's verified Access identity.
  • Production agentsAgents running in CI pipelines or as background workers. Give each one its own credentials and use AI Gateway metadata tagging to distinguish them.

Platform

  1. Cloudflare AccessCompany SSO and an Access policy on the gateway's custom domain
  2. AI GatewayStored provider keys, spend limits, request logs and User Insights
  3. Auto RouterOptional. Chooses a model based on the task and cost.
  4. Model providers and Workers AIModels from OpenAI, Anthropic, Google and others, plus open-weight models on Workers AI

Knowledge

  1. Optional config WorkerServes default models, the MCP Portal URL, system prompts and skills
  2. MCP Server PortalOne endpoint for all of your tools, with access, logging and Code Mode.
  3. MCP servers, optionally on WorkersSource control (GitHub, GitLab), work tracking (Jira, Linear) and any other internal systems. Each server uses the caller's own account downstream.

If you host shared configuration, the client loads its defaults at login, including the portal URL.

Enforcement

  • Access policiesProtect the gateway, the portal and internal MCP servers
  • Downstream permissionsAgents use each engineer's existing permissions in internal systems
  • Spend limitsA budget per person, plus a tighter budget for the most expensive models
  • Request and tool logsAI Gateway logs model requests. MCP Portal logs all tool calls.
Cloudflare product Optional custom services on Workers Clients and model providers

What happens on each path

First login

  1. The engineer runs one command, such as opencode auth login https://ai.example.com.
  2. Access sends them through company SSO. The client keeps a short-lived Access token.
  3. If you host shared configuration, the client loads the defaults, including the portal URL. Engineers can override defaults locally. Access policies and spend limits still apply on the server.

A model request

  1. The coding tool sends the request to the gateway's custom domain with the Access token.
  2. AI Gateway accepts the token as the credential and records the verified user ID with the request.
  3. The gateway checks spend limits, adds the stored provider key and forwards the request. Requests to cloudflare/auto go through the Auto Router, which chooses a model based on the task and cost.
  4. The request, its cost and its user show up in the gateway logs and in User Insights.

A tool call

  1. The agent connects to the portal URL and signs in through Access.
  2. With Code Mode on, the portal exposes two tools for search and execution. The agent finds the tools it needs and calls them by writing JavaScript. The MCP Portal executes that code in a sandboxed Worker.
  3. The portal sends each call to the right MCP server. The server calls the downstream system with the user's own account.
  4. MCP Portal logs each tool call against the user.

A production agent

  1. A CI job or background agent authenticates with its own workload credential.
  2. It adds AI Gateway metadata tags to each model request, such as agent ID, project and pipeline.
  3. Spend limits and log filters use that metadata, so each workload gets its own budget and its own records.

What Cloudflare provides and what you build

Cloudflare products

  • Access for company SSO and access policies
  • AI Gateway for provider keys, spend limits, logs, User Insights and Auto Router
  • MCP Server Portals for one tool endpoint with Code Mode and tool logs
  • Workers AI for open-weight models through the same gateway
  • The Workers platform for fast, low-cost serverless applications on Cloudflare's global network, with no infrastructure to manage

What you can build on Workers

  • An optional config API for default models, the MCP Portal URL, system prompts and skills. For simple client configuration, static files on R2 also work. Keep credentials out of shared configuration.
  • Custom MCP servers for internal systems that need them. Connect existing servers directly to the portal. Each server uses the caller's own account in the downstream system.

Answering the six questions from the talk opener

QuestionWhere it is handled
Q01Who can use which models?Access controls who can reach the gateway. Model-specific permissions need separate enforcement.
Q02Where do provider keys live?Stored provider keys in AI Gateway. Clients hold only a short-lived Access token.
Q03What activity can we review?AI Gateway logs and User Insights for model requests. MCP Portal logs for tool calls.
Q04How do agents reach internal systems?The MCP Server Portal, connected to existing or custom MCP servers
Q05How do we ship useful defaults?Shared client configuration, optionally served by a Worker API
Q06What stops runaway token spend?Spend limits enforce budgets. Code Mode, Auto Router and Workers AI models help reduce cost.

Setup guides

Next: Rollout plan

Use the rollout plan to put this architecture into practice, one phase at a time.