Sandbox container tool code for inspect_ai
Project description
Design
Inspect calls into the sandboxed image are done statelessly via docker exec inspect-tool-support.
Some tools can be implemented without the need for any in-process state. For those tools, the tool code will be executed within the inspect-tool-support process.
For tools that require the maintenance of state over the lifetime of and sandbox, this image marshals tool calls into a long running process via JSON RPC to an http server process. That server then dispatches tool calls to tool specific @method handlers.
Stateful Tool Design Pattern
Each stateful tool should have its own subdirectory that contains the following files:
-
json_rpc_methods.pyThis module contains all of the JSON RPC
@methodfunctions — one for each tool (e.g. the web browser tool is actually a set of distinct tools). It is responsible for unpacking the JSON RPC request and forwarding the call to a transport-agnostic, strongly typed, stateful controller. -
tool_types.pyThis module includes the
pydanticmodels representing the types for tool call parameters and results. -
controller.pyThis is transport-agnostic, strongly typed code that manages the tool specific in-process state and performs requested commands.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inspect_tool_support-0.1.8.tar.gz.
File metadata
- Download URL: inspect_tool_support-0.1.8.tar.gz
- Upload date:
- Size: 81.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd66192a865747de8c0e2ac73d87eaa17ccab9d31b9d6758c2b83f3fad99d1d8
|
|
| MD5 |
eb57c4ce2b4c0eaf81bb6babb7d176b9
|
|
| BLAKE2b-256 |
c7e85a14831e8464d4bf32ef696ab2535da7838e1538f41857339020cd9b2e1e
|
File details
Details for the file inspect_tool_support-0.1.8-py3-none-any.whl.
File metadata
- Download URL: inspect_tool_support-0.1.8-py3-none-any.whl
- Upload date:
- Size: 72.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2125e281f12622cd501f4d1c817f555ad91f100254f8e99b920fa0f8674326c
|
|
| MD5 |
4043512f3589459e2cf80e48292569af
|
|
| BLAKE2b-256 |
839cc2c324340e5f80ab0a69d2b261c692d8a2a7b4ccfbb79aa83e0b9359094b
|