Metadata-Version: 2.4
Name: nail-sdk
Version: 0.7.1
Summary: NAIL SDK — Continuous monitoring for AI agents. Detects pathologies, tracks compliance, generates telemetry.
Author-email: Neuravant AI Limited <team@neuravant.ai>
License: Proprietary — Neuravant AI Limited
Project-URL: Homepage, https://neuravant.ai
Project-URL: Documentation, https://nail-saas-327026071945.europe-west2.run.app/sdk.html
Project-URL: Repository, https://github.com/dleighsystem/NAIL
Project-URL: Issues, https://github.com/dleighsystem/NAIL/issues
Keywords: ai,agents,monitoring,safety,insurance,llm,opentelemetry
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.31.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.0; extra == "langchain"
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.25.0; extra == "otel"
Requires-Dist: opentelemetry-sdk>=1.25.0; extra == "otel"
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25.0; extra == "otel"
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25.0; extra == "otel"
Requires-Dist: opentelemetry-semantic-conventions>=0.46b0; extra == "otel"
Provides-Extra: pubsub
Requires-Dist: google-cloud-pubsub>=2.21.0; extra == "pubsub"
Provides-Extra: scan-server
Requires-Dist: fastapi>=0.110; extra == "scan-server"
Requires-Dist: uvicorn[standard]>=0.27; extra == "scan-server"
Provides-Extra: all
Requires-Dist: nail-sdk[langchain,otel,pubsub,scan-server]; extra == "all"

# Project NAIL — AI Agent Safety, Enforcement & Insurance Platform

> **Neuravant™** by Neuravant AI Limited

The world's first rogue agent liability platform. NAIL certifies AI agents before deployment, enforces policy at runtime, monitors for decay continuously, and provides the evidence trail that makes insurance claims possible.

## Platform Overview

| Layer | Product | When it acts |
|-------|---------|-------------|
| **Certify** | NAIL Diagnostic | Pre-deployment — 7-dimension audit, AAA→D safety rating |
| **Enforce** | NAIL Enforce | Runtime — policy gate (<25ms), hash-chained action log |
| **Monitor** | NAIL Telemetry + Scheduler | Continuous — decay detection, 60-Day Cliff alerts |
| **Insure** | Rogue Agent Liability | At loss — parametric triggers, cryptographic evidence |
| **Arsenal** | Capability Provisioner | Pre-session — zero-trust ed25519-signed tool tokens |
| **Canary** | Honeypot Detection | Continuous — bait agents that surface adversarial probing |

## What This Tests

NAIL runs **96 adversarial scenarios** across **7 dimensions**:

| Dimension | What It Covers | Composite |
|-----------|---------------|-----------|
| **Identity** | Social drift, sycophancy, authority impersonation | SSR |
| **Hardening** | Prompt injection, jailbreaking, indirect injection | AHR |
| **Endurance** | Context decay, constraint amnesia, multi-turn erosion | CRR |
| **Operations** | Financial limits, HITL bypass, tool hallucination | OSR |
| **Ethics** | Pressure language, refusal instability, emotional manipulation | ECR |
| **Temporal** | Model update decay, knowledge rot, tool schema drift | TSR |
| **Logic** | Recursive self-poisoning, false completions, safety misfires | SLR |

## Quick Start

### 1. Install

```bash
pip install nail-sdk                    # Core SDK (circuit breaker + telemetry)
pip install nail-sdk[langchain]         # + LangChain callbacks
pip install nail-sdk[all]               # Everything
```

### 2. Instrument your agent (1 line)

```python
# OpenAI
from nail.sdk.openai_plugin import nail_wrap_openai
client, nail = nail_wrap_openai(openai.OpenAI(), api_key="nail_sk_...")

# Anthropic
from nail.sdk.anthropic_plugin import nail_wrap_anthropic
client, nail = nail_wrap_anthropic(anthropic.Anthropic(), api_key="nail_sk_...")

# LangChain
from nail.sdk.langchain_plugin import NAILGuardMiddleware
chain.invoke({"input": "..."}, config={"callbacks": [NAILGuardMiddleware(api_key="nail_sk_...")]})

# CrewAI
from nail.sdk.crewai_plugin import nail_wrap_crew
crew, nail = nail_wrap_crew(my_crew, api_key="nail_sk_...")
```

### 3. Run a full diagnostic

```bash
python nail_server.py                    # Start the platform on port 8500
# Then visit http://localhost:8500 to certify your agent via the web UI
```

### 4. CLI audit (direct)

```bash
nail-runtime-sensor --target https://your-agent-api/chat --name "MyAgent"
nail-remote-evidence --agent-id <id> --export-chain
```

## Risk Score & Rating

| Score | Rating | Insurability |
|-------|--------|-------------|
| 0–20 | AAA–AA | Standard coverage, reduced premium |
| 21–40 | A–BBB | Standard coverage |
| 41–60 | BB–B | Conditional — remediation plan required |
| 61–100 | C–D | Uninsurable until major changes |

## Architecture

```
nail/
  flywheel.py          — 96-scenario adversarial red team
  enforce.py           — Runtime policy gate (ALLOW / HOLD / BLOCK)
  topology.py          — Multi-agent blast radius mapping
  cross_agent_attacks.py — 6 cross-agent attack families
  privacy_meter.py     — Differential privacy assessment
  compliance.py        — ISO 42001 + EU AI Act reports
  registry.py          — Certificate & insurance ledger
  policy_engine.py     — Parametric insurance trigger engine
  diagnostics/         — 7-dimension test engine (t01–t46+)
  continuous/          — Rating-based re-audit scheduler
  monitoring/          — Compound pathology detection
  sdk/                 — Framework plugins + IDE interceptors
  saas/                — FastAPI SaaS platform (auth, quotes, policies)
  arsenal/             — Zero-trust capability provisioner
  canary/              — Honeypot agent fleet + TrapWire
```

## Important

- Never point the diagnostic at a production system with real customer data
- The simulated agent (`sim_agent.py`) is deliberately vulnerable — do not deploy it
- Each full diagnostic audit consumes ~150K–300K tokens depending on model and scenario count

---

*© Neuravant AI Limited 2025. Confidential and proprietary.*
