Python agent runtime persists all inbound request headers, including Authorization, in session state
Maintainer thường phản hồi trong vòng 1 ngày
@BahaaMattar đang làm issue này rồi.
Từ ngày 15/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Start with python/packages/kagent-adk/src/kagent/adk/_agent_executor.py and trace how request headers enter run_request.state_delta on main. Check the header consumers named in the issue: types.py, _llm_passthrough_plugin.py, _remote_a2a_tool.py, and agentsts-adk's HEADERS_KEY; for 0.10.x also inspect KAgentSessionService.append_event in _session_service.py. Done means headers remain available during each invocation, including HITL resumes, while authorization values are absent from persisted session events and session state.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The Python agent runtime (kagent-adk, the app image declarative Python agents run) stores the entire inbound A2A request header map, Authorization included, in the agent's session state. On 0.10.x that state goes to the controller's database, so every A2A call made with a bearer token leaves that token in the event table, where it outlives the request. It is also returned by the sessions events API to anyone who can read the session.
Go-runtime agents are not affected. We found no path from the stored headers into the model prompt unless an agent's system message templates {headers}.
Where
0.10.1 (also seen on release/v0.10.x head):
- a2a-sdk
a2a/server/apps/jsonrpc/jsonrpc_app.py:state['headers'] = dict(request.headers), which is every inbound header. python/packages/kagent-adk/src/kagent/adk/_agent_executor.py: copies it intoEventActions(state_delta={"headers": headers})on a system event (invocation_id="header_update",author="system") and callssession_service.append_event._session_service.pyKAgentSessionService.append_event: postsevent.model_dump_json()to/api/sessions/{id}/events. The controller stores it inevent.data.
main: the Postgres-backed session service is gone, but _agent_executor.py still sets run_request.state_delta = {"headers": headers}. So the full header map, credentials included, is kept in the in-process session (and in the sandbox runtime's SQLite session store).
Expected
Request headers are request-scoped. They're needed during the invocation (for allowedHeaders forwarding to MCP tools, token propagation to remote A2A agents, STS, LLM passthrough), but they should never be persisted. ADK's temp: state prefix gives exactly that: temp: keys are applied to the in-memory session for the current invocation and stripped from the event before any session service stores it. Storing the map under temp:headers (and reading it from there in the consumers: types.py header provider, _llm_passthrough_plugin.py, _remote_a2a_tool.py, agentsts-adk's HEADERS_KEY) keeps every consumer working. On 0.10.x KAgentSessionService posts before ADK trims the delta, so it would also need to apply and trim temp: keys before serializing.
Every request (including a HITL resume) sets the headers again, so nothing has to survive a turn.
Note for operators
Rows already written stay in the event table until they're removed. Deployments that ran Python agents on 0.10.x behind an authenticating gateway should check event.data for stored authorization headers.
- Ngôn ngữ chính
- Go
- Star
- 4.5k
- Fork
- 937
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 150
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kagent-dev/kagent
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kagent-dev/kagent#3790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
kagent-dev/kagent#3789 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
kagent-dev/kagent#3787 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Python memory summarization fails for Gemini models: the request has no model nameCó thể đã có người làm @BahaaMattar đã nhận 6 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3710 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kagent-dev/kagent
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
docker/model-runner#1118 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Screenshot missing in READMEĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100