Long Sessions let an agent work autonomously for a bounded time in an isolated sandbox. They stream progress, save artifacts, ask before risky actions, consume prepaid AI credits, and pause when credits run out.Documentation Index
Fetch the complete documentation index at: https://dench.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Start a Long Session
Use a clear goal and duration. Include safety limits in the goal.30m, 1h, 3h, and 5h. until-done maps to the maximum run budget.
The Long Session goal. Keep it specific and include safety constraints for risky actions.
Time budget, such as
30m, 1h, 3h, 5h, or until-done.Model override. Omit this to use the server default.
API base for
/api/autonomous/runs. Defaults to http://localhost:3000. You can also override this with --host, DENCH_AUTONOMOUS_API_BASE, or DENCH_HOST.Return the raw run payload with a
runUrl added when the API returns a run ID.Approval rules
The CLI sends conservative approval rules by default: publishing, spending, external messages, production changes, and secrets. You can make the rules explicit with flags:Credits
Long Sessions use prepaid AI credits. If credits are empty, the CLI and API return a structured blocker:Paused runs
If a run pauses because credits are empty:- Open the run detail page.
- Top up credits through the approved billing path.
- Click
Resume. - Confirm the same run moves back to
startingorrunning.
Artifacts and suggested work
Long Sessions should save durable work as artifacts:- reports
- research notes
- content drafts
- patches
task_suggestionartifacts for follow-up work
Safe and risky goals
Safe goals can include negated risky words:Failure recovery
| Problem | What to do |
|---|---|
missing_goal | Retry with a clear goal and safety limits. |
invalid_duration | Use 30m, 1h, 3h, 5h, or until-done. |
unauthorized or agent_session_invalid | Run dench sessions --json, then dench use <session-key-or-workspace-slug>, or run dench onboard again if the session expired. |
ai_credits_required | Top up credits from the topUpUrl, then retry or resume. |
| Sandbox setup failed | Save the error as an artifact or log, then ask the human whether to retry. Do not keep retrying silently. |
| Missing Daytona, Bedrock, 1Password, or Exa credentials | Report the missing credential and wait for an admin. Do not invent secrets. |