Practical technical guides / Recent development: google/adk-python commit d61f428 (2026-11-06 01:40 UTC)

ADK Python Stops Returning Exception Text to A2A Peers and Trigger Callers: Error IDs and What Still Leaks

ADK Python commit d61f428 (6 November 2026) returns a fixed summary and an error id instead of exception text. Measured before and after, and the fields it does not cover.

By Sandeep Belgavi · Published 2026-11-06

ADK Python commit d61f428 (6 November 2026) returns a fixed summary and an error id instead of exception text. Measured before and after, and the fields it does not cover.

What changed on 6 November

A commit to google/adk-python authored at 01:40 UTC on 6 November 2026 (still 5 November in Pacific time), d61f428, is titled "fix: stop returning uncaught exception text to remote A2A peers and trigger callers". It changes what an ADK server tells a remote caller when an agent run fails. The commit is on the main branch and was not part of a tagged release on 6 November; the latest release then was v2.13.0 from 23 October.

The commit message states the problem directly. Before the change, the A2A executors put str(exception) into the failed task's status message, and the /trigger/* handlers for Pub/Sub and Eventarc put it into the HTTP error detail. "Exception text routinely contains absolute paths, installed-package layout, environment variable names and echoed request payloads, so any caller that can reach these endpoints could map the host by provoking errors."

This guide measures the difference on the parent commit and on the fix, explains the mechanism and its stated limit, and turns it into a pattern for any agent endpoint, ADK or not.

Measured: one failing request, two commits

The companion probe builds a FastAPI app with ADK's TriggerRouter and a minimal agent, a BaseAgent subclass that raises FileNotFoundError for a synthetic configuration path before any model call. It posts a Pub/Sub push message to /apps/returns_helpdesk/trigger/pubsub once with valid data and once with invalid base64. ADK was installed from Git at the parent commit, 656696c, and at d61f428, in two separate virtual environments.

CommitRequestStatusDetail returned to the caller
656696c (parent)agent raises500Agent processing failed: [Errno 2] No such file or directory: 'C:/srv/bookstore/returns-agent/config/refund-gateway.json'
656696c (parent)bad base64400Invalid base64 message data: Invalid base64-encoded string: number of data characters (9) cannot be 1 more than a multiple of 4
d61f428 (fix)agent raises500Agent processing failed. (error_id: 399ce689e1c9)
d61f428 (fix)bad base64400Invalid base64 message data. (error_id: f8ca26e6fc7b)

On the fix, the log carried both ids next to the full exceptions: Error processing Pub/Sub message [error_id=399ce689e1c9] with the traceback attached. With ADK_DEBUG_ERRORS=1 set, the fix returned the detail again, Agent processing failed. (error_id: 5c5b410fbfe0): FileNotFoundError: [Errno 2] ..., path included, as the commit intends for local debugging.

The base64 case shows why this is a boundary rule rather than a list of dangerous exceptions. That error text leaks nothing sensitive, and it was redacted anyway, because the handler cannot know in advance which exception will carry what.

The mechanism

The commit adds an internal module, google/adk/utils/_error_reporting.py. Its report_error function mints an id from the first 12 hex characters of a UUID4, logs the exception with its traceback under that id, and returns a fixed summary plus the id. Its docstring makes the design rule explicit: the summary "must be a constant -- anything interpolated into it is not covered by this redaction."

The call sites are the top-level exception handlers of both A2A executors, which now put the redacted text into the failed TaskStatus message, and the Pub/Sub and Eventarc trigger handlers, including the base64 decode path. One more change is easy to miss. TransientError, raised after rate-limit retries are exhausted, used to format the provider's error text into its own message; now it says only "Rate limit exceeded after N attempts." and chains the provider error as its cause. The commit explains why: "redacting only at the boundary would have let that one through", because the trigger handler's retryable branch builds its response from the TransientError.

The environment variable ADK_DEBUG_ERRORS restores detail. The module's own note says enabling it on a network-reachable deployment "restores the disclosure this module exists to prevent."

What it does not cover

The commit message is explicit about one limit: "structured Event.error_message fields emitted on ADK events are still relayed by the A2A event converters." If a tool or model callback produces an event with an error message built from an exception, that text can still reach an A2A peer through the event stream. The fix covers uncaught exceptions at the top-level handlers, not every field an event can carry.

Two other gaps are worth checking in your own deployment, though the commit does not discuss them. Framework-level errors that occur before ADK's handlers run, such as request validation in FastAPI, produce their own response bodies. And anything your own tools put into tool results or state is outside this change entirely.

The pattern for any agent endpoint

The rule generalises: an exception message is written for whoever reads the log, not for whoever sent the request. The companion example implements it with the standard library:

def report(logger, exc, summary):
    """Log the full exception under a new id and return the caller-facing body. `summary` must be a constant."""
    error_id = uuid.uuid4().hex[:12]
    logger.error('%s [error_id=%s]', summary, error_id, exc_info=exc)
    body = {'error': summary, 'error_id': error_id}
    if debug_enabled():          # off unless an explicit environment flag is set
        body['detail'] = f'{type(exc).__name__}: {exc}'
    return body

Put it at the single place where an exception becomes a response, and nowhere else. A support person at Belgavi's Book Store who receives "Tool execution failed. (error_id: 3f1c9a7e55d2)" from a customer can search the logs for the id and find the traceback; the customer, or anyone probing the endpoint, learns nothing about the host.

For the fields the boundary does not see, add an outgoing scan in tests. The example walks every string in an outgoing payload, including nested event lists, and flags Windows and POSIX paths, environment-variable-like names ending in _KEY, _TOKEN, _SECRET, _PASSWORD or _URL, Python traceback frames and site-packages. Run against a synthetic event whose error_message contains the raw FileNotFoundError text, it reports $.events[0].error_message as a Windows path, which is exactly the gap the commit message describes.

A scan like this is a test aid, not a filter to deploy on live traffic: patterns miss things and redacting in flight hides bugs. Use it to fail a build when a new code path starts relaying exception text.

Upgrading and verifying

  1. If you serve ADK agents over A2A or the trigger routes, plan to pick up this change from the first release that contains it, and confirm by checking that google/adk/utils/_error_reporting.py exists in the installed package.
  2. Provoke a failure in a staging deployment, for example with a misconfigured tool, and read the response body: you should see the fixed summary and an id, and the same id in the log.
  3. Make sure ADK_DEBUG_ERRORS is not set in any deployed environment. Treat it like a debug port.
  4. Review your own callbacks and tools for code that copies exception text into Event.error_message, tool results or state, and replace it with a constant plus an id.
  5. Keep correlation ids short-lived in meaning: they identify a log entry, not a user, and should not be reused across requests.

Verification

The companion example has seven offline tests: the caller receives only the summary and a 12-character id for three synthetic failures, the log holds the path, the debug flag restores detail, the outgoing scan finds the relayed event field and recognises each pattern, and the recorded probe runs at 656696c and d61f428 show the behaviour in the table above, with the returned ids matching the logged ones. The probe was run on Windows 11 with ADK built from Git; no model was called and no A2A peer was involved, so the A2A executor change is described from the diff and the commit's own tests rather than measured here.

Primary references and authorship

Sources dated on or before 6 November 2026. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/error_id_redaction. Views are my own and do not represent any employer, past or present.