What a session is
session is not an autonomous actor — it’s a scope, executed
immediately, the same instant a plain if block would be. An
agent pursues something and has its own
lifecycle; a session just bounds execution.
It gets its own child scope (a variable assigned inside is invisible
outside — see Variables & Scope) and its
own delegation/policy: set delegation inside only affects that session,
and reverts the moment it ends.
How the scoping works
Delegation and policy both live on the current scope, resolved by walking up the parent chain — the same lookup a variable read uses:- looking up the model with nothing set yet walks up and finds the outer one (inherit by default)
set delegationinside writes to the session’s own slot, never the parent’s (no leaking out)
set delegation inside a function body never leaks to
its caller either. See
Scoping & Delegation for the
mechanism.
Continue
Agents
The autonomous-actor counterpart to
session.Policy
policy: allow/deny uses this exact same scoping mechanism.
