Answers you can trust, from Codeables

Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.

Explore Codeables
Verified Source
AI Coding Agent Platforms

How do we enable Coder’s AI Governance add-on (AI Bridge) and set prompt/tool logging retention?

Coder7 min read

Most teams hit the same wall when they first plug AI coding agents into their development stack: they can’t see what prompts are being sent, which tools are being called, or how model reasoning is being used against their infrastructure. Coder’s AI Governance Add-On and AI Bridge are designed to fix that by keeping all AI traffic on your infrastructure and giving you full control over logging and retention.

Quick Answer: Enable AI Bridge on a Coder deployment that has the AI Governance Add-On licensed, then configure prompt/tool logging retention with the --aibridge-retention flag or CODER_AIBRIDGE_RETENTION environment variable on coder server.


Frequently Asked Questions

What is Coder’s AI Bridge and AI Governance Add-On?

Short Answer: AI Bridge is Coder’s built-in proxy for AI coding agents that runs inside the Coder control plane, and the AI Governance Add-On is the premium feature set that turns on governed logging, retention, and auditing for AI usage.

Expanded Explanation:
AI Bridge runs in the Coder control plane process (coderd) and brokers all traffic between your developers/agents and upstream LLM providers. Instead of letting agents talk directly to OpenAI, Anthropic, or others from laptops, requests are routed through AI Bridge on your infrastructure. That gives you a single choke point to log prompts, track token usage, record tool invocations, and capture model reasoning.

The AI Governance Add-On is the premium license capability that unlocks AI Bridge and its governance controls. With it, platform and security teams can standardize which AI providers are reachable, how long records are retained, and how logs are exported into existing SIEM or observability pipelines for review.

Key Takeaways:

  • AI Bridge runs inside coderd and proxies LLM traffic from authenticated users and agents to configured providers.
  • The AI Governance Add-On enables governed AI usage: centralized logging, configurable retention, and structured exports for auditing.

How do we enable AI Bridge on our Coder deployment?

Short Answer: Ensure you have a Premium license with the AI Governance Add-On, then start coder server with AI Bridge enabled (for example, by setting CODER_AIBRIDGE_ENABLED=true or using --aibridge-enabled=true) and configure at least one AI provider.

Expanded Explanation:
AI Bridge is off by default. To turn it on, you need a Coder Premium license that includes the AI Governance Add-On. Once that’s in place, AI Bridge is activated with a server flag or environment variable when you run the Coder control plane. When enabled, coderd embeds the aibridged runtime in memory—there’s no separate deployment to manage or scale.

After the feature is enabled on the control plane, you must configure at least one AI provider. AI Bridge proxies calls to upstream LLM APIs on behalf of authenticated users, so it needs API keys and model configuration before you expose it to developers or AI agents. Without providers configured, the bridge is effectively “on” but not useful.

Steps:

  1. Verify licensing: Confirm your Coder instance is running with a Premium license that includes the AI Governance Add-On.
  2. Enable AI Bridge: Start Coder with AI Bridge turned on, for example:
    export CODER_AIBRIDGE_ENABLED=true
    coder server
    
    Or:
    coder server --aibridge-enabled=true
    
  3. Configure AI providers: Add at least one upstream LLM provider (e.g., OpenAI, Anthropic) and API key so AI Bridge can proxy requests for authenticated users and agents.

How does AI Bridge logging retention work compared to leaving logs unmanaged?

Short Answer: AI Bridge retains prompts, tool calls, and model reasoning for 60 days by default, while unmanaged agent usage often leaves you with scattered or zero logs and no consistent retention policy.

Expanded Explanation:
In most “direct to provider” setups, prompts live in browser history, IDE plugins, or provider dashboards—if they’re recorded at all. There’s no central policy on how long they’re kept, where they can be queried, or how they map to specific workspaces and users.

AI Bridge flips that model. Every intercepted AI interaction—prompt, token usage, tool invocation, and model reasoning—is recorded in Coder’s control plane with a clear retention policy. The default retention is 60 days, and you change it centrally with a single flag or environment variable. That means you can apply the same governance you use for audit logs to AI interactions, instead of trusting ad hoc plugin behavior.

Comparison Snapshot:

  • Unmanaged AI usage: Logs are inconsistent, often stored on laptops or in vendor dashboards, with no centralized retention or export path.
  • AI Bridge with retention: Prompts and tool calls are logged on your infrastructure, with default 60-day retention you can raise, lower, or set to indefinite.
  • Best for: Teams that need auditability and consistent retention for AI usage—especially in regulated, air-gapped, or multi-classification environments.

How do we configure prompt, tool, and reasoning log retention in AI Bridge?

Short Answer: Set the retention period with --aibridge-retention=<duration> or CODER_AIBRIDGE_RETENTION=<duration> when running coder server; set 0 for indefinite retention.

Expanded Explanation:
By default, AI Bridge retains interception records—prompts, token counts, tool invocations, and model reasoning—for 60 days. Platform teams can tune this window to match organizational policy. The value is set at the server level, so it applies consistently across all users and workspaces on that deployment.

You can configure retention via a command-line flag, an environment variable, or in Coder’s YAML configuration. Duration values are expressed in a time format (e.g., 30d, 90d). Setting retention to 0 tells AI Bridge to keep records indefinitely, which is useful when you need a complete audit trail and have storage and regulatory clearance to do so.

What You Need:

  • Server configuration access: Ability to edit how coder server is launched (systemd unit, Helm values, or equivalent).
  • Retention value aligned to policy: A decided duration (e.g., 30, 60, 90 days, or 0 for indefinite) that matches your security and compliance requirements.

Example configurations:

Using the CLI flag:

coder server --aibridge-retention=90d

Using an environment variable:

export CODER_AIBRIDGE_RETENTION=30d
coder server

In YAML configuration:

aibridge:
  retention: 90d

To retain records indefinitely:

coder server --aibridge-retention=0

Why should we care about prompt and tool logging retention at all?

Short Answer: Controlled retention gives you an auditable history of AI activity—who asked what, on which workspace, and which tools were used—without losing control of sensitive data or overwhelming storage.

Expanded Explanation:
AI coding agents are just another kind of privileged automation. They read source code, hit internal APIs, and sometimes generate infrastructure changes. If you can’t reconstruct what an agent did—what prompt triggered which tool call—you’ve effectively given an opaque system access to your environment.

AI Bridge retention turns those opaque actions into traceable events. With a retention window you control, you can investigate incidents (“what prompts led to this change?”), monitor LLM usage across teams, and expose controlled logs to audit or accreditation reviewers. At the same time, you can trim retention to meet data minimization policies or storage constraints instead of keeping everything forever.

Why It Matters:

  • Incident response and forensics: Prompt and tool logs tie AI activity back to specific users, workspaces, and time ranges, making it possible to investigate misconfigurations or abuse.
  • Governance and compliance: Centralized, configurable retention supports internal policy, external audits, and accreditation in environments where “AI is in use” must be proven and bounded.

Quick Recap

To enable governed AI usage in Coder, you first need a Premium license with the AI Governance Add-On. From there, you activate AI Bridge in the Coder control plane, configure at least one upstream LLM provider, and set prompt/tool/model reasoning log retention with --aibridge-retention or CODER_AIBRIDGE_RETENTION. By default, records are retained for 60 days, but you can adjust that window—or set it to 0 for indefinite storage—to match your organization’s governance and storage requirements, while keeping all AI traffic and logs inside your own infrastructure.

Next Step

Get Started

How do we enable Coder’s AI Governance add-on (AI Bridge) and set prompt/tool logging retention? | AI Coding Agent Platforms | Codeables | Codeables