Metadata-Version: 2.4
Name: theartofservice-compliance
Version: 0.1.2
Summary: TheArtOfService Compliance Intelligence SDK - Langchain tools for the full compliance framework catalogue
Author-email: TheArtOfService <support@theartofservice.com>
License-Expression: MIT
Project-URL: Homepage, https://compliance.theartofservice.com
Project-URL: API, https://api.theartofservice.com
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Requires-Dist: langchain-core>=0.1
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# theartofservice-compliance

TheArtOfService Compliance Intelligence SDK. Langchain tools over a compliance control
graph of frameworks, controls and cross-framework mappings. Live counts:
https://api.theartofservice.com/api/agent/stats

## Installation

```bash
pip install theartofservice-compliance
```

## Quick Start

### Direct API Client

```python
from theartofservice_compliance import ComplianceClient

client = ComplianceClient(api_key="your-api-key")

# Search frameworks
results = client.search_frameworks("ISO 27001")

# Get framework details
framework = client.get_framework("ISO-27001")

# Cross-framework mapping
mappings = client.cross_framework_map(source="ISO-27001", target="SOC-2")

# Coverage report
coverage = client.coverage_report("NIST-CSF")

# Gap analysis between frameworks
gaps = client.gap_analysis(source="ISO-27001", target="NIST-CSF")

# Search individual controls
controls = client.search_controls("access control")

# Ask the AI compliance advisor
answer = client.advisory_query(
    "What controls do I need for data encryption?",
    frameworks=["ISO-27001", "SOC-2"],
)
```

### Langchain Integration

```python
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate

from theartofservice_compliance import ComplianceToolkit

# Create the toolkit
toolkit = ComplianceToolkit(api_key="your-api-key")
tools = toolkit.get_tools()

# Set up a Langchain agent
llm = ChatOpenAI(model="gpt-4o")

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a compliance advisor with access to the framework catalogue."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

# Run a query
result = executor.invoke({
    "input": "Compare ISO 27001 and SOC 2 coverage for access control"
})
print(result["output"])
```

## Available Tools

| Tool | Description |
|---|---|
| `search_frameworks` | Search compliance frameworks by keyword |
| `get_framework_details` | Get details of a specific compliance framework |
| `cross_framework_mapping` | Map controls between two frameworks |
| `coverage_report` | Get coverage report for a framework |
| `compliance_gap_analysis` | Find gaps between two frameworks |
| `advisory_query` | Ask a compliance question to the AI advisor |

## API Reference

All tools communicate with the [TheArtOfService Compliance API](https://api.theartofservice.com). You need a valid API key to authenticate requests.

### Authentication

Pass your API key when initializing the client or toolkit:

```python
client = ComplianceClient(api_key="your-api-key")
# or
toolkit = ComplianceToolkit(api_key="your-api-key")
```

The key is sent as a Bearer token in the `Authorization` header.

## Links

- **Compliance Platform**: https://compliance.theartofservice.com
- **API**: https://api.theartofservice.com
- **npm MCP Server**: https://www.npmjs.com/package/@theartofservice/compliance-mcp

<!-- mcp-name: io.github.GJB65/compliance-intelligence -->
