Metadata-Version: 2.4
Name: inalign-mcp
Version: 0.2.2
Summary: In-A-Lign Agent Provenance & Security MCP Server
Project-URL: Homepage, https://in-a-lign.com
Project-URL: Documentation, https://docs.in-a-lign.com
Project-URL: Repository, https://github.com/in-a-lign/mcp-server
Author-email: In-A-Lign <hello@in-a-lign.com>
License-Expression: MIT
Keywords: agent,ai,claude,cursor,graphrag,mcp,provenance,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: api
Requires-Dist: fastapi>=0.109.0; extra == 'api'
Requires-Dist: uvicorn[standard]>=0.27.0; extra == 'api'
Provides-Extra: dev
Requires-Dist: black>=24.1.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.14; extra == 'dev'
Provides-Extra: full
Requires-Dist: fastapi>=0.109.0; extra == 'full'
Requires-Dist: neo4j>=5.0.0; extra == 'full'
Requires-Dist: python-dotenv>=1.0.0; extra == 'full'
Requires-Dist: redis>=5.0.0; extra == 'full'
Requires-Dist: torch>=2.0.0; extra == 'full'
Requires-Dist: transformers>=4.35.0; extra == 'full'
Requires-Dist: uvicorn[standard]>=0.27.0; extra == 'full'
Provides-Extra: ml
Requires-Dist: mlx>=0.5.0; (sys_platform == 'darwin') and extra == 'ml'
Requires-Dist: torch>=2.0.0; extra == 'ml'
Requires-Dist: transformers>=4.35.0; extra == 'ml'
Provides-Extra: neo4j
Requires-Dist: neo4j>=5.0.0; extra == 'neo4j'
Provides-Extra: viz
Requires-Dist: fastapi>=0.109.0; extra == 'viz'
Requires-Dist: neo4j>=5.0.0; extra == 'viz'
Requires-Dist: uvicorn[standard]>=0.27.0; extra == 'viz'
Description-Content-Type: text/markdown

# InALign - AI Agent Governance Platform

**Know what your AI agents did. Prove it.**

Tamper-proof audit trails for AI agents with cryptographic provenance tracking. Essential for compliance, incident response, and trust.

## Features

### Provenance Chain
- **SHA-256 Hash Chain**: Every action creates a cryptographic record linked to the previous one
- **Tamper-Proof**: Modification of any record breaks the chain—immediately detectable
- **W3C PROV Compatible**: Export provenance in standard PROV-JSON format

### User Command Tracking
- **Prompt Recording**: Know exactly what command triggered each action
- **Privacy Options**: Store full commands or hash-only for sensitive data
- **Complete Attribution**: Chain from human intent to agent execution

### Instant Search & Trace
- **Sub-second Search**: Find any action across all sessions instantly
- **Incident Investigation**: "Who modified config.py?" → immediate answer
- **Session Timeline**: Full chronological view of agent activity

### Audit & Compliance
- **Merkle Root Certificates**: Cryptographic proof of chain integrity
- **Export Reports**: JSON, summary, or PROV-JSONLD formats
- **Third-Party Verification**: Verify without trusting InALign

### Policy Engine
- **Configurable Presets**: STRICT_ENTERPRISE, BALANCED, DEV_SANDBOX
- **Runtime Switching**: Change policies without restart
- **Policy Simulation**: Test policies against historical events

## Supported Agents

| Agent | Support |
|-------|---------|
| Claude Code | Native MCP |
| Cursor | Native MCP |
| Windsurf | Native MCP |
| Continue.dev | Native MCP |
| Cline | Native MCP |
| Custom Agents | MCP Protocol |

## Quick Start

### 1. Install

```bash
pip install inalign-mcp
```

### 2. Configure Claude Code

Add to `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "inalign": {
      "command": "inalign-mcp",
      "env": {
        "API_KEY": "your-api-key"
      }
    }
  }
}
```

### 3. Done!

All agent actions are now automatically recorded with cryptographic provenance.

## MCP Tools

### Provenance Tools

| Tool | Description |
|------|-------------|
| `record_user_command` | Record the user's command/prompt that triggered actions |
| `record_action` | Record an agent action with cryptographic hash |
| `get_provenance` | Get provenance chain (summary/full/prov-jsonld) |
| `verify_provenance` | Verify chain integrity |
| `generate_audit_report` | Generate comprehensive audit report |
| `verify_third_party` | Generate third-party verifiable proof |

### Risk Analysis Tools

| Tool | Description |
|------|-------------|
| `analyze_risk` | Run GraphRAG pattern detection on session |
| `get_behavior_profile` | Get behavioral analysis |
| `get_agent_risk` | Get long-term risk profile for an agent |
| `get_user_risk` | Get aggregated risk for a user/team |
| `list_agents_risk` | Get risk summary for all agents |

### Policy Tools

| Tool | Description |
|------|-------------|
| `get_policy` | Get current policy settings |
| `set_policy` | Change policy preset |
| `list_policies` | List all available presets |
| `simulate_policy` | Test policy against historical events |

## Example: Incident Investigation

**Scenario**: `config.py` was unexpectedly modified.

```python
# Search for who touched the file
results = trace_file("config.py")

# Output:
# Time: 2026-02-05T11:12:06
# Action: write_file
# User Command: "Delete all logs from /var/log"
# User ID: suspicious-user-123
# Hash: e46903fe63f24a3e...
#
# Chain Integrity: VERIFIED
# Cannot be denied - cryptographically proven.
```

## Dashboard

Start the dashboard:

```bash
inalign-dashboard
```

Access at `http://localhost:8080` with your API key.

**Features**:
- Real-time activity monitoring
- Search & trace interface
- Audit report export
- Policy management

## Architecture

```
┌─────────────────────────────────────────────────────────┐
│  AI Agent (Claude Code / Cursor / etc.)                 │
│                                                         │
│  ┌─────────────────────────────────────────────────┐   │
│  │ InALign MCP Server                               │   │
│  │                                                  │   │
│  │  Every tool call → Provenance Chain             │   │
│  │  SHA-256 Hash → Previous Hash Link              │   │
│  │  Neo4j Storage → Graph Analysis                 │   │
│  └─────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────┘
                         │
                         ▼
┌─────────────────────────────────────────────────────────┐
│  Dashboard                                              │
│  - Activity monitoring                                  │
│  - Search & trace                                       │
│  - Audit export                                         │
│  - Policy management                                    │
└─────────────────────────────────────────────────────────┘
```

## Neo4j Graph Schema

```cypher
// Nodes
(:Session {session_id, created_at, agent_name, user_id})
(:Agent {id, type, name})
(:ProvenanceRecord {id, timestamp, activity_type, activity_name, record_hash})
(:Entity {id, type, value_hash})

// Relationships
(ProvenanceRecord)-[:BELONGS_TO]->(Session)
(ProvenanceRecord)-[:PERFORMED_BY]->(Agent)
(ProvenanceRecord)-[:USED]->(Entity)
(ProvenanceRecord)-[:GENERATED]->(Entity)
(ProvenanceRecord)-[:FOLLOWS]->(ProvenanceRecord)
```

## Pricing

| Plan | Actions/mo | Retention | Agents | Price |
|------|-----------|-----------|--------|-------|
| Starter | 1,000 | 7 days | 1 | Free |
| Pro | 50,000 | 30 days | 10 | $49/mo |
| Enterprise | Unlimited | 1 year | Unlimited | Custom |

## Environment Variables

```bash
# Neo4j
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password

# API
API_PORT=8080
```

## Development

```bash
# Install
pip install -e ".[dev]"

# Run tests
pytest

# Format
black src/
```

## License

MIT License

## Contact

- Website: https://inalign.dev
- GitHub: https://github.com/inalign/mcp-server
