Skip to content

Interview question · Agent Frameworks & SDKs

In an ADK agent, one customer's shipping address appeared in another customer's conversation. How did it happen?

ADK's state dictionary has four lifetimes chosen by key prefix. One wrong prefix turns a private fact into something every user of the app can read.

hardNewUpdated Nov 2026

TL;DR: Most likely the address was written under an app:-prefixed key, which ADK shares across every user and session of the application, instead of user: (this user's sessions) or no prefix (this session). Confirm from the session events that wrote the key, fix the prefix, purge the shared key, audit every app: write for user data, and add a test that two users never see each other's state.

How to approach it

Treat it as a privacy incident first (contain, purge, assess exposure), then find the mechanism, then fix and guard. Know ADK's four state scopes.

A strong answer

Contain. Remove the leaked value from shared state and stop the code path that writes it. Identify which conversations read the key while it held another user's data; that is the exposure.

Find the write. ADK records state changes as events in the session. Search for the key and find which tool or callback set it. The likely culprit is a tool that stores "last shipping address" for convenience as app:last_address because the developer wanted it to survive new chats.

Explain the scopes.

PrefixShared byCorrect for
app:Every user of the appConfiguration, flags
user:One user's sessionsTheir address, with consent
noneOne sessionThe current order
temp:One invocationScratch values
def visible_to(state_writes, reader):
    seen = {}
    for writer, key, value in state_writes:
        if key.startswith("app:") or (key.startswith("user:") and writer == reader):
            seen[key] = value
    return seen

writes = [("alice", "app:last_address", "12 Elm St"),
          ("alice", "user:address", "12 Elm St")]
print(visible_to(writes, "bob"))  # => {'app:last_address': '12 Elm St'}

Bob sees Alice's address through the app: key and not through her user: key.

Fix and guard.

  • Change the write to user:address, with the consent and correction rules any stored personal data needs.
  • Lint or review rule: no personal data under app:; consider a callback that rejects app: writes containing fields classified as personal.
  • Test: two simulated users, each writes their data, each reads; assert no overlap.
  • Check the session service is configured per environment so test data never shares storage with production.

What interviewers probe next

"Could unprefixed state leak?" Only if session ids are reused or guessable across users; scope session ids to the user and authenticate session access.

"What about the model's memory?" ADK's memory service is separate; the same tenant-isolation rules apply to whatever it retrieves.

How it's scored

Weak: Clears the cache and redeploys.

Hire: Identifies the app: prefix and changes it to user:.

Strong Hire: Contains and assesses exposure, finds the write from session events, explains all four scopes, fixes and purges, adds a guard against personal data in app: state and a cross-user isolation test.

Common mistakes

  • Treating it as a model hallucination.
  • Fixing the key without purging the shared value.
  • No test that would catch the next wrong prefix.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.