Metadata-Version: 2.5
Name: harnessweaver-monty
Version: 0.2.1
Summary: HarnessWeaver plugin: Monty sandbox.
Author-email: Muthu Kumaran R <rsmk7new@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,governance,guardrails,harness,llm,observability
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: harnessweaver>=0.1.0
Requires-Dist: pydantic-monty<2,>=1.1
Description-Content-Type: text/markdown

# harnessweaver-monty

A first-party [HarnessWeaver](../../../README.md) plugin for the Monty sandbox. It contributes `monty.sandbox`, a `Sandbox` that runs code-executing tools in [pydantic-monty](https://github.com/pydantic/monty) worker processes, never in the host process (RULES S4).

It is built on the same plugin contract any third-party plugin uses: one `hw.Plugin` object, published through the `harnessweaver.plugins` entry point under the namespace `monty` (see DESIGNS.md No. 13).

```bash
uv add harnessweaver-monty        # or: uv add "harnessweaver[monty]"
```

```yaml
# tools/python.tool.yaml
apiVersion: harnessweaver/v1
kind: Tool
metadata: { name: python }
spec:
  transport: code
  sandbox: monty                # short for monty.sandbox
  description: Run Python over the given rows and return the last expression.
  input_schema:
    type: object
    properties: { code: { type: string }, rows: { type: array } }
    required: [code]
  limits: { timeout: 2s, max_memory_mb: 64 }
```

The code in the `code` argument runs with the other arguments as globals, and the tool returns `{value, stdout}`, or `{error, stdout}` when the code raises. Sandboxed code can't open host files, reach the network or read the environment, and the manifest's `limits` cap its time, memory and printed output. Each call gets a fresh worker, so nothing leaks between calls. Importing the plugin imports nothing from pydantic-monty (S8).

## Conformance

From this package's directory (at the repository root, `make conformance` checks every first-party plugin):

```bash
uv run pytest --harnessweaver-conformance=monty
```
