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
4 times, most recently
from
August 12, 2026 08:05
0f8bbff to
157f39a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2862282695gjh-afk
force-pushed
the
fix/a2a-security-v2
branch
11 times, most recently
from
August 13, 2026 02:40
43394b6 to
badbf54
Compare
Co-Authored-By: Claude <noreply@anthropic.com>
2862282695gjh-afk
force-pushed
the
fix/a2a-security-v2
branch
from
August 13, 2026 02:43
badbf54 to
88c12a9
Compare
xuyaqist
approved these changes
Aug 13, 2026
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