CodeGate: The Reverse Proxy for Claude Code Every Team Should Evaluate

Coding agents are starting to get access to important things.

Private repositories.

Proprietary code.

Credentials.

Internal documentation.

APIs.

And every time Claude Code, Cursor, or Codex sends a prompt to an AI provider, an uncomfortable question appears:

What information is actually leaving my organization?

Often the answer is:

We don’t know.

CodeGate exists precisely to solve that problem.

It’s an open source gateway developed by Stacklok that sits between your coding agents and model providers like OpenAI, Anthropic, or Gemini. Its job is to inspect, filter, and control everything that goes in and out before it reaches the model.

Think of it as a reverse proxy specialized for AI applications.


What exactly does it do?

Without CodeGate, the flow normally looks like this:

Claude Code
      │
      ▼
Anthropic

With CodeGate:

Claude Code
      │
      ▼
CodeGate
      │
 ┌────┼─────────┐
 ▼    ▼         ▼
Claude GPT   Gemini

All traffic passes through CodeGate first.

That means it can:

  • inspect prompts,
  • apply policies,
  • hide sensitive information,
  • log activity,
  • decide which provider to use.

1. Request Inspection

Each prompt sent by the agent can be inspected before it leaves.

For example:

Implement this endpoint using the Stripe API.

CodeGate can automatically detect if that prompt contains:

  • API keys,
  • tokens,
  • secrets,
  • customer names,
  • internal data,
  • confidential information.

Before it reaches the model.


2. Automatic Redaction of Sensitive Information

This is probably the most interesting feature.

Suppose the prompt contains:

API_KEY=sk_live_************************

or:

postgres://admin:password@production-db

CodeGate can automatically replace those values with redacted versions.

For example:

API_KEY=[REDACTED]

The agent still understands the context.

But the provider never receives the actual secret.


3. Policy Enforcement

It also allows you to define corporate rules.

For example:

Never send:

  • .env files
  • secrets
  • certificates
  • private keys

Or block prompts that contain:

customer_database.csv

or:

production_credentials.json

Instead of relying solely on developers remembering not to share certain information, the policy is automated.


4. Routing Between Models

Not all queries need the same model.

With CodeGate you can decide:

  • simple tasks → economical model
  • documentation generation → local model
  • code review → Claude
  • internal queries → self-hosted model

For example:

Cursor
      │
      ▼
CodeGate
      │
 ├── Claude Sonnet
 ├── GPT-5
 ├── Gemini
 └── Ollama

All without modifying the agent’s configuration.


Real-world use cases

Enterprise Teams

An organization can allow the use of Claude Code without automatically exposing sensitive information.


Teams with Multiple Models

Centralize access to:

  • Anthropic
  • OpenAI
  • Gemini
  • Ollama
  • OpenRouter

from a single control point.


Auditing

Log:

  • what prompts were sent,
  • when,
  • by whom,
  • to which provider.

Very useful for compliance and usage analysis.


Costs

It also allows you to decide which provider to use depending on the type of task.

Not everything needs to run on the most expensive model.


Installation

CodeGate can easily run via Docker.

For example:

docker run -d \
  -p 8989:8989 \
  stacklok/codegate

Or using Docker Compose:

services:
  codegate:
    image: stacklok/codegate
    ports:
      - "8989:8989"

Once started, agents simply point to the CodeGate endpoint instead of the provider directly.


Integration

CodeGate works with any client compatible with OpenAI-style APIs.

That includes tools like:

  • Claude Code
  • Cursor
  • Continue
  • Aider
  • OpenCode
  • custom applications

From the agent’s perspective, it’s simply talking to another endpoint.

All the intelligence happens behind the gateway.


Why does this matter?

Over the past two years we’ve talked a lot about models.

Claude.

GPT.

Gemini.

But in large organizations the problem is rarely which model answers better.

The problem is how to control the use of those models.

And that’s when new infrastructure categories start to appear:

  • gateways,
  • policy engines,
  • observability,
  • auditing,
  • security for agents.

CodeGate is part of this new generation of tools.

It doesn’t try to replace Claude Code.

It doesn’t try to compete with Cursor.

It does something much more interesting.

It makes any coding agent more secure.

And as agents get access to more systems, this type of infrastructure will probably shift from being a best practice to becoming a requirement for any organization that wants to adopt AI seriously.

codegate claudecode security opensource developertools

Repository: GitHub - stacklok/codegate: CodeGate: Security, Workspaces and Multiplexing for AI Agentic Frameworks · GitHub