Skip to main content

minimal-agent-harness

This project keeps an agent harness small so you can learn its core components by reading and running it. A harness is the code that connects a model to tools and manages the loop between them.

How it works

  1. The harness sends your prompt and a shell tool definition to the model through the OpenAI Responses API.
  2. If the model requests a shell command, the harness runs it and sends back its output and exit code. This repeats until the model finishes or the task deadline expires.
  3. On success, the harness prints a JSON summary and the total tokens reported by the API. Each invocation takes one prompt.

Run a task

You’ll need macOS or Linux, uv, Python 3.11 or newer, and an OpenAI API key with access to a model that supports tool calling.

Once the package is on PyPI, install it with uv tool install minimal-agent-harness. If you cloned the repo, run the same example from the repo root with uv run --locked agent-harness in place of agent-harness.

Replace the API key placeholder and change --model if you’re using a different model.

export OPENAI_API_KEY='your-api-key-here'

task_dir=$(mktemp -d)
agent-harness --model gpt-6.2-sol --directory "$task_dir" \
  'Write HELLO to output.txt, then reopen it to verify the contents.'
cat "$task_dir/output.txt"

The last command should print HELLO. The example uses a temporary directory. --directory sets where shell commands start, and those commands run with your user account’s permissions.

Add --verbose to see shell commands and their results as the task runs. Use agent-harness --help to see all options.

Run the smoke tests

From the repo root, run the tool loop and timeout tests. They need no API key.

uv run --locked python -m unittest discover -s tests -v

For development details, see the iteration 1 spec. Set OPENAI_BASE_URL if you’re using a compatible Responses endpoint.

Metadata

Release files for minimal-agent-harness 0.1.0

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

Source distribution (sdist)

Source distribution for minimal-agent-harness 0.1.0
File Size Uploaded Provenance Actions
minimal_agent_harness-0.1.0.tar.gz 6.2 kB Without provenance Details for minimal_agent_harness-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minimal-agent-harness 0.1.0
File Interpreter ABI Platform Actions
minimal_agent_harness-0.1.0-py3-none-any.whl Python 3 none any Details for minimal_agent_harness-0.1.0-py3-none-any.whl

Total release size: 12.2 kB

Release files / minimal_agent_harness-0.1.0.tar.gz

Download URL minimal_agent_harness-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cd359f5b8a565d7be77db3d3d57bfdf6ce5c7b6525345fef34bdc978ad2849fc
BLAKE2b-256 checksum
How to use checksums
97e3634c6c5e7a018951205a9e3dbb5479b45ed891f8e644ee7e36d1a71f7f6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / minimal_agent_harness-0.1.0-py3-none-any.whl

Download URL minimal_agent_harness-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd230ad8aa3b4123242d6da7639b3ad79d4021840eddb0773ad2214bd5be98ed
BLAKE2b-256 checksum
How to use checksums
b303382d5022a192cb263b5442695708e57e470a8b866e0cf16700d1a68ef382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for minimal-agent-harness 0.1.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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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