Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

fix: Remove built-in identity/auth logic from agents — AuthBridge handles it #129

Closed

Description

@mrsabath

Problem

When agents are deployed with AuthBridge, the agent container logs show unnecessary warnings and performs redundant identity checks at startup:

SVID JWT file /opt/jwt_svid.token not found.
SVID JWT file /opt/jwt_svid.token not found.
CLIENT_SECRET file not found at /shared/secret.txt
DEBUG: AUDIENCE or CLIENT_ID not set. No audience check will be performed.
DEBUG: ISSUER env var not set. No issuer check will be performed

These messages come from the agent's built-in auth code that probes for SVID files, client secrets, and JWT validation settings. With AuthBridge, all of this is handled by the sidecars:

  • SPIFFE identity → spiffe-helper sidecar
  • Client registration → kagenti-client-registration sidecar
  • Inbound JWT validation (signature, issuer, audience) → envoy-proxy + go-processor sidecar
  • Outbound token exchange → envoy-proxy + go-processor sidecar

The agent should not need to know about identity, tokens, or auth at all.

Affected agents

  • a2a/git_issue_agent — confirmed
  • Other agents may have similar built-in auth logic (needs audit)

Proposed changes

  1. Remove SVID/client-secret file probing from agent startup code. The agent container does not mount svid-output or use /shared/secret.txt — those are sidecar-only volumes.

  2. Remove built-in JWT validation middleware (the JWKS_URI-based middleware). When AuthBridge is present, inbound JWT validation is done by the Envoy ext_proc before requests reach the agent. The agent's own middleware is redundant and can cause confusion (e.g., AUDIENCE or CLIENT_ID not set warnings).

  3. Remove or make optional the JWKS_URI, ISSUER, AUDIENCE, CLIENT_ID, CLIENT_SECRET env vars from .env.ollama / .env.openai. These are AuthBridge sidecar concerns, not agent concerns.

  4. Audit other agents (a2a/ and mcp/ directories) for similar built-in auth logic and apply the same cleanup.

Context

Expected outcome

When deployed with AuthBridge, the agent should start cleanly without identity-related warnings:

INFO:     Started server process [17]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)

Identity, authentication, and authorization are fully transparent — handled by the AuthBridge sidecars.

Activity

  1. mrsabath commented on Feb 27, 2026

    @mrsabath
    MemberAuthor

    Additional Finding: authlib crash with Keycloak JWKS

    During end-to-end testing with the kagenti realm, we discovered that the agent's built-in JWT validation middleware crashes with an AttributeError when parsing the Keycloak JWKS:

    File "/app/git_issue_agent/auth.py", line 95, in authenticate
        claims = jwt.decode(s=token, key=jwks, claims_options=self.claims_options)
    ...
    File "/app/.venv/lib/python3.12/site-packages/authlib/jose/rfc7517/_cryptography_key.py", line 13, in load_pem_key
        if ssh_type and raw.startswith(ssh_type):
    AttributeError: 'NoneType' object has no attribute 'startswith'
    

    The Keycloak JWKS contains two keys: an RS256 signing key and an RSA-OAEP encryption key. The authlib library cannot properly handle the encryption key, causing the crash.

    Workaround: Set GITHUB_TOKEN to a dummy value (e.g., authbridge-managed) and remove JWKS_URI from the agent's environment. This bypasses the agent's internal JWT validation entirely, relying on AuthBridge for all inbound token validation.

    This further reinforces the need to remove the agent's built-in auth logic when AuthBridge is present.

  2. added a commit that references this issue on Feb 27, 2026
    69d3910
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions