Skip to main content

Ciphyrs — observability for AI agents

PyPI Python License: MIT

See every agent, tool call and model call your application makes, as one connected graph. Built on OpenTelemetry, so the spans are standard OTLP and sit beside whatever tracing you already have — and your model calls stay yours, made directly against your provider.

Install

pip install ciphyrs

One command. OpenTelemetry and httpx come with it. Python 3.9 through 3.14, including the free-threaded 3.14 build (PEP 703).

No framework-specific install, and none exists. @agent and @tool wrap plain functions, so they work with any agent framework, or none.

Monitor your agents

import ciphyrs

ciphyrs.init(api_key="cyp_live_...", project="customer-support")

@ciphyrs.tool
def issue_refund(order: str, amount: float) -> dict:
    return payments.refund(order, amount)   # traced, and checked against policy

@ciphyrs.agent("BillingAgent", role="worker")
def billing(question: str) -> str:
    answer = my_model.generate(question)      # your model call, unchanged
    issue_refund(order="A-1041", amount=12.0)
    return answer

@ciphyrs.agent("RouterAgent", role="router")
def router(message: str) -> str:
    return billing(message)      # called INSIDE router -> a RouterAgent→BillingAgent edge

with ciphyrs.session("conv-7f3a"):            # ties one conversation together
    router("I was charged twice for order A-1041")

ciphyrs.shutdown()                            # flush; short-lived scripts only

That is the whole integration. Nesting is the topology: because billing was called inside router, the dashboard draws the edge. Both agents appear in the fleet at start-up — decorators register themselves, before any traffic.

init() Configures an OTLP exporter to Ciphyrs, or attaches to a TracerProvider you already have and leaves your exporters alone. Falls back to CIPHYRS_API_KEY, CIPHYRS_PROJECT, CIPHYRS_BASE_URL.
@agent One span per call, named for the agent. Everything it calls nests underneath.
@tool One span per tool call, with arguments and result. Also checked against policy before it runs — enforce inherits init(enforce=True), so a block verdict raises ToolBlocked and the function never executes. Pass enforce=False to trace only.
session() Tags every span inside with session.id.
init(agents=...) Declares the roster and the designed peer graph at boot, so the fleet is complete before the first request. Starts a heartbeat (default 60 s) so idle and dead are distinguishable.

Async is automatic — declare the function async def and the decorators install async wrappers. Every platform call they make runs off your event loop.

See the inputs and outputs

On by default. Pass capture_io=False to an individual @agent or @tool whose arguments must not be recorded; its spans still carry timing, nesting and errors.

Agents in separate processes

Already on. Outgoing HTTP requests carry the trace context, so an agent that calls another service shows up as one connected graph rather than two disconnected fleets. init(propagate=False) turns it off.

Model and framework internals

Ciphyrs is not in the path of your model call and does not want to be. For spans inside a framework or provider — retriever calls, per-node detail — add that framework's own OpenTelemetry instrumentation (OpenInference or OpenLLMetry). Its spans travel through the exporter init() already installed and nest inside your agent spans.

Is it actually on?

state = ciphyrs.selfcheck()
if state["problems"]:
    log.error("Ciphyrs is not live in this process: %s", state["problems"])

Reports what is genuinely running and names each problem in words. Makes no network call, so it is safe in a readiness probe.

Beyond tracing

The platform also enforces policy on agent messages, masks PII, and can quarantine a misbehaving agent from the dashboard. Tool checks, message checks and PII masking are all on by default once init() has an API key, which means text leaves your process to be evaluated. The documentation says what each one sends and how to turn it off (enforce=, guard_input=, guard_output=, pii=).

Every one of them fails closed by default (since 6.0): if Ciphyrs cannot give an answer, the input is refused (InputBlocked), the reply is refused (OutputBlocked), the tool does not run (ToolBlocked) and text that could not be masked does not reach the model (PIIProtectionError). An enforced @tool with no API key is refused too. Each stage can be opened per application -- guard_fail_closed={"input": False}, pii_fail_closed=False, @tool(fail_closed=False), @protect_tool(..., fail_closed=False) -- and is logged once when it is. An opened stage proceeds only during a genuine outage (no connection, a 5xx without a verdict). A gateway refusal (a fail_closed: true body, at any status) is a block under both postures, and a timeout, a 429 or any other 4xx is refused as well.

Log forwarding is off by default (since 6.0). init(capture_logging=True) sends every record your application logs at log_level or above (INFO by default, through Python's logging, from any logger) to Ciphyrs, shown on the trace. Credentials are redacted locally before a line leaves the process; the SDK does not run log lines through the masking service, and the Ciphyrs gateway masks forwarded lines on ingest before they are stored.

Spans carry enduser.id as sha256:<hex> of the id you pass to ciphyrs.session(..., end_user=) (raw only with pii_capture_raw=True). The PII vault session id is written only on the spans exported to Ciphyrs, not on the span your own exporters see: within its workspace it works like a bearer reference to the turn's real values. init(export_session_id=True) writes it on the span itself.

Governed tools present a verified agent identity: a short-lived token is minted for the agent's name on its first governed call and refreshed before it expires. No fleet declaration is needed. If the gateway refuses the token, the log says why and how to fix it, and the project's identity mode decides whether the tool runs. If the gateway cannot be reached, the tool is refused unless it was opened with fail_closed=False.

@agent closes each turn's PII vault session when the turn ends. For a session nothing else will close (one you masked into with CiphyrsClient, or a turn run without @agent), call ciphyrs.close_session(session_id), or await ciphyrs.aclose_session(...) from async code. Closing twice is safe, and the call never raises. It returns a SessionCloseResult, truthy only when the gateway confirmed the close; retained_hours is set when your workspace keeps a review copy. CiphyrsClient.protect() closes its session on every path unless you pass purge=False, and reports session_closed.

Third-party names are trademarks of their respective owners; no affiliation or endorsement is implied.

Metadata

Release files for ciphyrs 6.0.1

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

Source distribution (sdist)

Source distribution for ciphyrs 6.0.1
File Size Uploaded Provenance Actions
ciphyrs-6.0.1.tar.gz 419.8 kB Without provenance Details for ciphyrs-6.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ciphyrs 6.0.1
File Interpreter ABI Platform Actions
ciphyrs-6.0.1-py3-none-any.whl Python 3 none any Details for ciphyrs-6.0.1-py3-none-any.whl

Total release size: 693.6 kB

Release files / ciphyrs-6.0.1.tar.gz

Download URL ciphyrs-6.0.1.tar.gz
Size 419.8 kB
Tags Source
SHA-256 checksum
How to use checksums
edb31b379aae3cf7f121257168d685bad36f1394dcd980298412c54602d73cf4
BLAKE2b-256 checksum
How to use checksums
3f54dc2b9097a76998f59708d03264d8dbb973a7fab6417fe9cc389a31e58f56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ciphyrs-6.0.1-py3-none-any.whl

Download URL ciphyrs-6.0.1-py3-none-any.whl
Size 273.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dafffadfaee772e95d683e5729d11dce844383dcf7c8376f2985413ce3091077
BLAKE2b-256 checksum
How to use checksums
dcaa8c0d48a731d45cd5b97cd50ba6816eef53e6777a837e5b44958ae2083e1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for ciphyrs 6.0.1

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

6.0.1 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