Skip to main content

pi-dynamic-workflows-py

Dynamic workflow orchestration extension for pi-python.

Python port of @quintinshaw/pi-dynamic-workflows.

Install

pip install pi-dynamic-workflows-py

Overview

The workflow tool lets the LLM write a Python orchestration script that fans work out across isolated subagents via agent(), parallel(), pipeline(), and phase().

How a script runs

A script does not run in the host's interpreter. Each WorkflowRuntime.execute() starts a child process (standard library only, empty environment, empty scratch directory) and the script computes there. Anything with an effect — running a sub-agent, logging, asking the budget — is a request over a pipe that the host answers; the host treats whatever arrives on that pipe as untrusted.

  • Limits (SandboxLimits, passed as WorkflowRuntime(sandbox_limits=...)): memory, CPU time, open files, an optional wall-clock deadline, and caps on calls in flight, log output and phases. The kernel enforces the first ones (rlimits and NO_NEW_PRIVS on Linux; a Job Object and a lowered integrity level on Windows), so a script that spins or allocates is stopped and the host's event loop keeps running.
  • Values cross as JSON: args, result(...) and what agent() returns. budget is a read-only view of the host's books.
  • Errors: a script that raises makes execute() raise WorkflowScriptError (its str() is the script's own message); a script that is stopped or cannot be run raises a SandboxError.
  • agent(..., cwd=) must stay inside the project directory.

This is a process boundary with resource limits, not a security boundary against a script written to break out: the in-process audit hook that refuses open, os.*, socket.*, subprocess.* and ctypes.* is Python and can be undone by Python. What a script can still do then, per platform, is in docs/specs/2026-10-01-workflow-sandbox-design.md (section 9); run the agent in a container if scripts cannot be trusted. Sub-agents' tool calls still go through the session's permission policy.

macOS: weaker limits

On macOS the sandbox has no kernel limit on memory and none on the number of processes (measured in CI on macos-15 and macos-15-intel). The system does not enforce RLIMIT_AS, and there is no process-count limit. CPU time, open files, core size and file size are limited. A script can use as much memory as the machine has, and it can start child processes. Only the audit hook stands in the way, and a script written to break out can undo the hook (see above). Linux and Windows have kernel limits for memory and for processes; the tests check them there. The macOS tests that need them are skipped, with the reason in the test.

What you can do about it:

  • The workflow tool declares no "harmless" annotations. In the default permission mode (permission = "ask" in agent.toml), the agent asks you before every workflow call, and a sub-agent's tool call is judged by the session's tool of the same name. Keep ask on macOS. The modes auto and always-approve never ask, and headless runs (-p) use auto.
  • Do not start a workflow from a prompt or a project that you do not trust. Saved workflows of a project (<project>/.pi-python/workflows) load only for a trusted project.
  • If scripts cannot be trusted, run the agent in a container or a virtual machine.
  • There is no setting that turns the tool off for an installed extension. With the Python packages, do not install pi-dynamic-workflows-py (or uninstall it). The prebuilt zycode-agent program contains it.

Built-in Patterns

  • /deep-research — Research a question across the web with cross-checked sources
  • /adversarial-review — Investigate then cross-check findings with skeptical reviewers
  • /code-review — Multi-angle parallel code review
  • /multi-perspective — Analyze a topic from several perspectives, then synthesize
  • /codebase-audit — Run parallel checks against a codebase scope

Metadata

Release files for pi-dynamic-workflows-py 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pi-dynamic-workflows-py 0.6.1
File Size Uploaded Provenance Actions
pi_dynamic_workflows_py-0.6.1.tar.gz 93.4 kB Without provenance Details for pi_dynamic_workflows_py-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pi-dynamic-workflows-py 0.6.1
File Interpreter ABI Platform Actions
pi_dynamic_workflows_py-0.6.1-py3-none-any.whl Python 3 none any Details for pi_dynamic_workflows_py-0.6.1-py3-none-any.whl

Total release size: 146.6 kB

Release files / pi_dynamic_workflows_py-0.6.1.tar.gz

Download URL pi_dynamic_workflows_py-0.6.1.tar.gz
Size 93.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9e2ea359ecadfbff019436deda788c540bddd704985214b5686ea5cc831cfb38
BLAKE2b-256 checksum
How to use checksums
0d120fe42665f602c39ba69beaa52a92c77514ec8839ff4b7b5d91c3b766bc5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pi_dynamic_workflows_py-0.6.1-py3-none-any.whl

Download URL pi_dynamic_workflows_py-0.6.1-py3-none-any.whl
Size 53.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82e1e1ef7c92b23f685df35e7dfeb1eea88a48189cf40a1b04d79392ce074c5d
BLAKE2b-256 checksum
How to use checksums
6bd0c4ac3a128e9b656f23b77bcb04401c9b1814999abae53333905f7c67680d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pi-dynamic-workflows-py 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page