Use Agent API key for auth - #34
Merged
Merged
Conversation
smoreinis
marked this pull request as ready for review
August 4, 2025 21:09
There was a problem hiding this comment.
Pull Request Overview
This PR transitions the authentication mechanism from using agent IDs to agent API keys, enabling key rotation without changing agent identities. The registration logic has been refactored into a shared utility module for reuse across different components.
Key changes:
- Extracted agent registration logic into a shared utils module
- Updated authentication to use API keys instead of agent IDs
- Added registration capability for Temporal workers
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/agentex/lib/utils/registration.py |
New shared module containing extracted agent registration logic with API key handling |
src/agentex/lib/sdk/fastacp/base/base_acp_server.py |
Refactored to use shared registration module and updated auth to use API keys |
src/agentex/lib/environment_variables.py |
Added AGENT_API_KEY environment variable support |
src/agentex/lib/core/temporal/workers/worker.py |
Added agent registration call during worker startup |
src/agentex/lib/adk/utils/_modules/client.py |
Updated authentication header to use API key instead of agent ID |
examples/tutorials/00_sync/000_hello_acp/project/acp.py |
Removed trailing whitespace |
jasonyang101
reviewed
Aug 5, 2025
jasonyang101
reviewed
Aug 6, 2025
jasonyang101
approved these changes
Aug 6, 2025
stainless-app Bot
pushed a commit
that referenced
this pull request
Dec 18, 2025
feat(api): update via SDK Studio
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.
Instead of using the agent ID which is returned by the register call, use the agent API key (also returned by the register call) so that the key can be rotated if desired without changing the agent ID.
Additionally, since Temporal workers will also need to authenticate their request, added a registration call in the worker startup (and refactored the registration out into a shared utils module).