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 ofuser:(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 everyapp: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.
| Prefix | Shared by | Correct for |
|---|---|---|
app: | Every user of the app | Configuration, flags |
user: | One user's sessions | Their address, with consent |
| none | One session | The current order |
temp: | One invocation | Scratch 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 rejectsapp: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.