NAIL — AI Agent Liability SDK. Real-time monitoring, circuit-breaking, and insurance certification for AI agents.
Project description
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:
- Register your agent — Dashboard → Agents → Add Agent. Note the agent name you choose.
- 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
Links
- Docs: neuravant.ai/sdk
- Portal: neuravant.ai/portal
- Support: api@neuravant.ai
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nail_sdk-1.0.0.tar.gz.
File metadata
- Download URL: nail_sdk-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d04799d59cb5ea96878d1bf9a6fdfc14221f9bcc9083202e8c0c7e1bd9cbb08
|
|
| MD5 |
2b0719c06a61996e4fdb224dfd92c8df
|
|
| BLAKE2b-256 |
dc63ee5fc6bfe7cd5060c5c5c43e7c0b6a91323d47fdef69c348034f5e2dfa0a
|
File details
Details for the file nail_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nail_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19648e7aff3015c290b777ac0f774d60983c285b45d89cfc0a6c1ab9f0935cae
|
|
| MD5 |
6f5131a5a3328e0146816ab901206f0b
|
|
| BLAKE2b-256 |
3f60f57139de458bd71166ca6e2e29342e928224ce7fffe3918da602cc09a9d1
|