> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mima.works/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mima.works/_mcp/server.

# Quickstart — Mima Governance SDK

Five minutes from install to your first compliance record in the ledger.

---

## Prerequisites

* A Mima workspace (sign up at app.mima.works)
* An API key from **Settings → API Keys** (`mima_ext_...`)
* Python 3.9+ **or** Node.js 18+

---

## Python

### Install

```bash
pip install mima-governance
```

### Configure

```python
from mima_governance import MimaGovernance

mima = MimaGovernance(
    api_key="mima_ext_...",
    system_name="customer-support-ai",
)
```

The SDK resolves your workspace automatically from the API key. Pass `workspace_id=` explicitly only when managing multiple workspaces.

### First attestation

Wrap the function that calls your LLM:

```python
@mima.attest(tool_name="generate_response")
def generate_response(user_message: str) -> str:
    return claude.messages.create(
        model="claude-opus-4-6",
        messages=[{"role": "user", "content": user_message}],
    ).content[0].text

result = generate_response("How do I reset my password?")
# One attestation record is now in the Mima ledger.
```

### First GRC record

```python
mima.works_risk_assessment(
    system_name="customer-support-ai",
    risk_tier="limited",
    use_case="Customer support question routing",
    intended_purpose="Route customer queries to the correct support team",
    impact_domains=["customer_service"],
    art5_self_assessment=True,
    assessor="alice@example.com",
)
```

Check your posture at **app.mima.works/posture** — the record appears within seconds.

---

## TypeScript

### Install

```bash
npm install @mima-ai/governance
```

### Configure

```typescript
import { MimaGovernance } from '@mima-ai/governance';

const mima = new MimaGovernance({
  apiKey: process.env.MIMA_API_KEY!,
  systemName: 'customer-support-ai',
});
```

### First attestation

```typescript
const generateResponse = mima.wrap('generate_response', async (userMessage: string) => {
  const msg = await anthropic.messages.create({
    model: 'claude-opus-4-6',
    messages: [{ role: 'user', content: userMessage }],
  });
  return msg.content[0].type === 'text' ? msg.content[0].text : '';
});

const reply = await generateResponse('How do I reset my password?');
// Attestation record pushed automatically.
```

### First GRC record

```typescript
await mima.worksRiskAssessment(
  'customer-support-ai',
  'limited',
  'Customer support question routing',
  {
    intendedPurpose: 'Route customer queries to the correct support team',
    impactDomains: ['customer_service'],
    art5SelfAssessment: true,
    assessor: 'alice@example.com',
  },
);
```

---

## Using the MCP server (Claude Code / Cursor)

If you're using an AI coding agent rather than app code, configure the MCP server instead of the SDK. It works for any language.

```json
{
  "mcpServers": {
    "mima-governance": {
      "command": "npx",
      "args": ["-y", "@mima-ai/governance-mcp@0.1.13"],
      "env": {
        "MIMA_API_KEY": "mima_ext_...",
        "MIMA_SYSTEM_NAME": "customer-support-ai"
      }
    }
  }
}
```

Then ask your agent: *"Use mima to check my governance posture"* or *"Log an AI risk assessment for this system."*

See [mcp.md](./mcp.md) for the full tool reference.

---

## What happens next

1. Records flow into the Mima evidence ledger, timestamped and HMAC-signed.
2. Each record earns mapped controls (e.g. `EUAIA_ART9`, `ISO42001_6_1`).
3. Your posture score updates in real time on the dashboard.
4. Gates check for required evidence before deploys or quarterly reviews.

---

## Next steps

| Goal                          | Doc                                    |
| ----------------------------- | -------------------------------------- |
| All 11 GRC record types       | [record-types.md](./record-types.md)   |
| Full Python SDK reference     | [python.md](./python.md)               |
| Full TypeScript SDK reference | [typescript.md](./typescript.md)       |
| OTEL / runtime guard          | [otel.md](./otel.md)                   |
| MCP server tools              | [mcp.md](./mcp.md)                     |
| ESLint plugin                 | [eslint.md](./eslint.md)               |
| CLI reference                 | [cli.md](./cli.md)                     |
| REST API reference            | [api-reference.md](./api-reference.md) |