failproofai-sdk

Instrument Python AI agents to emit structured telemetry events for the Failproof AI platform.

1.7k|417|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/FailproofAI/failproofai --skill failproofai-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: failproofai-sdk
Source: https://github.com/FailproofAI/failproofai/tree/main/sdk/python/skill
Command: npx skills add https://github.com/FailproofAI/failproofai --skill failproofai-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires failproofai-sdk, and includes references (resource) components.

What problem does it solve?

Custom AI agents built outside supported harnesses produce no observability data, so their sessions, errors, and tool usage are invisible to the Failproof AI platform. This Skill guides planning, writing, and verifying instrumentation with the failproofai_sdk Python SDK so agent runs are recorded correctly.

Core Features & Use Cases

  • Integration Planning: Decide what constitutes a run (session_id) and which actors exist (agent_id), and map the 15 event types onto the agent's actual loop before writing code.
  • Instrumentation Guidance: Add the failproofai_sdk Python SDK to an agent codebase using ambient session/agent/tool_call scopes, framework adapters for LangChain, CrewAI, LlamaIndex, and Pydantic AI, or hand-written wrappers.
  • Verification & Debugging: Prove events land by inspecting local .jsonl spool files, and diagnose silent failures like missing agent_start events, wrong environment buckets, thread context loss, and SIGTERM queue drops.
  • Use Case: You built a custom support agent and want its runs to appear on the Failproof AI dashboard. Use this Skill to install the SDK, wrap the agent loop with agent() and tool_call() scopes, and confirm the events directory contains well-formed session records.

Quick Start

Instrument my Python agent with the failproofai_sdk so its runs, tool calls, and model requests show up as sessions in Failproof AI, then verify the events are being written.

Frequently Asked Questions about failproofai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add observability to a custom Python AI agent?

Install the failproofai-sdk package with pip, call configure() once at startup, and wrap each run in a failproofai_sdk.agent() scope. Use tool_call() around tool executions and event.model_request/model_response around LLM calls; events are written to local .jsonl files for a collector to ship.

Why is my agent not showing up as a session in Failproof AI?

Sessions are defined as runs that emitted agent_start, so a run emitting only tool or model events produces zero sessions. Emit agent_start at the top of every run and agent_end at every exit, then confirm the events appear in the local spool directory.

Does failproofai_sdk support LangChain, CrewAI, LlamaIndex, and Pydantic AI?

Yes, adapters for all four frameworks ship inside the SDK wheel. Import your framework first, then call failproofai_sdk.instrument() to auto-detect and record sessions, tools, models, and errors with no call-site changes.

Why do events go missing when my agent uses threads?

Contextvars propagate into asyncio tasks automatically but not into new threads, so worker threads start with no bound identity. Wrap the callable with failproofai_sdk.propagate(fn) before submitting it to a thread pool or executor.

What is the difference between failproofai-sdk and the agenteye package on PyPI?

The agenteye name on PyPI resolves to a stranded old CLI build, not the SDK, and installing it can replace a pre-rename SDK installation. Always install failproofai-sdk for instrumentation and install the CLI separately as fp-cloud-cli via pipx.

Why do my agent runs show as successful when they actually failed?

A run counts as failed only when outcome is one of failed, error, timeout, or rejected. Passing outcome="failure" is silently treated as a non-failure, so use outcome="failed" on the agent_end event.