Feature · Durable agent sessions

Agent harness

Durable agent sessions for PHP, TypeScript and Python: threads, reconstructed session state, persisted provider, model and mode selection, exclusive locking and human approvals.

A bounded agent runtime runs nested subagents that carry their own budgets. Use it for agents that need persistent conversations, configurable modes, tool execution and approvals across requests.

  • PHP
  • TypeScript
  • Python

Capabilities

What it does

01

Sessions resolved per request

A session is one participant's live runtime: the active mode, provider and model, and the thread it is bound to. It is resolved from the store on every request, so any worker can continue it.

02

Threads that keep the whole exchange

A thread is a stored conversation, addressed by participant and scope. Each run records the resulting exchange, including tool calls, tool results and approval decisions.

PHP
$result = $session->send('Help with my order');

echo $result->text();
$result->awaitingApproval(); // true when a tool is waiting for a person

03

Modes

A mode defines the instructions, tools, approvals and limits for a run: a system prompt, a tool allowlist, approvals, skills, subagents and a step limit.

04

Approvals that default to no

A mode names the tools a person must approve. A turn that calls one stops and returns its pending approvals; unanswered approvals are denied, never run.

05

Subagents and budgets

A subagent is a nested run the parent calls like a tool. It runs in its own mode and session, with authority it was given rather than inherited, on a budget drawn from the parent's.

06

Durable state, checked

Threads, pending approvals and task lists live in the durable store, so another worker can continue a task list after a crash, a restart or a deploy. A store that reports itself as volatile is refused for durable state.

How it fits

Where it sits in the ecosystem

The PHP Harness builds on Prism core; in TypeScript and Python the runtime calls a model client you supply once per step. For individual model requests without session state, use Prism core directly.

A Harness session has a key, so it can own a Workspace, a Browser attachment or a Human+ attachment. PHP integrates with Laravel; TypeScript and Python run independently of any framework.

Install

Add it to your project

  1. 01

    particle-academy/prism-harness PHP

  2. 02

    @particle-academy/prism-harness TypeScript

  3. 03

    prism-ai-harness Python

The packages

On the registries

PHP · Packagist

particle-academy/prism-harness

TypeScript · npm

@particle-academy/prism-harness

Python · PyPI

prism-ai-harness