Skip to content
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 - #140

Merged
mrsabath merged 2 commits into
rossoctl:mainfrom
mrsabath:fix/remove-builtin-auth
Feb 27, 2026
Merged

mrsabath merged 2 commits into
rossoctl:mainfrom
mrsabath:fix/remove-builtin-auth

Conversation

@mrsabath

Copy link
Copy Markdown
Member

Summary

With AuthBridge, sidecars handle all identity and auth concerns (SPIFFE identity, client registration, inbound JWT validation, outbound token exchange). The agents themselves contained redundant SVID probing, JWT validation middleware, and token exchange code that produced noisy warnings at startup and served no purpose with AuthBridge.

This PR removes all built-in auth logic so agents start cleanly as pure application logic -- identity is transparent via AuthBridge.

Changes across 5 agents/tools:

  • a2a/git_issue_agent: Delete auth.py; strip SVID/JWT/token-exchange code from config.py and a2a_agent.py; simplify execute() to GITHUB_TOKEN-only or AuthBridge-transparent; always register agent-card.json route; remove auth vars from .env.ollama and .env.openai
  • a2a/slack_researcher: Delete auth.py; strip SVID/JWT/token-exchange code from config.py and a2a_agent.py; remove user_token extraction from request context; pass no auth headers to MCP (AuthBridge handles it)
  • mcp/slack_tool: Remove get_client_id() SVID function, JWTVerifier, import jwt; change FastMCP("Slack", auth=verifier) to FastMCP("Slack"); remove JWKS_URI guard in main
  • mcp/reservation_tool: Remove JWTVerifier setup block; change FastMCP("Restaurant Reservations", auth=verifier) to FastMCP("Restaurant Reservations")
  • mcp/github_tool (Go): No changes needed -- .env.authbridge vars are consumed by sidecars, not the tool's Go code

10 files changed, +23 / -613 lines

Test plan

  • Verify agents import cleanly without authlib/PyJWT (no SVID/JWKS warnings at startup)
  • Deploy to Kind cluster and confirm clean startup logs
  • Verify agent card accessible at /.well-known/agent-card.json
  • Test git_issue_agent with GITHUB_TOKEN env var
  • Test slack_researcher with MCP connection
  • Test slack_tool and reservation_tool start without auth config

Closes #129

Generated with Claude Code

With AuthBridge, sidecars handle all identity and auth concerns:
SPIFFE identity (spiffe-helper), client registration
(kagenti-client-registration), inbound JWT validation and outbound
token exchange (envoy-proxy + go-processor).

Remove redundant SVID probing, JWT validation middleware, and token
exchange code from agents so they start cleanly without auth warnings.
Agents are now pure application logic — identity is transparent via
AuthBridge.

- Delete auth.py from git_issue_agent and slack_researcher
- Remove SVID functions, jwt imports, and auth config fields from
  config.py files
- Simplify a2a_agent.py execute() to use GITHUB_TOKEN only or let
  AuthBridge handle outbound auth transparently
- Remove AuthenticationMiddleware and JWKS conditional logic from run()
- Always register agent-card.json route (no longer gated on JWKS_URI)
- Remove JWTVerifier and SVID probing from slack_tool and
  reservation_tool MCP servers
- Remove Keycloak/AuthBridge token settings from .env files

Closes rossoctl#129

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Mariusz Sabath <[email protected]>

@mrsabath mrsabath left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Overall: Well-motivated, clean deletion PR. The premise is sound -- with AuthBridge handling identity/auth at the sidecar layer, agents should not duplicate this logic. Removing ~613 lines of redundant auth code is the right move. CI is green. I would approve with a few items to address.

What looks good

  1. Consistent approach across all 5 agents/tools -- same pattern applied uniformly: delete auth.py, strip SVID/JWT/token-exchange fields from config.py, remove middleware wiring, remove JWTVerifier from MCP servers.
  2. git_issue_agent fallback logic is well-handled -- cleanly supports both GITHUB_TOKEN mode and AuthBridge-transparent mode.
  3. Agent card route always registered now -- previously gated on not settings.JWKS_URI, which was confusing.
  4. Whitespace cleanup -- trailing whitespace fixes and missing newlines at EOF. Good hygiene.
  5. No changes to mcp/github_tool -- correctly identified Go tool does not need changes.

Issues I will fix in a follow-up commit

1. slack_tool.py: dead imports get_access_token / AccessToken
With auth=verifier removed, FastMCP will not inject access tokens into tool handlers. The get_access_token and AccessToken imports are unused. Also, the scope-based Slack client selection in get_slack_client() will silently degrade (access_token always None, falls through to ADMIN_SLACK_BOT_TOKEN). Will clean up the dead imports.

2. Missing requirements.txt cleanup
auth.py files imported authlib, httpx, and jwt (PyJWT). If those are no longer used elsewhere, they should be removed from dependency files to reduce CVE surface.

3. git_issue_agent: silent failure when neither GITHUB_TOKEN nor AuthBridge present
Old code raised an explicit error. New code silently sends empty headers. Will add a logging.warning() for debuggability in standalone/dev scenarios.

4. slack_researcher/a2a_agent.py: double space before as (nit)
Minor style inconsistency -- will fix.

I will push a follow-up commit addressing these items.

Remove authlib, PyJWT, python-keycloak, and httpx from pyproject.toml
files where they are no longer imported after the auth.py deletions.
Remove dead get_access_token/AccessToken imports and scope-based client
selection from slack_tool (broken without JWTVerifier). Add warning log
when git_issue_agent runs without GITHUB_TOKEN. Fix double-space style
nit in slack_researcher.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Mariusz Sabath <[email protected]>
Made-with: Cursor
@mrsabath
mrsabath merged commit 9217020 into rossoctl:main Feb 27, 2026
2 checks passed
@mrsabath
mrsabath deleted the fix/remove-builtin-auth branch February 27, 2026 20:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants