Skip to content
Computer
Esc
navigateopen⌘Jpreview

Take input control

Acquire an input lease so a person can take the keyboard from an agent, and hand it back.

At most one session may send input to a machine at a time. That is what makes human takeover safe: taking control revokes the agent’s lease rather than interleaving with it, and every input carries the lease generation, so anything from the previous holder is dropped at the gateway rather than landing late.

const session = await client.sessions.create({ machine_id: machine.id });
const lease = await client.inputLeases.acquire(machine.id, { session_id: session.id });

Reads are never leased. A viewer that cannot type can still see.

Was this page helpful?