ghostspan
Built by MeshAI Labs, the Agent Control Plane for monitoring and governing AI agents.
ghostspan is a local, offline command-line scanner that finds silent failures in AI agent trace exports: OTel (OpenTelemetry) and Langfuse. It looks for the failure modes that never raise an exception and never show up as a 5xx: swallowed errors, empty completions, truncated responses, degraded tool-call success rates, retry loops, cost outliers, and latency outliers.
The guarantee
ghostspan runs entirely on your machine, on files you already have.
- 100% local. No data leaves this machine.
- Zero network calls. There is no HTTP client anywhere in this codebase.
- Zero telemetry. Nothing is phoned home, ever.
- No API keys required. There is nothing to configure and nothing to authenticate.
Detection always runs on tokens and structural facts, never on raw content, unless you explicitly opt in with --show-content (terminal only) or --content-in-file (markdown report). Redaction is on by default everywhere.
Install
pipx install ghostspan
pipx is recommended because a bare pip install fails on modern Debian/Ubuntu (PEP 668, externally managed environments). If you prefer plain pip, use a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install ghostspan
Usage
ghostspan traces.jsonl
ghostspan ./exports/ # recurses for *.json and *.jsonl
ghostspan traces.jsonl --format langfuse
ghostspan traces.jsonl --since 7d --fail-on high
ghostspan traces.jsonl --show-content --max-content-chars 120
By default ghostspan writes a markdown report to silent-failure-report.md (see examples/silent-failure-report.md for a sample) and prints a summary to the terminal.
Flags
| Flag | Description |
|---|---|
--format auto|otlp|langfuse |
Force the input format instead of auto-detecting it. |
--out PATH |
Markdown report path (default silent-failure-report.md). |
--no-file |
Do not write the markdown report. |
--json [PATH] |
Write structured, already-redacted JSON findings to PATH or stdout. |
--since / --until |
Time filter: 7d or ISO 8601. |
--show-content |
Show redacted content snippets in the terminal only. Off by default. |
--content-in-file |
Also allow redacted content snippets in the markdown report. Off by default. |
--redact PATTERN |
Extra regex to redact from content snippets. Repeatable. |
--max-content-chars N |
Max characters per content snippet (default 200). |
--min-samples N |
Override the minimum group size used by every statistical detector gate. |
--config ghostspan.toml |
Defaults for any option above. |
--price-map FILE |
JSON file overriding the bundled pricing table for dollar estimates. |
--fail-on high|medium|low |
Exit 1 if a finding at or above this tier exists. Off by default. |
--quiet |
Compact terminal summary only. |
--no-color |
Disable terminal colors. |
--version |
Print the version and exit. |
Exit codes
0: scan completed. Findings never fail the process unless--fail-onis set.1: only with--fail-on, when a finding at or above the given tier was found.2: usage error (bad flags, no input paths).3: input error, no parseable spans were found in any input.
What it detects
| ID | Detector | Tier |
|---|---|---|
| D1 | Errors not surfaced to the trace root, and abandoned tool calls | HIGH |
| D2 | Truncation and finish_reason anomalies | HIGH / MEDIUM |
| D3 | Empty completions and structured-error envelopes | HIGH |
| D4 | Degraded tool-call success rate | MEDIUM |
| D5 | Retry loops | MEDIUM |
| D6 | Cost anomalies (token-based; dollars are display-only) | MEDIUM / INFO |
| D7 | Latency anomalies | INFO |
Every rule and its exact threshold is printed in the report's methodology appendix. Detectors degrade gracefully: a missing attribute never becomes an assumed value, and a detector with too little data to run says so explicitly rather than silently skipping or guessing.
What it does not catch
ghostspan runs deterministic and statistical heuristics over trace structure, status codes, token counts, and finish reasons. It cannot catch natural-language refusals, semantically wrong answers, or hallucination and faithfulness failures. A clean report is not proof the agent behaved correctly, only that it did not trip these particular structural heuristics.
License
MIT. See LICENSE.
Built by MeshAI Labs.
Metadata
Release files for ghostspan 0.1.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 | |
|---|---|---|---|---|
| ghostspan-0.1.0.tar.gz | 45.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ghostspan-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.4 kB
Release files / ghostspan-0.1.0.tar.gz
| Download URL | ghostspan-0.1.0.tar.gz |
|---|---|
| Size | 45.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afee79899fc2225b2d2574a85b9b69507d5c38b979ada8f4b78101cc722783d7
|
|
BLAKE2b-256 checksum How to use checksums |
b4d31122a9e1155f0053aaee56fa2f5bfbd5fced6a614198eaf4cbdf18c6a0ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 19, 2026.
Transparency logRelease files / ghostspan-0.1.0-py3-none-any.whl
| Download URL | ghostspan-0.1.0-py3-none-any.whl |
|---|---|
| Size | 44.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de396082255400a84c1c37e8b3638d505d0c9d633e98c3ea2443303585c84874
|
|
BLAKE2b-256 checksum How to use checksums |
1e17a68a6391f9aa4241f8b3ee0c835408cf5edc4a2ac1efd02e4c34c861c13e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 19, 2026.
Transparency logSecurity for ghostspan 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ghostspan-0.1.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 Jul 19, 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.