Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

nail-sdk

NAIL — AI Agent Liability SDK

Real-time monitoring, circuit-breaking, and insurance certification for AI agents. Drop-in integration with OpenAI, Anthropic, LangChain, CrewAI, and AutoGen.

Before You Start

You need two things from the NAIL Portal:

  1. Register your agent — Dashboard → Agents → Add Agent. Note the agent name you choose.
  2. Generate an API key — Dashboard → SDK & API Keys → Generate Key. Select the scopes you need (at minimum agent:read).

Store your key as an environment variable — never hard-code it:

export NAIL_API_KEY="nail_sk_YOUR_KEY_HERE"

Add that line to your .env file or deployment secrets (Render, Railway, Cloud Run, etc.).


Install

pip install nail-sdk                    # Core SDK
pip install nail-sdk[openai]            # + OpenAI wrapper
pip install nail-sdk[anthropic]         # + Anthropic wrapper
pip install nail-sdk[langchain]         # + LangChain callbacks
pip install nail-sdk[all]               # Everything

Quick Start

OpenAI

import os
from nail.sdk.openai_plugin import nail_wrap_openai
import openai

client = openai.OpenAI()
client, nail = nail_wrap_openai(
    client,
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-openai-agent",       # matches the name in your NAIL Portal
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}]
)
print(nail.session_summary)

Anthropic

import os
from nail.sdk.anthropic_plugin import nail_wrap_anthropic
import anthropic

client = anthropic.Anthropic()
client, nail = nail_wrap_anthropic(
    client,
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-anthropic-agent",    # matches the name in your NAIL Portal
)

response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)

LangChain

import os
from nail.sdk.langchain_plugin import NAILGuardMiddleware

middleware = NAILGuardMiddleware(
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-langchain-agent",    # matches the name in your NAIL Portal
)
chain.invoke({"input": "..."}, config={"callbacks": [middleware]})

CrewAI

import os
from nail.sdk.crewai_plugin import nail_wrap_crew

crew, nail = nail_wrap_crew(
    my_crew,
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-crew-agent",         # matches the name in your NAIL Portal
)
result = crew.kickoff()

Any Python Agent (decorator)

import os
from nail.sdk import Neuravant

nail = Neuravant(
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-agent",              # matches the name in your NAIL Portal
)

@nail.monitor
async def handle_query(user_input: str) -> str:
    return await my_llm_call(user_input)

AutoGen

import os
from nail.sdk.autogen_plugin import NAILAutoGenMonitor

monitor = NAILAutoGenMonitor(
    api_key=os.getenv("NAIL_API_KEY"),
    agent_name="my-autogen-agent",      # matches the name in your NAIL Portal
)
for agent in [agent1, agent2]:
    monitor.register(agent)

No-Code / Non-Technical Setup (Proxy Mode)

If you use a no-code tool (Voiceflow, Make, Zapier, n8n, Dify, Flowise, etc.) and cannot modify Python code, use NAIL Proxy instead.

Step 1 — Get your proxy-enabled key

In the Portal → SDK & API Keys → Generate Key, tick the proxy:use scope.

Step 2 — Point your tool at the NAIL proxy

Instead of your LLM provider's base URL, use:

Provider Original URL NAIL Proxy URL
OpenAI https://api.openai.com https://neuravant.ai/proxy/openai/v1
Anthropic https://api.anthropic.com https://neuravant.ai/proxy/anthropic/v1
Mistral https://api.mistral.ai https://neuravant.ai/proxy/mistral/v1
Cohere https://api.cohere.ai https://neuravant.ai/proxy/cohere/v1

Step 3 — Add your NAIL key as a custom header

In your no-code tool's HTTP settings, add one custom request header:

X-NAIL-API-Key: nail_sk_YOUR_KEY_HERE

Your existing provider API key stays in the Authorization: Bearer <provider-key> header as normal. No other changes needed.

Test with curl:

curl https://neuravant.ai/proxy/openai/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "X-NAIL-API-Key: nail_sk_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"ping"}]}'

All LLM traffic is transparently forwarded. NAIL monitoring (latency, tokens, pathology detection) runs in the background. No code changes required.


What You Get

  • Circuit Breaker — auto-kills runaway agents on latency, cost, or error spikes
  • Telemetry — latency, token usage, cost tracking with PII scrubbing
  • Pathology Detection — sycophantic decay, consensus paralysis, shadow delegation
  • Live Badge — embeddable SVG showing real-time NAIL safety rating
  • Compliance — GDPR, SOC 2, EU AI Act scanning built in

Metadata

Release files for nail-sdk 1.0.0

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

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for nail-sdk 1.0.0
File Size Uploaded Provenance Actions
nail_sdk-1.0.0.tar.gz 3.6 kB Without provenance Details for nail_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nail-sdk 1.0.0
File Interpreter ABI Platform Actions
nail_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for nail_sdk-1.0.0-py3-none-any.whl

Total release size: 7.0 kB

Release files / nail_sdk-1.0.0.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL nail_sdk-1.0.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6d04799d59cb5ea96878d1bf9a6fdfc14221f9bcc9083202e8c0c7e1bd9cbb08
BLAKE2b-256 checksum
How to use checksums
dc63ee5fc6bfe7cd5060c5c5c43e7c0b6a91323d47fdef69c348034f5e2dfa0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / nail_sdk-1.0.0-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL nail_sdk-1.0.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19648e7aff3015c290b777ac0f774d60983c285b45d89cfc0a6c1ab9f0935cae
BLAKE2b-256 checksum
How to use checksums
3f60f57139de458bd71166ca6e2e29342e928224ce7fffe3918da602cc09a9d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for nail-sdk 1.0.0

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.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.8.1 2 files With provenance
  • Added 1.0.0 2 files Without provenance

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.

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