WeHarness tracing for Python
Send agent, model and tool spans to WeHarness using OpenTelemetry and OTLP/HTTP. Requires Python 3.10 or newer and a project ingest key from the WeHarness Tracing page.
import weharness_tracing as wh
# Set WEHARNESS_INGEST_KEY in your server environment, never in browser code.
wh.init(service="my-agent")
with wh.agent_run("support"):
with wh.tool_call("lookup_order"):
pass # Call your tool here.
wh.shutdown()
The default endpoint is https://api.weharness.io/otlp/v1/traces.
Override it with WEHARNESS_OTLP_ENDPOINT if needed. Set WEHARNESS_REVISION
to correlate traces with a source revision.
Known prompt, output, tool-payload and stacktrace attributes are filtered by default. This filter is not a general secret detector: do not put secrets or personal data in span names, error messages or custom metadata. Content capture requires explicit configuration and appropriate project settings. An ingest key sends traces; it does not authorize reading them.
An existing OpenTelemetry tracer provider is reused. Background batches are bounded;
call shutdown() to flush pending spans before the process exits.
Local evaluation runner (0.1.3)
The Python package includes weharness-run. Save the cases returned by the
WeHarness MCP evaluate_local_start operation as cases.json, then run:
weharness-run --cases cases.json --command "python agent.py" --timeout 300 --out report.json
The command runs your agent locally, sends each case on stdin (or substitutes
{input} as an argument), and records output, exit code and duration for each
repetition. Give the report to evaluate_local_report through your coding host.
The runner itself uploads nothing. Its exit code indicates report generation,
not that the agent passed the behavior checks; inspect the evaluation verdict.
Your agent's provider credentials remain available. WeHarness credentials named
WEHARNESS_TOKEN, WEHARNESS_INGEST_KEY, WEHARNESS_API_KEY,
WEHARNESS_MCP_TOKEN, and variables starting with WEHARNESS_SECRET are removed
from the child environment. This is a local process runner, not a security sandbox;
run only code you trust. On POSIX, timed-out attempts receive a process-group
termination; Windows currently terminates the direct process only.
Metadata
Release files for weharness-tracing 0.1.3
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 |
|---|---|---|---|---|
| weharness_tracing-0.1.3.tar.gz | 11.9 kB | With provenance | Details for weharness_tracing-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| weharness_tracing-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for weharness_tracing-0.1.3-py3-none-any.whl |
Total release size: 24.5 kB
Release files / weharness_tracing-0.1.3.tar.gz
| Download URL | weharness_tracing-0.1.3.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b910d246d85246046c0a72391de7fd1336515b39fc47723b47a7a8e7d4692da4
|
|
BLAKE2b-256 checksum How to use checksums |
ed87ccaf9a51f98be215d918dbe29b04073f69b086034ab1356b7df34f387715
|
| 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 1, 2026.
Transparency logRelease files / weharness_tracing-0.1.3-py3-none-any.whl
| Download URL | weharness_tracing-0.1.3-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63faad7cf54521ed5f57c6cd18042e6363a1753d37b9e65f714f92a75b272a2a
|
|
BLAKE2b-256 checksum How to use checksums |
d3a519f06673cbd9d6b2e86cd6447e6011b96a6319099ececbbecd322efca0ca
|
| 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 1, 2026.
Transparency logSecurity for weharness-tracing 0.1.3
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 weharness_tracing-0.1.3.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 1, 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.