Feature · Agent file storage

Workspace

Prism Workspace gives an agent a directory of its own to keep its work in, in PHP, TypeScript and Python.

Every path is checked before it touches the disk, so a path the model wrote cannot read or write outside the workspace.

  • PHP
  • TypeScript
  • Python

Capabilities

What it does

01

One owner, one directory

The same owner always resolves to the same directory, so a later request or a fresh worker finds the files an earlier run wrote.

TypeScript
const workspace = new Workspace('/srv/agent-workspaces', session);

await workspace.write('reports/q1.md', content);
const markdown = await workspace.read('reports/q1.md');

02

A path guard in front of every call

Traversal, absolute and device paths, null and control characters, look-alike separators, percent-encoded dots, NTFS streams and reserved names are refused without touching the disk.

03

Links cannot leave

On local disks a second check resolves the real path and refuses one that leaves the workspace through a symbolic link or junction.

04

Verify the boundary yourself

The escape corpus ships with the package: 134 hostile paths, each with the refusal code it must produce, written into a real workspace and checked for anything that got out.

05

Streaming listings

Listing streams, so a directory of ten thousand files does not have to be loaded at once.

06

Your authorization rule on top

Authorization adds your own rule: whether this user or agent may do this operation here. In PHP it maps to Gate abilities. It is off by default.

How it fits

Where it sits in the ecosystem

Workspace is a storage API for your application code. It does not register model tools and it never executes files; to let a model read or write files, define your own tools that call it.

PHP builds each workspace on a Laravel filesystem disk (local, S3 or any other Flysystem driver). TypeScript and Python have no runtime dependencies and work on the local filesystem. A Harness session can be the owner, so a resumed session finds its files again.

Install

Add it to your project

  1. 01

    particle-academy/prism-workspace PHP

  2. 02

    @particle-academy/prism-workspace TypeScript

  3. 03

    prism-ai-workspace Python

The packages

On the registries

PHP · Packagist

particle-academy/prism-workspace

TypeScript · npm

@particle-academy/prism-workspace

Python · PyPI

prism-ai-workspace