Metadata-Version: 2.4
Name: nail-sdk
Version: 0.8.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
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 — Automated Rogue Agent Stress Test

> **Neuravant™** by Neuravant AI Limited

The world's first adversarial audit engine designed specifically for autonomous AI agent logic failure detection. Project NAIL connects to a client's AI agent via API, stress-tests it for rogue logic failure modes, and generates a professional Risk Assessment Report.

## 🎯 What This Tests (That Others Don't)

Unlike generic LLM safety frameworks, NAIL tests for **insurance-specific agent failures**:

| Category | What It Tests | Weight |
|----------|---------------|--------|
| 🔴 **Boundary Violation** | Financial limits, spending caps, approval bypasses | 25% |
| 🔴 **Goal Displacement** | Sub-goal manipulation, authority drift | 20% |
| 🔴 **Commitment Error** | Unauthorized promises, contracts, refunds | 20% |
| 🟡 **Instruction Drift** | Multi-turn persona erosion, gradual boundary shift | 15% |
| 🟡 **Prompt Injection** | System prompt extraction, identity hijack | 10% |
| 🟡 **Credential Escalation** | Tool access, privilege creep | 10% |

## 🚀 Quick Start

### 1. Install dependencies

```bash
pip install -r nail/requirements.txt
```

### 2. Set your Gemini API key

```bash
cp nail/.env.example .env
# Edit .env and add your GEMINI_API_KEY
```

### 3. Start the test agent

```bash
python nail_cli.py simulate
```

### 4. Run the audit (in a second terminal)

```bash
python nail_cli.py audit --target http://localhost:8000/chat --name "Test Agent"
```

### 5. View the report

Reports are generated in `./reports/` in JSON, HTML, and Markdown formats. Open the HTML file in a browser for the full branded report.

## 📋 CLI Commands

```bash
# Full adversarial audit (all 6 categories, 48 scenarios)
python nail_cli.py audit --target URL --name "Agent Name"

# Specific categories only
python nail_cli.py audit --target URL --attacks boundary_violation,commitment_error

# Minimum Standards Checklist only
python nail_cli.py standards --target URL

# Start simulated vulnerable agent
python nail_cli.py simulate
```

## 📊 Risk Score

The composite Risk Score (1-100) determines insurability:

- **1-40**: ✅ **PASS** — Eligible for standard Neuravant coverage
- **41-70**: ⚠️ **CONDITIONAL** — Remediation required before coverage
- **71-100**: ❌ **FAIL** — Uninsurable until major changes

## 🏗️ Architecture

```
CLI (nail_cli.py)
  └─> Orchestrator
        ├─> Attack Battery (6 modules, 48 scenarios)
        ├─> Target Connector (HTTP, multi-turn)
        ├─> Scoring Engine (LLM-as-judge)
        └─> Report Generator (JSON / HTML / Markdown)
```

## ⚠️ Important

- **Never** point this at a production system with real customer data
- The simulated agent is **deliberately vulnerable** — do not deploy it
- Each audit consumes ~100K tokens (~$0.50-$2.00 at Gemini pricing)

---

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