# Govern Codex's models, tools, and cost with Barndoor

Enable your team to use Codex and build AI agents, governed by Barndoor so every tool, model, and token Codex touches is scoped, approved, and logged.

## How Codex connects through Barndoor

Barndoor gives you one universal endpoint to your MCP servers for Codex — connect once, use with all connected MCP servers and approved models.

1. **IT connects your tools at the org level.** Authorize Codex once in Barndoor.
2. **IT or security define the policy.** Which tools, people, and agents; what needs approval; what data is masked; what models are accessed; virtual keys, metering, token budgets.
3. **Point Codex at the Barndoor endpoint.** One connection governs every tool, model, and agent action.
4. **Give your teams an approved catalog.** Of the AI clients and models they’re approved to use.

## Why govern Codex with Barndoor

Barndoor is the AI Gateway, helping every business use AI and agents securely, reliably, and with control. It governs what Codex can access, what it can do with that access, and which models it runs on.

- **No shadow AI.** Every MCP server Codex connects to is approved and provisioned by IT, not configured ad hoc.
- **Centralized AI access.** Which MCP servers, which tools, which people, which agents, what needs approval, is all defined once at the org level, so access never drifts person to person or agent to agent.
- **Runtime enforcement.** Every MCP tool call and model call Codex makes is checked, scoped, and logged as it happens.
- **Model access.** Control which models Codex can use through virtual keys, so it never holds raw provider credentials.
- **Smart routing.** Automatic failover waterfalls if a model or provider goes down.
- **AI cost controls.** Set spend limits and token budgets, and track usage across every model Codex connects to.
- **Full visibility.** One audit-ready log of every MCP tool action and every model call Codex makes.

## Popular MCP servers to connect with Codex

### MCP  
**Atlassian**  
Project & Task Management  
34 tools Barndoor hosted

### MCP  
**Google Mail**  
Google Workspace  
17 tools Barndoor hosted

### MCP  
**Notion**  
File & Document Management  
14 tools Official Remote

### MCP  
**Salesforce**  
CRM, Sales & Marketing  
69 tools Barndoor hosted

### MCP  
**Slack**  
Communication & Collaboration  
21 tools Barndoor hosted

### MCP  
**Zoom**  
Communication & Collaboration  
16 tools Barndoor hosted

## Frequently asked questions

**Can I set different budgets for different teams or agents using Codex?**  
Yes. Token and spend budgets can be set per team, per user, or per individual agent, not just at the organization level. This is what lets you track and cap AI cost by who's actually driving it, whether that's a specific developer's agent or a whole department's Codex usage.

**How do I add a new MCP server for Codex after initial setup?**  
IT or security adds the new MCP server to the approved catalog and sets its policy, and it becomes available to Codex and every other connected AI client immediately, no per-client reconfiguration needed.

**Why do I need an AI gateway if I already have Codex?**  
Codex handles the model interaction, but it doesn't enforce org-wide policy, cost limits, or audit logging on its own. That's what a gateway adds in front of it. Without one, every person or agent using Codex is a separate, ungoverned point of access to whatever models and tools they can reach. An AI gateway makes that access centrally scoped, approved, and logged instead.

**How does Barndoor protect against unapproved models or tools?**  
It blocks the request at the gateway before it reaches the model or tool, rather than Codex itself deciding to allow or deny it.
