fix: pass security credentials to external A2A sub-agents - #3636
Open
2862282695gjh-afk wants to merge 1 commit into
Open
fix: pass security credentials to external A2A sub-agents#36362862282695gjh-afk wants to merge 1 commit into
2862282695gjh-afk wants to merge 1 commit into
Conversation
2862282695gjh-afk
force-pushed
the
fix/a2a-security-v2
branch
2 times, most recently
from
August 11, 2026 07:34
3497305 to
161ce28
Compare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2862282695gjh-afk
force-pushed
the
fix/a2a-security-v2
branch
from
August 11, 2026 07:47
161ce28 to
0f8bbff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a Nexent agent calls an external A2A sub-agent via the SDK execution path (
ExternalA2AAgentProxy), the configured security credentials are not sent in the request headers, causing 403 Forbidden from external agents that require authentication (e.g.,X-HW-ID+X-HW-APPKEY, Bearer JWT).Root Cause
The backend
a2a_client_service.call_agentalready handles security credentials via_build_security_request_parts. However, the SDK execution path (managed agents, used when a local agent calls an external A2A sub-agent) goes throughExternalA2AAgentProxythat only supports a simple Bearer token (api_key) — it never receives the configuredsecurity_credentials.Data chain broken at 4 levels:
query_external_sub_agentsdoes not returnsecurity_credentials_build_external_agent_configdoes not read/pass credentialsExternalA2AAgentConfig/A2AAgentInfohave no security headers field_build_headersignores securitySchemesFix (4 files, +90 lines)
backend/database/a2a_agent_db.py(+3 lines)query_external_sub_agentsreturnssecurity_schemes,security_requirements,security_credentials.backend/agents/create_agent_info.py(+38 lines)New
_build_security_headers(agent):security_schemes+security_requirements+security_credentialsapiKeySecurityScheme(header) →headers[name] = credentialhttpAuthSecurityScheme(bearer/basic) →Authorization: "<scheme> <credential>"_build_external_agent_configpasses result ascustom_headerssdk/nexent/core/agents/agent_model.py(+6 lines)ExternalA2AAgentConfigaddscustom_headersfieldto_a2a_agent_info()passescustom_headerssdk/nexent/core/agents/a2a_agent_proxy.py(+4 lines)A2AAgentInfoaddscustom_headersfield_build_headers()mergescustom_headersSupported Auth
Tests
test/backend/agents/test_a2a_security_headers.py:🤖 Generated with Claude Code