You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce4fcb2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: python/packages/foundry_hosting/README.md
+60-7Lines changed: 60 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,10 +96,54 @@ encoding of the store name. For example:
96
96
97
97
### User isolation
98
98
99
-
When hosted on Foundry, the default state stores automatically isolate data by the
100
-
platform user ID supplied with each request. Sessions, workflow checkpoints, and
101
-
function approvals written for one user cannot be read or modified by another user.
102
-
No additional partitioning configuration is required when using the default stores.
99
+
Hosted requests require platform user and call IDs from the AgentServer request
100
+
context. Responses also requires the platform-configured `FOUNDRY_AGENT_SESSION_ID`
101
+
(`AgentConfig.session_id`) for sandbox identity; a different caller-supplied
102
+
`agent_session_id` fails closed. For Invocations, the
103
+
[platform routes by the `agent_session_id` query parameter](https://learn.microsoft.com/azure/foundry/agents/how-to/manage-hosted-sessions#how-each-protocol-binds-an-invocation-to-a-session).
104
+
When `FOUNDRY_AGENT_SESSION_ID` is present, it must match that query and the
105
+
resolved request context. When it is absent, only an explicit, nonempty routed
106
+
query matching the request context can identify the sandbox; duplicate query
107
+
IDs or a request without the query are rejected rather than using the SDK's
108
+
generated fallback ID.
109
+
This means an automatically created first Invocations session without a query
110
+
cannot access default hosted state when the platform does not configure the
111
+
session ID. The platform documentation does not guarantee that the environment
112
+
variable is provided for every sandbox.
113
+
114
+
`FoundryRequestScope.from_context(config, platform_context)` requires the
115
+
configured ID and remains strict for Responses and direct store providers. Only
116
+
the Invocations host accepts the verified routed-query alternative. Its
117
+
`storage_key` is a bounded hash of the framed user and sandbox IDs, not a caller
118
+
conversation or response ID.
119
+
120
+
| Identifier | Purpose |
121
+
| --- | --- |
122
+
| Foundry session ID | Platform sandbox for the hosted request and its MAF state. |
123
+
| Platform user ID / call ID | User isolation and per-request storage authorization/correlation. A call ID is **not** a conversation ID. |
124
+
| Responses `response.id`, `previous_response_id`, `conversation`| Caller-visible continuation and conversation IDs, used as item keys *within* the sandbox. |
125
+
| MAF `AgentSession.session_id` / `service_session_id`| Inner agent state and optional downstream service continuation; neither identifies the Foundry sandbox. |
126
+
| Workflow checkpoint ID | Inner workflow state within a checkpoint context, not a Foundry session ID. |
127
+
128
+
The default hosted MAF session, checkpoint, and approval stores use a `v2` namespace
129
+
derived from the hashed platform identity, with `user_isolation=True` and an explicit
130
+
platform `call_id` on each item operation. Checkpoint context IDs are hashed as well.
131
+
The same user in two hosted sandboxes cannot read the other's default MAF state.
132
+
Locally, the existing single-user store names and file-based fallback remain unchanged;
133
+
direct store constructors without a trusted `scope` also retain their existing local
134
+
behavior. Applications that supply custom store providers must implement equivalent
135
+
hosted user and sandbox isolation.
136
+
137
+
**Existing hosted state is not migrated.** The default stores never fall back to
0 commit comments