state for session data that your agent and UI share. Use context, tools, and forwardedProps for application data that your agent’s context providers can read.
Send application data
Include these fields alongside the new user turn:
Harnest makes context available to your context providers; it does not automatically inject it into model instructions. Tool descriptions advertise frontend capabilities but do not register executable tools. Declare browser capabilities in your agent with
@client_tool.
Receive agent state
Harnest streams authored portable graph state from both ADK and LangGraph. ADK’s native bookkeeping is excluded. Your UI can use the outgoing state to update counters, selected records, or the outcome of an interaction. Treat incoming state as a shallow patch: sending a value for a key replaces that key’s value, rather than recursively merging a nested object. Keep the current message history and state when resuming an interaction so the snapshots retain the UI’s conversation.Keep authority on the server
Client context, state, and tool advertisements are untrusted application data. They do not change the authenticated user or authorize an action. Validate access to any resource named by the client in your server-side logic. State keys starting with_, app:, user:, or temp: are reserved and rejected on input.