Skip to content

Conversation

@vverman
Copy link
Contributor

@vverman vverman commented Nov 7, 2025

This feature implements the ability for agentic identities to authenticate themselves via X509 cert bound tokens. We are limiting the scope here to only cloud run based agentic workloads.

@vverman vverman requested review from a team as code owners November 7, 2025 01:55
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Nov 7, 2025
@vverman vverman assigned vverman and nbayati and unassigned vverman Nov 7, 2025
@vverman vverman added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 7, 2025
Copy link
Contributor

@nbayati nbayati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall a really good PR! Just a few small comments on the implementation. I'll review the unit tests next.

private AgentIdentityUtils() {}

/**
* Gets the Agent Identity certificate if available and enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can make this documentation more accurate by saying something along the lines of "Loads and parses the Agent Identity certificate if available and not opted out. "

long startTime = timeService.currentTimeMillis();
boolean warned = false;

while (true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current while (true) polling loop relies on checking the elapsed time in each iteration. While this works, a more deterministic and clearer approach would be to pre-calculates the number of fast and slow poll cycles and builds a list of sleep intervals. Then we can use a simple for loop to iterate through these fixed intervals.

This will not only make the code more readable, but it'd also be less error-prone and safer to maintain over the long term.

Comment on lines 152 to 155
} catch (Exception e) {
// Ignore exceptions during polling and retry
LOGGER.log(Level.FINE, "Error while polling for certificate files");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching any exception and logging it at every loop iteration can make the logs noisy, instead you can use the warned flag to surface the user friendly warning here once.

We can also limit the catch to only the type of exceptions we are interested in, which would be the IOException thrown from extractCertPathFromConfig().

@vverman vverman force-pushed the feat/agentic-identities-cloudrun branch from e0d450a to 5353838 Compare December 2, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants