Data residency: pin an agent's inference geography
An agent that touches regulated data needs an answer to one question before it ships: where do its model requests run. Answering it in a proxy or a runbook leaves the guarantee outside the system that enforces it.
model.inference_geo puts the answer on the agent definition. It pins the geography that serves the agent's model requests, is validated against the workspace's residency policy, and is enforced on every turn, so the constraint travels with the agent and holds even if the policy changes after the agent shipped.
how the pin resolves against the workspace's
allowed_inference_geos
and
default_inference_geo
the update semantics that clear a pin
overriding the geography for one session with
agent_with_overrides
1. Set up the client
- Pin the agent to US inference
inference_geo sits inside the model config next to effort and speed. The accepted values are "global" and "us". Leave it out and every model request resolves to your workspace's default_inference_geo at the moment that request is served, which means a later change to the workspace default reaches sessions that are already running. Set it and the pin is fixed on the agent.
e="padding-left:8ch;text-indent:-8ch"> }
],
betas=BETAS,
)
print("session pin:", session.agent.model.inference_geo)
with client.beta.sessions.events.stream(session.id, betas=BETAS) as stream:
for ev in stream:
if ev.type == "agent.message":
print("".join(b.text for b in ev.content if b.type == "text"), end="")
elif ev.type == "session.status_idle":
print(f"\n[idle] stop_reason={ev.stop_reason.type}")
break