> For the complete documentation index, see [llms.txt](https://vampauth.gitbook.io/vampauth-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vampauth.gitbook.io/vampauth-docs/development/sessions.md).

# Sessions and concurrency

Turn on **Loader session leases** when a running script should keep renewing its authorization.

The loader renews roughly once a minute. The lease window is 150 seconds. A denied or unrenewed lease ends the authorized run. The runtime can cancel the script's root task; use `VAMPAUTH.is_active()` or `VAMPAUTH.assert_active()` in tasks you start yourself.

## Concurrent runs

The project setting `loader_max_concurrent` allows 1–10 active keyed leases per key, default 1. Reaching that limit returns `instance_limit`. It doesn't allow a key to bind to more devices.

An old run can keep a slot until it releases or its lease expires. Close it and let that window pass before retrying. Repeatedly opening new instances won't free the old slot.

## Presence without leases

With leases disabled, heartbeats provide advisory presence rather than the same ongoing access enforcement. Advisory session state lives in the serving process and resets on restart. Keyless runs don't use keyed leases.

Changes to keys, bindings, loaders, or routing can invalidate a lease or require another execution. `configuration_changed` means fetch the current snippet and start a fresh run; don't try to repair a session token by hand.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://vampauth.gitbook.io/vampauth-docs/development/sessions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
