Ghostlab
A headless runner for coding agents, and a Python SDK for composing them into checkpointed, resumable jobs.
Define an agent once — harness, model, instructions, skills, MCP servers, workspace — and run it in Claude Code, Codex, GitHub Copilot CLI, or OpenCode, on your machine or inside an NVIDIA OpenShell sandbox. Then chain agent calls into pipelines for evaluations, labeling, testing, or any batch job: every item and every agent call is checkpointed, so an interrupted run picks up where it stopped.
Ghostlab is infrastructure. It has no opinion about what your job does — an MCP evaluation is just one example pipeline.
pip install ghostlab
Run an agent
# agent.yaml
name: reviewer
harness: claude # claude | codex | copilot | opencode | command
model: sonnet
instructions: Be concise.
skills: [skills/review]
mcps:
docs: {command: node, args: [docs-mcp.js]}
workspace: repo # the agent works on a private copy
sandbox: {backend: openshell, providers: [anthropic]}
ghostlab exec --agent agent.yaml "Review src/app.py" --collect REVIEW.md
from ghostlab import Agent
agent = Agent.load("agent.yaml")
result = agent.run("Review src/app.py and reply with JSON")
result.status, result.answer, result.tool_calls, result.json()
with agent.session() as chat: # multi-turn: the harness session resumes
chat.send("Find the bug")
chat.send("Now fix it")
Compose a pipeline
from ghostlab import Agent, Pipeline, stage
@stage # one output per item
def describe(ctx, target):
explorer = ctx.agent("assistant").with_mcp(target["id"], target["mcp"])
return {**target, "capabilities": ctx.run(explorer, "What can this MCP do? JSON.").json()}
@stage(fan_out=True) # a list: each element becomes an item
def scenarios(ctx, target):
return ctx.run(ctx.agent("planner"), f"Write test goals for {target}. JSON list.").json()
@stage(concurrency=4, retries=1) # parallel, retried on failure
def evaluate(ctx, scenario):
...
@stage(gather=True) # every surviving item at once
def report(ctx, results):
...
pipeline = Pipeline("mcp-eval", [describe, scenarios, evaluate, report],
params={"assistant": Agent.load("agents/assistant.yaml"),
"planner": Agent.load("agents/planner.yaml")})
ghostlab run pipeline.py --input targets.jsonl # run
ghostlab run pipeline.py # resume
ghostlab run pipeline.py --param assistant=agents/codex.yaml # swap an agent
ghostlab status runs/mcp-eval
- Checkpointed: each item's outcome is saved as it finishes. So is each agent call inside an item, so an item that failed halfway reuses the calls that completed.
- Resumable: re-running skips done items and retries failed ones. A changed
input, parameter, or stage
versionrecomputes only what it affects. - Classified failures:
timed_out,model_unavailable,sandbox_error,harness_error, andagent_errorare kept apart, so "the agent got it wrong" never looks like "the infrastructure broke".
Examples
| Example | What it shows |
|---|---|
examples/mcp-eval |
describe an MCP → generate scenarios → emulated-user conversations judged by an agent → report |
examples/batch-label |
label a dataset with eight agents in parallel, validating every answer |
examples/release-notes |
one configured agent with instructions, a skill, and a workspace |
examples/agents |
a starting config for each harness |
Documentation
https://sajjadgg.github.io/Ghostlab/ — getting started, agents, pipelines, CLI.
License
MIT
Metadata
Release files for ghostlab 0.5.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 |
|---|---|---|---|---|
| ghostlab-0.5.0.tar.gz | 56.2 kB | With provenance | Details for ghostlab-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ghostlab-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for ghostlab-0.5.0-py3-none-any.whl |
Total release size: 91.5 kB
Release files / ghostlab-0.5.0.tar.gz
| Download URL | ghostlab-0.5.0.tar.gz |
|---|---|
| Size | 56.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d2ec5f79e3b33fc98c86777999092e71759baacd659a520597d849362da985f
|
|
BLAKE2b-256 checksum How to use checksums |
3d80336f4bd4c432d02b2028487ab2d37139cbdb1471fda4b43a7ca2d224e076
|
| 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 7, 2026.
Transparency logRelease files / ghostlab-0.5.0-py3-none-any.whl
| Download URL | ghostlab-0.5.0-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66a5660e07c558f0da4c18374ea8557f429efcd902ac6168a1f158d2f480d024
|
|
BLAKE2b-256 checksum How to use checksums |
71611da1d7ee1ed8bcb64ef9a50f53b155379c7936e45cc2aad430e1f2336705
|
| 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 7, 2026.
Transparency logSecurity for ghostlab 0.5.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 ghostlab-0.5.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 7, 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.