agent-framework-plimsoll
An agent with a shell runs whatever commands its model writes. Microsoft Agent Framework's own LocalShellTool runs them
on your machine ("arbitrary commands run on the host with the agent's privileges", in its own error message), and
DockerShellTool runs them in a container on the agent's machine. This package runs them in plimsoll instead, a
sandbox service you run yourself, possibly somewhere else, and it has no fallback: if the sandbox is weaker than you
asked for, nothing runs.
It has two parts:
PlimsollShellTool, the agent's shell over one plimsoll session: the files a command writes, the shell's directory and its exported variables are there for the next command.plimsoll_code_tool, a tool that runs each call's Python or JavaScript in a fresh sandbox.
Install
pip install agent-framework-plimsoll
It needs a running plimsolld, the plimsoll daemon, reachable from the agent
(getting started (EXTERNAL · source repo ↗)).
The shell tool needs a provider with sessions: docker (with a project image), E2B or OpenShell today
(which providers (EXTERNAL · source repo ↗)).
Sessions are off until the daemon is started with SANDBOX_MAX_SESSIONS set (for example SANDBOX_MAX_SESSIONS=4);
without it entering PlimsollShellTool raises plimsoll's UnsupportedError, saying the daemon has no sessions.
Python 3.11 or later, as Agent Framework requires.
Use the shell tool
from agent_framework import create_harness_agent
from agent_framework_plimsoll import Client, PlimsollShellTool
async with PlimsollShellTool(Client("https://plimsoll.internal:8746", token=TOKEN),
minimum_isolation="kernel") as shell:
agent = create_harness_agent(chat_client, shell_executor=shell)
session = agent.create_session()
print(await agent.run("Count the lines in every .py file here.", session=session))
The tool is Agent Framework's shell executor (start, run, close, as_function), so the harness gives it to the
model as its run_shell tool and its environment provider runs a few commands through it to tell the model what shell it
has. With an agent of your own, client.get_shell_tool(func=shell.as_function()) is the same tool.
What the shell tool needs and does:
- The floor is yours to set.
minimum_isolation(process,container,kernelorvm) has no default. When the session opens, its tier is checked against the floor before any command is sent; below it, the session is closed andInsufficientIsolationErroris raised. - One session for the conversation. A process left running in the background is stopped when its command ends. A
session left idle is suspended by the daemon and resumes, files kept, on its next command. Once the session has ended
(its lifetime ran out, the daemon closed it, or you closed the tool), every later command raises
SessionEndedError; the tool never opens a fresh sandbox in its place, because the agent would take it for the one holding its files. - A refusal raises, and a command that may have run stops the run. A command plimsoll refused before anything ran,
and a command on an ended session, raise plimsoll's own exceptions, and the model is shown the framework's error result
("Error: Function failed.", with the detail only if you set the framework's
include_detailed_errors), never a refusal dressed as command output. A command that may have run without an answer to show for it (the answer was lost, the run ended without the command's report, or any error plimsoll cannot vouch ran nothing) ends the agent's run instead:agent.runraises Agent Framework'sMiddlewareFailure, whose__cause__is plimsoll's error, so the model never gets the chance to run it again. They are plimsoll's exceptions, not Agent Framework's own shell errors, because its environment provider reads a probe that raises one of those as a command that is not installed. A command that runs and fails, and one past its time budget, are normal results. - No human approval by default. The tool's
approval_modeisnever_require: the sandbox, not a person, is the boundary. Microsoft's ownLocalShellToolandDockerShellTooldefault toalways_require, which asks a person to approve each command, so swapping one of them for this tool drops that step unless you keep it:PlimsollShellTool(client, minimum_isolation="kernel", approval_mode="always_require"). - Every command has a budget, 120 seconds unless you set
timeout;max_timeoutcaps any budget. plimsoll enforces it: the daemon stops the command and kills whatever it left running. - The shell is the image's. On plimsoll's docker images that is BusyBox
sh, not bash; the tool's description tells the model so. - The environment provider describes the agent's machine, not the sandbox. Agent Framework's
ShellEnvironmentProvidertells the model it is "operating a POSIX shell session on" a description of the operating system it reads with Python'splatform.platform()in the agent's own process, which names the agent's host, not plimsoll's Alpine image or the sandbox's kernel. Itsinstructions_formatteroption replaces that text.
Use the code tool
from agent_framework import Agent
from agent_framework_plimsoll import Client, CodeExecutor, plimsoll_code_tool
tool = plimsoll_code_tool(CodeExecutor(Client("https://plimsoll.internal:8746", token=TOKEN)))
agent = Agent(client=chat_client, tools=[tool])
The model gets back JSON saying whether the code ran (yes, no with the reason, or unknown), the output, the exit code,
whether anything was cut short or timed out, the isolation tier the code ran behind, and the SHA-256 of the run's
record. The tool never raises: a refusal is information for the model, and Agent Framework ends a request after three
tool errors in a row. CodeExecutor requires the kernel tier by default. The tool's default language is Python,
which on docker needs a project image with python3 in it (SANDBOX_DOCKER_PROJECT_IMAGE=plimsoll/sandbox-python:latest):
on the default image every Python call comes back refused.
One web API, if you grant one. CodeExecutor(client, grant_profile="lights", api_description=...), with a profile
the operator configured on the daemon and the description plimsoll-specgen wrote for it, lets the code tool's code call
that profile's routes, and nothing else, through plimsoll's broker, which adds the API's key outside the sandbox.
JavaScript works on every provider that gives a project run a grant; Python too on docker and openshell, through
import plimsoll_host (pass languages=("javascript",) for a daemon elsewhere: the default, Python, is refused there
when the tool is built). The tool reads the daemon's answer when it is built, offers only the languages that can call
the API there, and tells the model the routes; the model never names a profile. The code can do whatever an allowed
route permits and read whatever it returns
(capability grants (EXTERNAL · source repo ↗)).
The shell tool's session takes no grant.
What reaches your application
Each command's answer carries what plimsoll states about the call, and nothing of it comes from what the command printed:
await shell.run(command)returns aPlimsollShellResult, Agent Framework's ownShellResultwith the tier the command ran at (isolation), the sentence the provider states beside the tier (isolation_qualification, empty when it states none), how the run ended (outcome), the SHA-256 of the run record the client checked (record_sha256) and the checked result itself (result, whoserecordis the record).- Through an agent, each command's function result keeps the model's text, and its text item's
additional_propertiescarry the five fields Microsoft's own shell tool puts there (stdout,stderr,exit_code,truncated,timed_out) and plimsoll's labels:plimsoll_dispatched(yes,no, orunknownwhen an error left it open),plimsoll_refused(the reason, when nothing ran),plimsoll_outcome,plimsoll_isolation,plimsoll_isolation_qualificationandplimsoll_record_sha256. The code tool's function result carries the same labels. Each value is checked against the values plimsoll can state and left out if it does not match. - A refusal, which the shell tool raises, reaches a function middleware of yours as the exception itself, with its
reason in
not_dispatched;call_labels(exception)gives the same labels.
from agent_framework import function_middleware
from agent_framework_plimsoll import call_labels
@function_middleware
async def record_plimsoll(context, call_next):
try:
await call_next()
except Exception as e:
log.info("refused or lost: %s", call_labels(e))
raise
log.info("ran: %s", context.result[0].additional_properties)
agent = create_harness_agent(chat_client, shell_executor=shell, middleware=[record_plimsoll])
Retries
Agent Framework does not run a failed tool call again by itself: a tool's exception becomes one error result for the
model, and three in a row end the request. After a refusal the model may ask for the same command again, which is safe,
since nothing ran; after a command that may have run, the run has already stopped. If you add a retry of your own,
ask plimsoll_client.retry_on(exception) first: it says yes only to a refusal plimsoll marked as having run nothing,
when another try may pass (the daemon was at capacity, or could not be reached before anything was sent). Every other
error may have followed the command running, and a second run could repeat what it did.
Tracing
When Agent Framework's OpenTelemetry instrumentation is on (it is by default) and your application has an OpenTelemetry
SDK recording spans, the framework opens a span for each tool call, and both tools add plimsoll's labels to it as
attributes named plimsoll.dispatched, plimsoll.refused, plimsoll.outcome, plimsoll.isolation,
plimsoll.isolation_qualification and plimsoll.record_sha256, on results and on refusals alike. They never add the
command, the code or the output. Whether the framework itself records a tool's arguments and result on that span is the
framework's own sensitive-data setting, not this package's.
What it is not
- Not a hosted service. You run
plimsolldon your own machine or cluster, with a provider you pick (isolation tiers (EXTERNAL · source repo ↗)). - Not attestation. A reported tier is the daemon's configuration and provider evidence plus a startup check, not hardware proof.
- Not supported: an interactive terminal; a session reattached from another process (the tool holds its session in the process that opened it); a CodeAct provider (Agent Framework's other way to run code, as Microsoft's Hyperlight and Monty packages do).
Versions
This package's version moves with plimsoll's releases, and each version requires the plimsoll-client release of the
same number, which holds the code (plimsoll_client.agent_framework). Client, CodeExecutor, PlimsollShellTool,
PlimsollShellResult, plimsoll_code_tool and call_labels here are plimsoll-client's own names, gathered so an agent
imports from one place. It is tested with, and installs with, exactly agent-framework-core 1.26.0 and exactly
agent-framework-tools 1.0.0b261112, the framework's shell tools, a beta released about weekly: pip installs those
versions beside it and refuses others, and each new release of either is tested before its pin moves. The tool marks itself as the agent's shell with a constant from a private module of Agent
Framework (agent_framework._tools.SHELL_TOOL_KIND_VALUE), as Microsoft's own DockerShellTool does; a framework release
that moves it breaks the import with a message saying so.
Licensed under the Apache License 2.0. Source: plimsoll on GitHub (EXTERNAL · source repo ↗).
Metadata
Release files for agent-framework-plimsoll 0.28.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_framework_plimsoll-0.28.0.tar.gz | 11.4 kB | With provenance | Details for agent_framework_plimsoll-0.28.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_framework_plimsoll-0.28.0-py3-none-any.whl | Python 3 | none | any | Details for agent_framework_plimsoll-0.28.0-py3-none-any.whl |
Total release size: 23.0 kB
Release files / agent_framework_plimsoll-0.28.0.tar.gz
| Download URL | agent_framework_plimsoll-0.28.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a97f8376c6f35278fb07423293d05c128f387963a478364b5b1df439140e16c6
|
|
BLAKE2b-256 checksum How to use checksums |
85b8ec5f015dc4b08a26a82f871bbdca79adaab1742f3d3bb6fc90d919ee2e61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / agent_framework_plimsoll-0.28.0-py3-none-any.whl
| Download URL | agent_framework_plimsoll-0.28.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5efbe72b912f7c2ac073dd0b396261ff9ae131dd99034eb5fd311cc29b890679
|
|
BLAKE2b-256 checksum How to use checksums |
759cd3c5b667d22dbcf79e514375edad532ac0340cbbee12bc40987f268f1e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for agent-framework-plimsoll 0.28.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_framework_plimsoll-0.28.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA 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.