Repository navigation
Releases
v0.1.0
First release: the guarded agent workspace, in Python
prism-ai-workspace is the Python port of
particle-academy/prism-workspace — a filesystem an agent is allowed to use,
where "allowed" is enforced rather than documented.
pip install prism-ai-workspace
Zero runtime dependencies. Python 3.10+.
Workspace is the async-first API; SyncWorkspace is its blocking facade, and
neither is a wrapper of convenience over the other -- an agent loop is async and
a script is not, and a port that shipped only one of them would push that
mismatch onto every caller.
Stable owner addressing, optional authorization, streamed listings, stable
failure codes, lexical path guarding, and realpath-based symlink containment.
Lexical guarding rejects ../../etc/passwd by reading the path. That is not
enough on its own: a symlink inside the workspace pointing out of it is a path
with nothing wrong in its text. So the boundary is also checked by realpath,
after resolution, which is the only place the question can actually be answered.
A refusal is PathRefused carrying a code, not a boolean -- a caller that
cannot tell "outside the boundary" from "does not exist" ends up guessing, and
guessing in an agent loop means retrying against the guard.
This is a PORT, and the reference is PHP. prism-parity runs a shared fixture
through PHP, TypeScript and Python and compares the bytes, and the workspace
family is one of the ones where all three agree. That is a stronger claim than
a green suite in one language: every language's own tests assert against the
values its own code produced.