Skip to main content

Agent failure monitoring SDK — trace capture with client-side PII scrubbing

Project description

Aiyara — Agent Failure Monitoring SDK

PyPI version Python versions License: MIT

Aiyara is agent failure monitoring with system-prompt-driven constraint extraction. Paste your system prompt at app.aiyara-universe.com, we extract structural constraints (tool ordering, argument rules, cross-turn dependencies) as a deterministic policy, and every trace is checked against that policy plus pre-built harness detectors (doom loops, retry amplification, context overflow, cascades). Violations surface as issues with evidence, not LLM-judge guesses.

This Python SDK captures traces from your agent in production and ships them to the Aiyara ingest service for evaluation. Capture is non-blocking, batched, and PII is scrubbed client-side before any bytes leave your process.

Quick start

pip install aiyara
import aiyara

aiyara.init(api_key="ak_...", auto_instrument=True)

That's it. With auto_instrument=True, the SDK patches the supported client libraries below and every agent run is captured and sent to Aiyara automatically.

Get an API key

  1. Visit app.aiyara-universe.com.
  2. Sign up (Supabase auth — no card required for the free tier).
  3. Paste your system prompt. The wizard extracts your policy rules and lets you review them.
  4. Issue an ak_* API key for your project. Use it in aiyara.init(api_key=...).

Auto-instrumentation

Supported frameworks (patched on aiyara.init(auto_instrument=True)):

  • openai — Chat Completions, Responses, tool calls
  • langgraph — graph nodes, tool calls, state transitions
  • openai_agents — Agents SDK runs

You can also drive capture manually:

# Single capture
aiyara.capture(
    messages=[{"role": "user", "content": "Hello"}],
    tool_calls=[{"name": "search", "arguments": {"q": "test"}, "result": "ok"}],
    model="gpt-4",
)

# Context-managed trace
with aiyara.trace(session_id="user-123") as t:
    t.record_message(role="user", content="Find flights")
    t.record_tool_call(name="search_flights", arguments={}, result={})

aiyara.shutdown()  # flush pending traces

PII scrubbing

PII scrubbing happens client-side, before transport. Raw user content never leaves your process unless explicitly opted in. The default scrubber redacts emails, phone numbers, and other common PII patterns; pass pii_field_paths=[...] to extend it.

aiyara.init(
    api_key="ak_...",
    scrub_pii=True,                          # on by default
    pii_field_paths=["messages[*].content"], # extend default scrubbing
)

What you get

  • Per-constraint verdicts. Aiyara tells you which rule fired, on which step, with the trace evidence — not a number from a judge.
  • Cascade detection. Root-cause violations are linked to their downstream failures via depends_on graphs.
  • Pre-built harness detectors. Doom loops, context overflow, retry amplification, error cascades — zero configuration required.
  • Deterministic monitoring. Pure-Python checks. Compile policy once, evaluate every trace, zero LLM calls on the hot path.

License

MIT — see LICENSE for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiyara-0.2.0.tar.gz (77.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiyara-0.2.0-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

Details for the file aiyara-0.2.0.tar.gz.

File metadata

  • Download URL: aiyara-0.2.0.tar.gz
  • Upload date:
  • Size: 77.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiyara-0.2.0.tar.gz
Algorithm Hash digest
SHA256 99a4cdb39b8aa9d4eef82e4757d561ffc71454d26f79efddbc109e97d7616e93
MD5 cda39deb4a9c92bc6eb60201de0a19dc
BLAKE2b-256 871c86ab9734c7d9b6e13b0e3f75c90b4adcbf035571b29f5d106a8fd8bd8103

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiyara-0.2.0.tar.gz:

Publisher: publish-sdk.yml on Aiyara-Universe/Testbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiyara-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aiyara-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiyara-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f03a886151703347e56cee3c73d2de4df1cec89352e179c42ba08a5750936003
MD5 ede4cd4c0f07bd65def64f1972ab8d92
BLAKE2b-256 58ab5fad6f2f473fb8aeea840171bb039166f6e73dcf61c382c340d5c29d66fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiyara-0.2.0-py3-none-any.whl:

Publisher: publish-sdk.yml on Aiyara-Universe/Testbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page