fix: reject spoofed grpc runtime sender types#7874
Draft
maxpetrusenkoagent wants to merge 1 commit into
Draft
Conversation
Signed-off-by: maxpetrusenkoagent <max.petrusenko.agent@gmail.com>
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.
Why are these changes needed?
Fixes a spoofing gap in the distributed gRPC runtime host: a worker could send an RPC request or publish a CloudEvent while claiming another worker's registered agent type as the sender. Target agents receive that value as
ctx.sender, so the host should not forward explicit sender identity claims unless the sending client owns that agent type.This is a narrow first step for #7372's cryptographic governance discussion. It does not add a full passport/delegation protocol, but it hardens the existing runtime invariant that the gateway/host should not relay forged agent identity metadata.
What changed
source.typeagainst the gRPC client that registered that agent type.("unknown", "unknown")sender attributes for new anonymous publishes.("unknown", "unknown").Related issue number
Refs #7372
Checks
Test plan
python -m pytest packages/autogen-ext/tests/test_worker_runtime.py -q->7 passed, 16 skippedpoe --directory ./packages/autogen-ext format->198 files left unchangedpoe --directory ./packages/autogen-ext lint->All checks passed!pyright packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py packages/autogen-ext/tests/test_worker_runtime.py->0 errors, 0 warningsmypy packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py packages/autogen-ext/tests/test_worker_runtime.py->Success: no issues found in 3 source filesFull
poe --directory ./packages/autogen-ext pyrightwas also attempted, but this checkout is missing optional extras used by unrelated extension modules (cv2,ffmpeg,whisper,chromadb,semantic_kernel,graphrag), so the package-wide command reports pre-existing missing-import errors outside this diff.Second-agent review
Preferred reviewer
claude -pwas available but failed auth with 401, so I used the required fallback reviewer:hermes chat -Qon/tmp/oss-pr-second-agent-review.diff.Result:
CLEANReviewer notes: no blocking correctness, regression, security, duplicate/superseded-work, or maintainer-fit issues found. Earlier blocking review findings about unregistered senders, RPC hangs, and legacy anonymous publishes were fixed before this PR was opened.