Skip to navigation

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

pip install mima-governance

Configure

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:

@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

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

npm install @mima-ai/governance

Configure

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

First attestation

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

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.

{
"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 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

GoalDoc
All 11 GRC record typesrecord-types.md
Full Python SDK referencepython.md
Full TypeScript SDK referencetypescript.md
OTEL / runtime guardotel.md
MCP server toolsmcp.md
ESLint plugineslint.md
CLI referencecli.md
REST API referenceapi-reference.md