Local, offline scanner that finds silent failures in OTel and Langfuse AI agent trace exports
Project description
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.
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 ghostspan-0.1.0.tar.gz.
File metadata
- Download URL: ghostspan-0.1.0.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afee79899fc2225b2d2574a85b9b69507d5c38b979ada8f4b78101cc722783d7
|
|
| MD5 |
0b06ccbe30121b78965e5d5e42ed7a24
|
|
| BLAKE2b-256 |
b4d31122a9e1155f0053aaee56fa2f5bfbd5fced6a614198eaf4cbdf18c6a0ef
|
Provenance
The following attestation bundles were made for ghostspan-0.1.0.tar.gz:
Publisher:
publish.yml on meshailabs-org/ghostspan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghostspan-0.1.0.tar.gz -
Subject digest:
afee79899fc2225b2d2574a85b9b69507d5c38b979ada8f4b78101cc722783d7 - Sigstore transparency entry: 2202855102
- Sigstore integration time:
-
Permalink:
meshailabs-org/ghostspan@5a8e25ab28d4914cef8ff35439ae37039b27403b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/meshailabs-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a8e25ab28d4914cef8ff35439ae37039b27403b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ghostspan-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ghostspan-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de396082255400a84c1c37e8b3638d505d0c9d633e98c3ea2443303585c84874
|
|
| MD5 |
bec2bd740f7127ca93c2e746661862f5
|
|
| BLAKE2b-256 |
1e17a68a6391f9aa4241f8b3ee0c835408cf5edc4a2ac1efd02e4c34c861c13e
|
Provenance
The following attestation bundles were made for ghostspan-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on meshailabs-org/ghostspan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghostspan-0.1.0-py3-none-any.whl -
Subject digest:
de396082255400a84c1c37e8b3638d505d0c9d633e98c3ea2443303585c84874 - Sigstore transparency entry: 2202855369
- Sigstore integration time:
-
Permalink:
meshailabs-org/ghostspan@5a8e25ab28d4914cef8ff35439ae37039b27403b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/meshailabs-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a8e25ab28d4914cef8ff35439ae37039b27403b -
Trigger Event:
release
-
Statement type: