Skip to content

bug: coder agent-firewall needs a user session inside workspaces, and the docs and module don't say so #32100

Open

Description

@coder

Is there an existing issue for this?

  • I have searched the existing issues

Related: coder/registry#794, which was closed when the claude-code module stopped launching the firewall. The underlying requirement was never documented or changed.

Current Behavior

Inside a workspace, the Agent Firewall wrapper created by the agent-firewall registry module exits immediately with:

You are not logged in. Try logging in using '…/coder-no-caps login <url>'

coder agent-firewall checks the FeatureBoundary entitlement in verifyLicense via r.InitClient(inv). That needs a user session. A workspace normally only has its agent token, so the check fails unless the owner has run coder login in the workspace or a session token is injected.

As a result, a template built by following the module README fails to start the firewalled app, and the error points to an interactive login that isn't practical for startup scripts, apps, or automated tasks.

Neither the module README nor docs/ai-governance/agent-firewall/ mentions that a user session is required.

Expected Behavior

One of:

  1. The entitlement check works with the workspace agent token (preferred, so no user credential is needed inside the workspace), or
  2. The module README and Agent Firewall docs clearly state the requirement and show a supported way to provide credentials (for example CODER_URL and CODER_SESSION_TOKEN = data.coder_workspace_owner.me.session_token), including the security trade-off of exposing the owner's session token to the firewalled process.

The error message should also explain that the firewall needs a Coder session for its license check, not just suggest an interactive login.

Steps to Reproduce

  1. On a Premium deployment, create a template that uses registry.coder.com/coder/agent-firewall/coder as shown in the module README (for example the "As a Coder app" or "As an automated task" examples).
  2. Start a workspace without running coder login inside it.
  3. Launch the firewalled app or script.
  4. The wrapper exits with the "You are not logged in" error and the app doesn't start.

Environment

  • Coder version: reproduced by a user on a recent release; the code path is unchanged on main as of 2026-11-12.
  • Module: coder/agent-firewall 0.0.4

Created on behalf of @grove-mountain

Activity

  1. linear-code commented on Nov 12, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions